material_components_web-sass 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +2 -0
- data/lib/material_components_web/sass/version.rb +1 -1
- data/vendor/assets/javascripts/material-components-web.js +1226 -1159
- data/vendor/assets/stylesheets/@material/button/mdc-button.scss +1 -0
- data/vendor/assets/stylesheets/@material/card/mdc-card.scss +30 -29
- data/vendor/assets/stylesheets/@material/checkbox/_variables.scss +2 -0
- data/vendor/assets/stylesheets/@material/checkbox/mdc-checkbox.scss +40 -23
- data/vendor/assets/stylesheets/@material/drawer/temporary/mdc-temporary-drawer.scss +1 -0
- data/vendor/assets/stylesheets/@material/layout-grid/_mixins.scss +134 -0
- data/vendor/assets/stylesheets/@material/layout-grid/_variables.scss +29 -0
- data/vendor/assets/stylesheets/@material/layout-grid/mdc-layout-grid.scss +61 -0
- data/vendor/assets/stylesheets/@material/radio/mdc-radio.scss +17 -17
- data/vendor/assets/stylesheets/@material/ripple/_keyframes.scss +5 -5
- data/vendor/assets/stylesheets/@material/ripple/_mixins.scss +29 -30
- data/vendor/assets/stylesheets/@material/ripple/mdc-ripple.scss +17 -17
- data/vendor/assets/stylesheets/@material/switch/_mixins.scss +18 -0
- data/vendor/assets/stylesheets/@material/switch/_variables.scss +33 -0
- data/vendor/assets/stylesheets/@material/switch/mdc-switch.scss +194 -0
- data/vendor/assets/stylesheets/_material-components-web.scss +2 -0
- metadata +8 -3
- data/vendor/assets/stylesheets/@material/ripple/_variables.scss +0 -17
@@ -0,0 +1,61 @@
|
|
1
|
+
// Copyright 2017 Google Inc. All Rights Reserved.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
@import "./variables";
|
16
|
+
@import "./mixins";
|
17
|
+
|
18
|
+
// postcss-bem-linter: define layout-grid
|
19
|
+
.mdc-layout-grid {
|
20
|
+
@include mdc-layout-grid($mdc-layout-grid-default-margin, $mdc-layout-grid-default-gutter);
|
21
|
+
}
|
22
|
+
|
23
|
+
.mdc-layout-grid__cell {
|
24
|
+
@include mdc-layout-grid-cell($mdc-layout-grid-default-gutter);
|
25
|
+
|
26
|
+
@each $size in map-keys($mdc-layout-grid-columns) {
|
27
|
+
@include mdc-layout-grid-media-query_($size) {
|
28
|
+
@for $span from 1 through map-get($mdc-layout-grid-columns, desktop) {
|
29
|
+
// Span classes.
|
30
|
+
// stylelint-disable max-nesting-depth
|
31
|
+
@at-root .mdc-layout-grid__cell--span-#{$span},
|
32
|
+
.mdc-layout-grid__cell--span-#{$span}-#{$size}.mdc-layout-grid__cell--span-#{$span}-#{$size} {
|
33
|
+
@include mdc-layout-grid-cell-span_($size, $span, $mdc-layout-grid-default-gutter);
|
34
|
+
}
|
35
|
+
// stylelint-enable max-nesting-depth
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
// Order override classes.
|
41
|
+
@for $i from 1 through map-get($mdc-layout-grid-columns, desktop) {
|
42
|
+
&--order-#{$i} {
|
43
|
+
@include mdc-layout-grid-cell-order($i);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
// Alignment classes.
|
48
|
+
&--align-top {
|
49
|
+
@include mdc-layout-grid-cell-align(top);
|
50
|
+
}
|
51
|
+
|
52
|
+
&--align-middle {
|
53
|
+
@include mdc-layout-grid-cell-align(middle);
|
54
|
+
}
|
55
|
+
|
56
|
+
&--align-bottom {
|
57
|
+
@include mdc-layout-grid-cell-align(bottom);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
// postcss-bem-linter: end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
//
|
2
|
+
// Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
16
|
|
17
17
|
@import "@material/animation/functions";
|
18
18
|
@import "@material/ripple/mixins";
|
@@ -31,7 +31,7 @@ $mdc-radio-transition-duration: 120ms;
|
|
31
31
|
@return mdc-animation-exit($name, $mdc-radio-transition-duration);
|
32
32
|
}
|
33
33
|
|
34
|
-
|
34
|
+
// postcss-bem-linter: define radio
|
35
35
|
.mdc-radio {
|
36
36
|
display: inline-block;
|
37
37
|
position: relative;
|
@@ -185,7 +185,7 @@ fieldset:disabled .mdc-radio__native-control,
|
|
185
185
|
}
|
186
186
|
}
|
187
187
|
|
188
|
-
|
188
|
+
// postcss-bem-linter: end
|
189
189
|
|
190
190
|
.mdc-radio.mdc-ripple-upgraded {
|
191
191
|
@include mdc-ripple-base;
|
@@ -16,16 +16,16 @@
|
|
16
16
|
|
17
17
|
/** MDC Ripple keyframes are split into their own file so that _mixins.scss can rely on them. */
|
18
18
|
|
19
|
-
@import "
|
19
|
+
@import "@material/animation/variables";
|
20
20
|
|
21
21
|
@keyframes mdc-ripple-fg-radius-in {
|
22
22
|
from {
|
23
|
-
transform: scale(
|
24
|
-
animation-timing-function: $mdc-
|
23
|
+
transform: translate(var(--mdc-ripple-fg-translate-start)) scale(1);
|
24
|
+
animation-timing-function: $mdc-animation-fast-out-slow-in-timing-function;
|
25
25
|
}
|
26
26
|
|
27
27
|
to {
|
28
|
-
transform: scale(
|
28
|
+
transform: translate(var(--mdc-ripple-fg-translate-end)) scale(var(--mdc-ripple-fg-scale));
|
29
29
|
}
|
30
30
|
}
|
31
31
|
|
@@ -56,6 +56,6 @@
|
|
56
56
|
}
|
57
57
|
|
58
58
|
to {
|
59
|
-
transform: scale(
|
59
|
+
transform: scale(var(--mdc-ripple-fg-scale));
|
60
60
|
}
|
61
61
|
}
|
@@ -1,22 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
//
|
2
|
+
// Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
//
|
15
|
+
|
16
|
+
@import "@material/animation/variables";
|
17
17
|
@import "@material/theme/variables";
|
18
18
|
@import "./keyframes";
|
19
|
-
@import "./variables";
|
20
19
|
|
21
20
|
@function mdc-ripple-default-config_() {
|
22
21
|
@return (
|
@@ -50,7 +49,7 @@
|
|
50
49
|
$opacity: map-get($config, opacity);
|
51
50
|
$theme-style: map-get($config, theme-style);
|
52
51
|
|
53
|
-
|
52
|
+
// stylelint-disable at-rule-empty-line-before, block-closing-brace-newline-after
|
54
53
|
@if ($theme-style) {
|
55
54
|
$theme-value: map-get($mdc-theme-property-values, $theme-style);
|
56
55
|
$css-var: var(--mdc-theme-#{$theme-style}, $theme-value);
|
@@ -66,7 +65,7 @@
|
|
66
65
|
} @else {
|
67
66
|
background-color: rgba($base-color, $opacity);
|
68
67
|
}
|
69
|
-
|
68
|
+
// stylelint-enable at-rule-empty-line-before, block-closing-brace-newline-after
|
70
69
|
}
|
71
70
|
|
72
71
|
@mixin mdc-ripple-bg-base_($config) {
|
@@ -79,7 +78,7 @@
|
|
79
78
|
left: calc(50% - #{$radius});
|
80
79
|
width: $radius * 2;
|
81
80
|
height: $radius * 2;
|
82
|
-
transform: scale(
|
81
|
+
transform: scale(var(--mdc-ripple-fg-scale));
|
83
82
|
transition: opacity 200ms linear;
|
84
83
|
border-radius: 50%;
|
85
84
|
opacity: 0;
|
@@ -90,7 +89,7 @@
|
|
90
89
|
$config: map-merge(mdc-ripple-default-config_(), $config);
|
91
90
|
$pseudo: map-get($config, pseudo);
|
92
91
|
|
93
|
-
|
92
|
+
// stylelint-disable at-rule-empty-line-before, block-closing-brace-newline-after
|
94
93
|
@if ($pseudo) {
|
95
94
|
&#{$pseudo} {
|
96
95
|
@include mdc-ripple-bg-base_($config);
|
@@ -100,7 +99,7 @@
|
|
100
99
|
} @else {
|
101
100
|
@include mdc-ripple-bg-base_($config);
|
102
101
|
}
|
103
|
-
|
102
|
+
// stylelint-enable at-rule-empty-line-before, block-closing-brace-newline-after
|
104
103
|
|
105
104
|
&.mdc-ripple-upgraded--background-active#{$pseudo} {
|
106
105
|
opacity: .99999;
|
@@ -130,6 +129,8 @@
|
|
130
129
|
@include mdc-ripple-color_($config);
|
131
130
|
|
132
131
|
position: absolute;
|
132
|
+
top: 0;
|
133
|
+
left: 0;
|
133
134
|
width: var(--mdc-ripple-fg-size);
|
134
135
|
height: var(--mdc-ripple-fg-size);
|
135
136
|
transform: scale(0);
|
@@ -143,7 +144,7 @@
|
|
143
144
|
$config: map-merge(mdc-ripple-default-config_(), $config);
|
144
145
|
$pseudo: map-get($config, pseudo);
|
145
146
|
|
146
|
-
|
147
|
+
// stylelint-disable at-rule-empty-line-before, block-closing-brace-newline-after
|
147
148
|
@if ($pseudo) {
|
148
149
|
&#{$pseudo} {
|
149
150
|
@include mdc-ripple-fg-base_($config);
|
@@ -153,27 +154,25 @@
|
|
153
154
|
} @else {
|
154
155
|
@include mdc-ripple-fg-base_($config);
|
155
156
|
}
|
156
|
-
|
157
|
+
// stylelint-enable at-rule-empty-line-before, block-closing-brace-newline-after
|
157
158
|
|
158
159
|
&:not(.mdc-ripple-upgraded--unbounded)#{$pseudo} {
|
159
|
-
top: calc(var(--mdc-ripple-top) - var(--mdc-ripple-fg-size) / 2);
|
160
|
-
left: calc(var(--mdc-ripple-left) - var(--mdc-ripple-fg-size) / 2);
|
161
160
|
transform-origin: center center;
|
162
161
|
}
|
163
162
|
|
164
163
|
&.mdc-ripple-upgraded--unbounded#{$pseudo} {
|
165
164
|
top: var(--mdc-ripple-top);
|
166
165
|
left: var(--mdc-ripple-left);
|
167
|
-
transform-origin:
|
166
|
+
transform-origin: center center;
|
168
167
|
}
|
169
168
|
|
170
169
|
&.mdc-ripple-upgraded--foreground-bounded-active-fill#{$pseudo} {
|
171
170
|
animation-fill-mode: forwards;
|
172
|
-
animation:
|
171
|
+
animation: 300ms mdc-ripple-fg-radius-in, 400ms mdc-ripple-fg-opacity-out;
|
173
172
|
}
|
174
173
|
|
175
174
|
&.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded--foreground-unbounded-activation#{$pseudo} {
|
176
|
-
transform: scale(
|
175
|
+
transform: scale(var(--mdc-ripple-fg-scale));
|
177
176
|
transition:
|
178
177
|
opacity 110ms linear,
|
179
178
|
transform var(--mdc-ripple-fg-unbounded-transform-duration) linear 80ms;
|
@@ -183,6 +182,6 @@
|
|
183
182
|
&.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded--foreground-unbounded-deactivation#{$pseudo} {
|
184
183
|
animation:
|
185
184
|
mdc-ripple-fg-unbounded-opacity-deactivate var(--mdc-ripple-fg-unbounded-opacity-duration) linear,
|
186
|
-
mdc-ripple-fg-unbounded-transform-deactivate var(--mdc-ripple-fg-unbounded-transform-duration) $mdc-
|
185
|
+
mdc-ripple-fg-unbounded-transform-deactivate var(--mdc-ripple-fg-unbounded-transform-duration) $mdc-animation-fast-out-slow-in-timing-function;
|
187
186
|
}
|
188
187
|
}
|
@@ -1,24 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
//
|
2
|
+
// Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
16
|
|
17
17
|
@import "@material/animation/functions";
|
18
18
|
@import "@material/theme/mixins";
|
19
19
|
@import "./mixins";
|
20
20
|
|
21
|
-
|
21
|
+
// postcss-bem-linter: define ripple-surface
|
22
22
|
|
23
23
|
.mdc-ripple-surface {
|
24
24
|
position: relative;
|
@@ -77,4 +77,4 @@
|
|
77
77
|
}
|
78
78
|
}
|
79
79
|
|
80
|
-
|
80
|
+
// postcss-bem-linter: end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//
|
2
|
+
// Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
//
|
15
|
+
|
16
|
+
@function mdc-switch-transition($property, $timing-function, $duration: $mdc-switch-transition-duration) {
|
17
|
+
@return $property $duration $timing-function;
|
18
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
//
|
2
|
+
// Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
|
+
|
17
|
+
$mdc-switch-track-width: 34px;
|
18
|
+
$mdc-switch-track-height: 14px;
|
19
|
+
$mdc-switch-knob-diameter: 20px;
|
20
|
+
$mdc-switch-focus-ring-diameter: 48px;
|
21
|
+
$mdc-switch-knob-active-margin: $mdc-switch-track-width - $mdc-switch-knob-diameter;
|
22
|
+
|
23
|
+
$mdc-switch-unchecked-track-color: #000;
|
24
|
+
$mdc-switch-unchecked-knob-color: #fafafa;
|
25
|
+
$mdc-switch-unchecked-focus-ring-color: #9e9e9e;
|
26
|
+
$mdc-switch-unchecked-knob-color-dark: #bdbdbd;
|
27
|
+
$mdc-switch-unchecked-track-color-dark: #fff;
|
28
|
+
$mdc-switch-unchecked-focus-ring-color-dark: #f1f1f1;
|
29
|
+
$mdc-switch-disabled-knob-color: #bdbdbd;
|
30
|
+
$mdc-switch-disabled-knob-color-dark: #424242;
|
31
|
+
|
32
|
+
$mdc-switch-transition-duration: 175ms;
|
33
|
+
$mdc-switch-transition-curve: cubic-bezier(.4, 0, .2, 1);
|
@@ -0,0 +1,194 @@
|
|
1
|
+
// Copyright 2016 Google Inc. All Rights Reserved.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
@import "@material/animation/functions";
|
16
|
+
@import "@material/animation/variables";
|
17
|
+
@import "@material/elevation/mixins";
|
18
|
+
@import "@material/theme/mixins";
|
19
|
+
@import "./mixins";
|
20
|
+
@import "./variables";
|
21
|
+
|
22
|
+
// postcss-bem-linter: define switch
|
23
|
+
.mdc-switch {
|
24
|
+
display: inline-block;
|
25
|
+
position: relative;
|
26
|
+
|
27
|
+
&__native-control {
|
28
|
+
display: inline-block;
|
29
|
+
position: absolute;
|
30
|
+
top: 0;
|
31
|
+
left: 0;
|
32
|
+
width: $mdc-switch-track-width;
|
33
|
+
height: $mdc-switch-track-height;
|
34
|
+
cursor: pointer;
|
35
|
+
opacity: 0;
|
36
|
+
z-index: 2;
|
37
|
+
}
|
38
|
+
|
39
|
+
&__background {
|
40
|
+
display: block;
|
41
|
+
position: relative;
|
42
|
+
width: $mdc-switch-track-width;
|
43
|
+
height: $mdc-switch-track-height;
|
44
|
+
border-radius: 7px;
|
45
|
+
outline: none;
|
46
|
+
background-color: transparent;
|
47
|
+
cursor: pointer;
|
48
|
+
user-select: none;
|
49
|
+
|
50
|
+
@include mdc-theme-dark(".mdc-checkbox") {
|
51
|
+
background-color: transparent;
|
52
|
+
}
|
53
|
+
|
54
|
+
&::before {
|
55
|
+
display: block;
|
56
|
+
position: absolute;
|
57
|
+
top: 0;
|
58
|
+
right: 0;
|
59
|
+
bottom: 0;
|
60
|
+
left: 0;
|
61
|
+
transition:
|
62
|
+
mdc-checkbox-transition(opacity, $mdc-switch-transition-curve),
|
63
|
+
mdc-checkbox-transition(background-color, $mdc-switch-transition-curve);
|
64
|
+
border-radius: 7px;
|
65
|
+
background-color: $mdc-switch-unchecked-track-color;
|
66
|
+
content: "";
|
67
|
+
opacity: .38;
|
68
|
+
|
69
|
+
@include mdc-theme-dark(".mdc-checkbox") {
|
70
|
+
background-color: $mdc-switch-unchecked-track-color-dark;
|
71
|
+
opacity: .3;
|
72
|
+
}
|
73
|
+
|
74
|
+
}
|
75
|
+
|
76
|
+
// postcss-bem-linter: ignore
|
77
|
+
.mdc-switch__knob {
|
78
|
+
display: block;
|
79
|
+
position: absolute;
|
80
|
+
top: -3px;
|
81
|
+
left: 0;
|
82
|
+
width: $mdc-switch-knob-diameter;
|
83
|
+
height: $mdc-switch-knob-diameter;
|
84
|
+
transform: translateX(0);
|
85
|
+
transition:
|
86
|
+
mdc-checkbox-transition(transform, $mdc-switch-transition-curve),
|
87
|
+
mdc-checkbox-transition(background-color, $mdc-switch-transition-curve);
|
88
|
+
border-radius: $mdc-switch-knob-diameter / 2;
|
89
|
+
background-color: $mdc-switch-unchecked-knob-color;
|
90
|
+
|
91
|
+
@include mdc-theme-dark(".mdc-checkbox") {
|
92
|
+
background-color: $mdc-switch-unchecked-knob-color-dark;
|
93
|
+
}
|
94
|
+
|
95
|
+
@include mdc-elevation(2);
|
96
|
+
|
97
|
+
z-index: 1;
|
98
|
+
|
99
|
+
// postcss-bem-linter: ignore
|
100
|
+
&::before {
|
101
|
+
position: absolute;
|
102
|
+
top: -14px;
|
103
|
+
left: -14px;
|
104
|
+
width: $mdc-switch-focus-ring-diameter;
|
105
|
+
height: $mdc-switch-focus-ring-diameter;
|
106
|
+
transform: scale(0);
|
107
|
+
transition:
|
108
|
+
mdc-checkbox-transition(transform, $mdc-switch-transition-curve),
|
109
|
+
mdc-checkbox-transition(background-color, $mdc-switch-transition-curve);
|
110
|
+
border-radius: $mdc-switch-focus-ring-diameter / 2;
|
111
|
+
background-color: transparent;
|
112
|
+
content: "";
|
113
|
+
opacity: .2;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
.mdc-switch__native-control:focus ~ .mdc-switch__background {
|
120
|
+
|
121
|
+
.mdc-switch__knob {
|
122
|
+
&::before {
|
123
|
+
position: absolute;
|
124
|
+
width: $mdc-switch-focus-ring-diameter;
|
125
|
+
height: $mdc-switch-focus-ring-diameter;
|
126
|
+
transform: scale(1);
|
127
|
+
transition:
|
128
|
+
mdc-checkbox-transition(transform, $mdc-switch-transition-curve),
|
129
|
+
mdc-checkbox-transition(background-color, $mdc-switch-transition-curve);
|
130
|
+
border-radius: $mdc-switch-focus-ring-diameter / 2;
|
131
|
+
background-color: $mdc-switch-unchecked-focus-ring-color;
|
132
|
+
|
133
|
+
@include mdc-theme-dark(".mdc-checkbox") {
|
134
|
+
background-color: $mdc-switch-unchecked-focus-ring-color-dark;
|
135
|
+
opacity: .14;
|
136
|
+
}
|
137
|
+
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
.mdc-switch__native-control:checked ~ .mdc-switch__background {
|
143
|
+
|
144
|
+
&::before {
|
145
|
+
@include mdc-theme-prop(background-color, primary);
|
146
|
+
opacity: .5;
|
147
|
+
}
|
148
|
+
|
149
|
+
.mdc-switch__knob {
|
150
|
+
transform: translateX($mdc-switch-track-width - $mdc-switch-knob-diameter);
|
151
|
+
transition:
|
152
|
+
mdc-checkbox-transition(transform, $mdc-switch-transition-curve),
|
153
|
+
mdc-checkbox-transition(background-color, $mdc-switch-transition-curve);
|
154
|
+
|
155
|
+
@include mdc-theme-prop(background-color, primary);
|
156
|
+
|
157
|
+
&::before {
|
158
|
+
@include mdc-theme-prop(background-color, primary);
|
159
|
+
|
160
|
+
@include mdc-theme-dark(".mdc-checkbox") {
|
161
|
+
@include mdc-theme-prop(background-color, primary);
|
162
|
+
}
|
163
|
+
|
164
|
+
opacity: .15;
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
// postcss-bem-linter: end
|
170
|
+
|
171
|
+
.mdc-switch__native-control:disabled {
|
172
|
+
cursor: initial;
|
173
|
+
}
|
174
|
+
|
175
|
+
.mdc-switch__native-control:disabled ~ .mdc-switch__background {
|
176
|
+
|
177
|
+
&::before {
|
178
|
+
background-color: $mdc-switch-unchecked-track-color;
|
179
|
+
opacity: .12;
|
180
|
+
|
181
|
+
@include mdc-theme-dark(".mdc-checkbox") {
|
182
|
+
background-color: $mdc-switch-unchecked-track-color-dark;
|
183
|
+
opacity: .1;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
.mdc-switch__knob {
|
188
|
+
background-color: $mdc-switch-disabled-knob-color;
|
189
|
+
|
190
|
+
@include mdc-theme-dark(".mdc-checkbox") {
|
191
|
+
background-color: $mdc-switch-disabled-knob-color-dark;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
}
|