Welcome to mirror list, hosted at ThFree Co, Russian Federation.

toggles.scss « sass - github.com/twbs/ratchet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d726757dcb6685e191b92de3d637273a55519c6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Toggle styles (to be used with toggles.js)
// --------------------------------------------------

.toggle {
  display: block;
  position: relative;
  width: 74px;
  height: 30px;
  background-color: #fff;
  border: 2px solid #ddd;
  border-radius: 20px;
  @include transition-property(background-color, border);
  @include transition-duration(.2s);

  // Sliding handle
  .toggle-handle {
    position: absolute;
    top: -1px;
    left: -1px;
    z-index: 2;
    width: 28px;
    height: 28px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 100px;
    -webkit-transition-property: -webkit-transform, border, width;
       -moz-transition-property: -moz-transform, border, width;
            transition-property: transform, border, width;
    @include transition-duration(.2s);
  }
  &:before {
    position: absolute;
    top: 3px;
    right: 11px;
    color: #999;
    font-size: 13px;
    text-transform: uppercase;
    content: "Off";
  }

  // Active state for toggle
  &.active {
    border: 2px solid $positive-color;
    background-color: $positive-color;

    .toggle-handle {
      border-color: $positive-color;
      @include transform(translate3d(44px,0,0)); 
    }
    &:before {
      right: auto;
      left: 15px;
      color: #fff;
      content: "On";
    }
  }
  // Hide the checkbox
  input[type="checkbox"] {
    display: none;
  }
}