|
4 | 4 | * --------------------------------------------------
|
5 | 5 | */
|
6 | 6 |
|
7 |
| -/* the overall container of the toggle */ |
| 7 | +.item-toggle { |
| 8 | + pointer-events: none; |
| 9 | +} |
| 10 | + |
8 | 11 | .toggle {
|
9 | 12 | // set the color defaults
|
10 | 13 | @include toggle-style($toggle-on-default-border, $toggle-on-default-bg);
|
11 | 14 |
|
12 | 15 | position: relative;
|
13 | 16 | display: inline-block;
|
| 17 | + pointer-events: auto; |
14 | 18 | margin: -$toggle-hit-area-expansion;
|
15 | 19 | padding: $toggle-hit-area-expansion;
|
16 | 20 |
|
|
49 | 53 | }
|
50 | 54 | }
|
51 | 55 |
|
52 |
| -/* hide the actual input checkbox */ |
53 | 56 | .toggle input {
|
| 57 | + // hide the actual input checkbox |
54 | 58 | display: none;
|
55 | 59 | }
|
56 | 60 |
|
|
69 | 73 | background-color: $toggle-off-bg-color;
|
70 | 74 | content: ' ';
|
71 | 75 | cursor: pointer;
|
| 76 | + pointer-events: none; |
72 | 77 | }
|
73 | 78 |
|
74 | 79 | /* the handle (circle) thats inside the toggle's track area */
|
75 | 80 | /* also the handle's appearance when it is "off" */
|
76 | 81 | .toggle .handle {
|
77 | 82 | @include transition($toggle-transition-duration ease-in-out);
|
78 | 83 | position: absolute;
|
79 |
| - top: $toggle-border-width + $toggle-hit-area-expansion; |
80 |
| - left: $toggle-border-width + $toggle-hit-area-expansion; |
81 | 84 | display: block;
|
82 | 85 | width: $toggle-handle-width;
|
83 | 86 | height: $toggle-handle-height;
|
84 | 87 | border-radius: $toggle-handle-radius;
|
85 | 88 | background-color: $toggle-handle-off-bg-color;
|
| 89 | + top: $toggle-border-width + $toggle-hit-area-expansion; |
| 90 | + left: $toggle-border-width + $toggle-hit-area-expansion; |
86 | 91 |
|
87 |
| - /* used to create a larger (but hidden) hit area to slide the handle */ |
88 | 92 | &:before {
|
| 93 | + // used to create a larger (but hidden) hit area to slide the handle |
89 | 94 | position: absolute;
|
90 | 95 | top: -4px;
|
91 | 96 | left: ( ($toggle-handle-width / 2) * -1) - 8;
|
|
94 | 99 | }
|
95 | 100 | }
|
96 | 101 |
|
97 |
| - /* the handle when the toggle is "on" */ |
98 | 102 | .toggle input:checked + .track .handle {
|
| 103 | + // the handle when the toggle is "on" |
99 | 104 | @include translate3d($toggle-width - $toggle-handle-width - ($toggle-border-width * 2), 0, 0);
|
100 | 105 | background-color: $toggle-handle-on-bg-color;
|
101 | 106 | }
|
102 | 107 |
|
103 |
| -/* make sure list item content have enough padding on right to fit the toggle */ |
104 | 108 | .item-toggle {
|
| 109 | + // make sure list item content have enough padding on right to fit the toggle |
105 | 110 | padding-right: ($item-padding * 3) + $toggle-width;
|
106 | 111 |
|
107 | 112 | &.active {
|
108 | 113 | box-shadow: none;
|
109 | 114 | }
|
110 | 115 | }
|
111 | 116 |
|
112 |
| -/* position the toggle to the right within a list item */ |
113 | 117 | .item-toggle .toggle {
|
| 118 | + // position the toggle to the right within a list item |
114 | 119 | position: absolute;
|
115 | 120 | top: $item-padding / 2;
|
116 | 121 | right: $item-padding;
|
|
0 commit comments