@materializecss/materialize 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +94 -94
- package/dist/css/materialize.colors.min.css +6 -0
- package/dist/css/materialize.css +9624 -8820
- package/dist/css/materialize.min.css +6 -8
- package/dist/css/materialize.min.css.map +1 -1
- package/dist/js/materialize.cjs.js +8370 -7926
- package/dist/js/materialize.d.ts +2552 -2491
- package/dist/js/materialize.js +8375 -7931
- package/dist/js/materialize.min.js +6 -6
- package/dist/js/materialize.mjs +8342 -7898
- package/package.json +95 -79
- package/sass/{components/_color-variables.scss → _colors.scss} +403 -370
- package/sass/{components/_global.scss → _global.scss} +490 -558
- package/sass/{components/_grid.scss → _grid.scss} +172 -170
- package/sass/{components/_table_of_contents.scss → _table_of_contents.scss} +28 -32
- package/sass/{components/_tapTarget.scss → _tapTarget.scss} +102 -103
- package/sass/{components/_typography.scss → _typography.scss} +59 -62
- package/sass/{components/_variables.scss → _variables.scss} +57 -56
- package/sass/components/forms/_forms.scss +19 -24
- package/sass/materialize.scss +48 -47
- package/sass/mixins.module.scss +168 -0
- package/sass/components/_badges.scss +0 -75
- package/sass/components/_buttons.scss +0 -455
- package/sass/components/_cards.scss +0 -210
- package/sass/components/_carousel.scss +0 -95
- package/sass/components/_chips.scss +0 -148
- package/sass/components/_collapsible.scss +0 -80
- package/sass/components/_collection.scss +0 -115
- package/sass/components/_color-classes.scss +0 -32
- package/sass/components/_datepicker.scss +0 -216
- package/sass/components/_dropdown.scss +0 -78
- package/sass/components/_icons-material-design.scss +0 -6
- package/sass/components/_materialbox.scss +0 -43
- package/sass/components/_modal.scss +0 -68
- package/sass/components/_navbar.scss +0 -231
- package/sass/components/_normalize.scss +0 -349
- package/sass/components/_preloader.scss +0 -418
- package/sass/components/_pulse.scss +0 -35
- package/sass/components/_sidenav.scss +0 -249
- package/sass/components/_slider.scss +0 -121
- package/sass/components/_tabs.scss +0 -155
- package/sass/components/_timepicker.scss +0 -279
- package/sass/components/_toast.scss +0 -65
- package/sass/components/_tooltip.scss +0 -48
- package/sass/components/_transitions.scss +0 -13
- package/sass/components/colors.module.scss +0 -74
- package/sass/components/forms/_checkboxes.scss +0 -200
- package/sass/components/forms/_file-input.scss +0 -43
- package/sass/components/forms/_input-fields.scss +0 -350
- package/sass/components/forms/_radio-buttons.scss +0 -112
- package/sass/components/forms/_range.scss +0 -153
- package/sass/components/forms/_select.scss +0 -195
- package/sass/components/forms/_switches.scss +0 -122
- package/sass/components/theme.module.scss +0 -140
- package/sass/components/tokens.module.scss +0 -272
- package/sass/components/typography.module.scss +0 -150
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// Remove default Radio Buttons
|
|
2
|
-
[type="radio"]:not(:checked),
|
|
3
|
-
[type="radio"]:checked {
|
|
4
|
-
position: absolute;
|
|
5
|
-
opacity: 0;
|
|
6
|
-
pointer-events: none;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
[type="radio"]:not(:checked) + span,
|
|
10
|
-
[type="radio"]:checked + span {
|
|
11
|
-
position: relative;
|
|
12
|
-
padding-left: 35px;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
display: inline-block;
|
|
15
|
-
height: 25px;
|
|
16
|
-
line-height: 25px;
|
|
17
|
-
font-size: 1rem;
|
|
18
|
-
transition: .28s ease;
|
|
19
|
-
user-select: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
[type="radio"] + span:before,
|
|
23
|
-
[type="radio"] + span:after {
|
|
24
|
-
content: '';
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 0;
|
|
27
|
-
top: 0;
|
|
28
|
-
margin: 4px;
|
|
29
|
-
width: 16px;
|
|
30
|
-
height: 16px;
|
|
31
|
-
z-index: 0;
|
|
32
|
-
transition: .28s ease;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* Unchecked styles */
|
|
36
|
-
[type="radio"]:not(:checked) + span:before,
|
|
37
|
-
[type="radio"]:not(:checked) + span:after,
|
|
38
|
-
[type="radio"]:checked + span:before,
|
|
39
|
-
[type="radio"]:checked + span:after,
|
|
40
|
-
[type="radio"].with-gap:checked + span:before,
|
|
41
|
-
[type="radio"].with-gap:checked + span:after {
|
|
42
|
-
border-radius: 50%;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
[type="radio"]:not(:checked) + span:before,
|
|
46
|
-
[type="radio"]:not(:checked) + span:after {
|
|
47
|
-
border: 2px solid var(--md-sys-color-on-surface-variant);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
[type="radio"]:not(:checked) + span:after {
|
|
51
|
-
transform: scale(0);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Checked styles */
|
|
55
|
-
[type="radio"]:checked + span:before {
|
|
56
|
-
border: 2px solid transparent;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
[type="radio"]:checked + span:after,
|
|
60
|
-
[type="radio"].with-gap:checked + span:before,
|
|
61
|
-
[type="radio"].with-gap:checked + span:after {
|
|
62
|
-
border: 2px solid var(--md-sys-color-primary);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
[type="radio"]:checked + span:after,
|
|
66
|
-
[type="radio"].with-gap:checked + span:after {
|
|
67
|
-
background-color: var(--md-sys-color-primary);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
[type="radio"]:checked + span:after {
|
|
71
|
-
transform: scale(1.02);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Radio With gap */
|
|
75
|
-
[type="radio"].with-gap:checked + span:after {
|
|
76
|
-
transform: scale(.5);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Focused styles */
|
|
80
|
-
[type="radio"].tabbed:focus + span:before {
|
|
81
|
-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* Disabled Radio With gap */
|
|
85
|
-
[type="radio"].with-gap:disabled:checked + span:before {
|
|
86
|
-
border: 2px solid var(--md-sys-color-on-surface);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
[type="radio"].with-gap:disabled:checked + span:after {
|
|
90
|
-
border: none;
|
|
91
|
-
background-color: var(--md-sys-color-on-surface);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/* Disabled style */
|
|
95
|
-
[type="radio"]:disabled:not(:checked) + span:before,
|
|
96
|
-
[type="radio"]:disabled:checked + span:before {
|
|
97
|
-
background-color: transparent;
|
|
98
|
-
border-color: var(--md-sys-color-on-surface);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[type="radio"]:disabled + span {
|
|
102
|
-
color: var(--md-sys-color-on-surface);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
[type="radio"]:disabled:not(:checked) + span:before {
|
|
106
|
-
border-color: var(--md-sys-color-on-surface);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
[type="radio"]:disabled:checked + span:after {
|
|
110
|
-
background-color: var(--md-sys-color-on-surface);
|
|
111
|
-
border-color: var(--md-sys-color-on-surface);
|
|
112
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
.range-field {
|
|
2
|
-
position: relative;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
input[type=range],
|
|
6
|
-
input[type=range] + .thumb {
|
|
7
|
-
@extend .no-select;
|
|
8
|
-
cursor: pointer;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
input[type=range] {
|
|
12
|
-
position: relative;
|
|
13
|
-
background-color: transparent;
|
|
14
|
-
border: none;
|
|
15
|
-
outline: none;
|
|
16
|
-
width: 100%;
|
|
17
|
-
margin: 15px 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
|
|
20
|
-
&:focus {
|
|
21
|
-
outline: none;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
input[type=range] + .thumb {
|
|
26
|
-
position: absolute;
|
|
27
|
-
top: 10px;
|
|
28
|
-
left: 0;
|
|
29
|
-
border: none;
|
|
30
|
-
height: 0;
|
|
31
|
-
width: 0;
|
|
32
|
-
border-radius: 50%;
|
|
33
|
-
background-color: var(--md-sys-color-primary);
|
|
34
|
-
margin-left: 7px;
|
|
35
|
-
|
|
36
|
-
transform-origin: 50% 50%;
|
|
37
|
-
transform: rotate(-45deg);
|
|
38
|
-
|
|
39
|
-
.value {
|
|
40
|
-
display: block;
|
|
41
|
-
width: 30px;
|
|
42
|
-
text-align: center;
|
|
43
|
-
color: var(--md-sys-color-primary);
|
|
44
|
-
font-size: 0;
|
|
45
|
-
transform: rotate(45deg);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&.active {
|
|
49
|
-
border-radius: 50% 50% 50% 0;
|
|
50
|
-
|
|
51
|
-
.value {
|
|
52
|
-
color: var(--md-sys-color-on-primary);
|
|
53
|
-
margin-left: -1px;
|
|
54
|
-
margin-top: 8px;
|
|
55
|
-
font-size: 10px;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Shared
|
|
61
|
-
@mixin range-track {
|
|
62
|
-
height: 3px;
|
|
63
|
-
@extend .surface-variant;
|
|
64
|
-
border: none;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@mixin range-thumb {
|
|
68
|
-
border: none;
|
|
69
|
-
height: 14px;
|
|
70
|
-
width: 14px;
|
|
71
|
-
border-radius: 50%;
|
|
72
|
-
background: var(--md-sys-color-primary);
|
|
73
|
-
transition: box-shadow .3s;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// WebKit
|
|
77
|
-
input[type=range] {
|
|
78
|
-
-webkit-appearance: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
input[type=range]::-webkit-slider-runnable-track {
|
|
82
|
-
@include range-track;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
input[type=range]::-webkit-slider-thumb {
|
|
86
|
-
@include range-thumb;
|
|
87
|
-
-webkit-appearance: none;
|
|
88
|
-
background-color: var(--md-sys-color-primary);
|
|
89
|
-
transform-origin: 50% 50%;
|
|
90
|
-
margin: -5px 0 0 0;
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.keyboard-focused input[type=range]:focus:not(.active)::-webkit-slider-thumb {
|
|
95
|
-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// FireFox
|
|
99
|
-
input[type=range] {
|
|
100
|
-
/*required for proper track sizing in FF*/
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
input[type=range]::-moz-range-track {
|
|
104
|
-
@include range-track;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
input[type=range]::-moz-focus-inner {
|
|
108
|
-
border: 0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
input[type=range]::-moz-range-thumb {
|
|
112
|
-
@include range-thumb;
|
|
113
|
-
margin-top: -5px;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// hide the outline behind the border
|
|
117
|
-
input[type=range]:-moz-focusring {
|
|
118
|
-
outline: 1px solid #fff;
|
|
119
|
-
outline-offset: -1px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.keyboard-focused input[type=range]:focus:not(.active)::-moz-range-thumb {
|
|
123
|
-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
//------------------------------- Remove this?
|
|
127
|
-
// IE 10+
|
|
128
|
-
input[type=range]::-ms-track {
|
|
129
|
-
height: 3px;
|
|
130
|
-
// remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead
|
|
131
|
-
background: transparent;
|
|
132
|
-
// leave room for the larger thumb to overflow with a transparent border */
|
|
133
|
-
border-color: transparent;
|
|
134
|
-
border-width: 6px 0;
|
|
135
|
-
/*remove default tick marks*/
|
|
136
|
-
color: transparent;
|
|
137
|
-
}
|
|
138
|
-
input[type=range]::-ms-fill-lower,
|
|
139
|
-
input[type=range]::-moz-range-progress {
|
|
140
|
-
background: var(--md-sys-color-primary);
|
|
141
|
-
}
|
|
142
|
-
input[type=range]::-ms-fill-upper,
|
|
143
|
-
input[type=range]::-moz-range-track {
|
|
144
|
-
background: var(--md-sys-color-shadow-light);
|
|
145
|
-
}
|
|
146
|
-
input[type=range]::-ms-thumb {
|
|
147
|
-
@include range-thumb;
|
|
148
|
-
}
|
|
149
|
-
//--------------------------------
|
|
150
|
-
|
|
151
|
-
.keyboard-focused input[type=range]:focus:not(.active)::-ms-thumb {
|
|
152
|
-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
153
|
-
}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
select.browser-default {
|
|
2
|
-
opacity: 1;
|
|
3
|
-
color: var(--md-sys-color-on-background);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
select {
|
|
7
|
-
opacity: 0;
|
|
8
|
-
background-color: var(--md-sys-color-surface);
|
|
9
|
-
width: 100%;
|
|
10
|
-
padding: 5px;
|
|
11
|
-
border: 1px solid var(--md-sys-color-outline-variant);
|
|
12
|
-
border-radius: 2px;
|
|
13
|
-
height: 3rem;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.select-wrapper {
|
|
17
|
-
/*
|
|
18
|
-
&.valid .helper-text[data-success],
|
|
19
|
-
&.invalid ~ .helper-text[data-error] {
|
|
20
|
-
@extend %hidden-text;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&.valid {
|
|
24
|
-
& > input.select-dropdown {
|
|
25
|
-
@extend %valid-input-style;
|
|
26
|
-
}
|
|
27
|
-
& ~ .helper-text:after {
|
|
28
|
-
//@extend %custom-success-message;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&.invalid {
|
|
33
|
-
& > input.select-dropdown,
|
|
34
|
-
& > input.select-dropdown:focus {
|
|
35
|
-
@extend %invalid-input-style;
|
|
36
|
-
}
|
|
37
|
-
& ~ .helper-text:after {
|
|
38
|
-
//@extend %custom-error-message;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&.valid + label,
|
|
43
|
-
&.invalid + label {
|
|
44
|
-
width: 100%;
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
}
|
|
47
|
-
& + label:after {
|
|
48
|
-
//@extend %input-after-style;
|
|
49
|
-
}
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
position: relative;
|
|
53
|
-
|
|
54
|
-
/*
|
|
55
|
-
input.select-dropdown {
|
|
56
|
-
&:focus {
|
|
57
|
-
border-bottom: 1px solid var(--md-sys-color-primary);
|
|
58
|
-
}
|
|
59
|
-
position: relative;
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
background-color: transparent;
|
|
62
|
-
border: none;
|
|
63
|
-
border-bottom: 2px solid var(--md-sys-color-on-surface-variant);
|
|
64
|
-
outline: none;
|
|
65
|
-
height: 3rem;
|
|
66
|
-
line-height: 3rem;
|
|
67
|
-
width: 100%;
|
|
68
|
-
font-size: 16px;
|
|
69
|
-
margin: 0 0 8px 0;
|
|
70
|
-
padding: 0;
|
|
71
|
-
display: block;
|
|
72
|
-
user-select:none;
|
|
73
|
-
z-index: 1;
|
|
74
|
-
color: var(--md-sys-color-on-background);
|
|
75
|
-
}
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
.caret {
|
|
79
|
-
position: absolute;
|
|
80
|
-
right: 0;
|
|
81
|
-
top: 0;
|
|
82
|
-
bottom: 0;
|
|
83
|
-
margin: auto 0;
|
|
84
|
-
z-index: 0;
|
|
85
|
-
fill: var(--md-sys-color-on-background);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Hide select with overflow hidden instead of using display none
|
|
89
|
-
// (this prevents form validation errors with hidden form elements)
|
|
90
|
-
.hide-select {
|
|
91
|
-
width: 0;
|
|
92
|
-
height: 0;
|
|
93
|
-
overflow: hidden;
|
|
94
|
-
position: absolute;
|
|
95
|
-
top: 0;
|
|
96
|
-
z-index: -1;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
select:disabled {
|
|
101
|
-
color: var(--md-sys-color-on-surface);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.select-wrapper.disabled {
|
|
105
|
-
+ label {
|
|
106
|
-
color: var(--md-sys-color-on-surface);
|
|
107
|
-
}
|
|
108
|
-
.caret {
|
|
109
|
-
fill: var(--md-sys-color-on-surface);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.select-wrapper input.select-dropdown:disabled {
|
|
114
|
-
color: var(--md-sys-color-on-surface);
|
|
115
|
-
cursor: default;
|
|
116
|
-
user-select: none;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.select-wrapper i {
|
|
120
|
-
color: var(--md-sys-color-on-surface);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.select-dropdown li.disabled,
|
|
124
|
-
.select-dropdown li.disabled > span,
|
|
125
|
-
.select-dropdown li.optgroup {
|
|
126
|
-
color: var(--md-sys-color-on-surface);
|
|
127
|
-
//background-color: transparent;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/*
|
|
131
|
-
body.keyboard-focused {
|
|
132
|
-
.select-dropdown.dropdown-content li:focus {
|
|
133
|
-
//background-color: $select-option-focus;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.select-dropdown.dropdown-content {
|
|
138
|
-
li {
|
|
139
|
-
&:hover:not(.disabled) {
|
|
140
|
-
//background-color: $select-option-hover;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&.selected:not(.disabled) {
|
|
144
|
-
//background-color: $select-option-selected;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
*/
|
|
149
|
-
|
|
150
|
-
/*
|
|
151
|
-
// Prefix Icons
|
|
152
|
-
.prefix ~ .select-wrapper {
|
|
153
|
-
margin-left: 3rem;
|
|
154
|
-
width: 92%;
|
|
155
|
-
width: calc(100% - 3rem);
|
|
156
|
-
}
|
|
157
|
-
.prefix ~ label { margin-left: 3rem; }
|
|
158
|
-
// Suffix Icons
|
|
159
|
-
.suffix ~ .select-wrapper {
|
|
160
|
-
margin-right: 3rem;
|
|
161
|
-
width: 92%;
|
|
162
|
-
width: calc(100% - 3rem);
|
|
163
|
-
}
|
|
164
|
-
.suffix ~ label { margin-right: 3rem; }
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
// Icons
|
|
168
|
-
.select-dropdown li {
|
|
169
|
-
img {
|
|
170
|
-
height: $dropdown-item-height - 10;
|
|
171
|
-
width: $dropdown-item-height - 10;
|
|
172
|
-
margin: 5px 15px;
|
|
173
|
-
float: right;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Optgroup styles
|
|
178
|
-
.select-dropdown li.optgroup {
|
|
179
|
-
border-top: 1px solid rgba(0, 0, 0, 0.04);
|
|
180
|
-
&.selected > span {
|
|
181
|
-
color: var(--md-sys-color-on-background);
|
|
182
|
-
}
|
|
183
|
-
& > span {
|
|
184
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
185
|
-
}
|
|
186
|
-
& ~ li.optgroup-option {
|
|
187
|
-
padding-left: 1rem;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/*
|
|
192
|
-
.select-dropdown .selected {
|
|
193
|
-
color: red;
|
|
194
|
-
}
|
|
195
|
-
*/
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
.switch {
|
|
2
|
-
--track-height: 32px;
|
|
3
|
-
--track-width: 52px;
|
|
4
|
-
--border-width: 2px;
|
|
5
|
-
--size-off: 16px;
|
|
6
|
-
--size-on: 24px;
|
|
7
|
-
--icon-size: 16px;
|
|
8
|
-
--gap-on: calc(((var(--track-height) - var(--size-on)) / 2) - var(--border-width));
|
|
9
|
-
--gap-off: calc(((var(--track-height) - var(--size-off)) / 2) - var(--border-width));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.switch,
|
|
13
|
-
.switch * {
|
|
14
|
-
-webkit-tap-highlight-color: transparent;
|
|
15
|
-
user-select: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.switch label {
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.switch label input[type=checkbox] {
|
|
23
|
-
opacity: 0;
|
|
24
|
-
width: 0;
|
|
25
|
-
height: 0;
|
|
26
|
-
|
|
27
|
-
// CHECKED
|
|
28
|
-
// Track
|
|
29
|
-
&:checked + .lever{
|
|
30
|
-
background-color: var(--md-sys-color-primary);
|
|
31
|
-
border-color: var(--md-sys-color-primary);
|
|
32
|
-
}
|
|
33
|
-
// Dot
|
|
34
|
-
&:checked + .lever {
|
|
35
|
-
&:before, &:after {
|
|
36
|
-
top: var(--gap-on);
|
|
37
|
-
left: calc(var(--track-width) - var(--size-on) - var(--gap-on) - 2 * var(--border-width));
|
|
38
|
-
width: var(--size-on);
|
|
39
|
-
height: var(--size-on);
|
|
40
|
-
}
|
|
41
|
-
&:after {
|
|
42
|
-
@extend .surface;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.switch label .lever {
|
|
48
|
-
content: "";
|
|
49
|
-
display: inline-block;
|
|
50
|
-
position: relative;
|
|
51
|
-
width: var(--track-width);
|
|
52
|
-
height: var(--track-height);
|
|
53
|
-
border-style: solid;
|
|
54
|
-
border-width: 2px;
|
|
55
|
-
border-color: var(--md-sys-color-outline);
|
|
56
|
-
|
|
57
|
-
//@extend .surface-variant;
|
|
58
|
-
background-color: var(--md-sys-color-surface-variant);
|
|
59
|
-
|
|
60
|
-
border-radius: 15px;
|
|
61
|
-
margin-right: 10px;
|
|
62
|
-
transition: background 0.3s ease;
|
|
63
|
-
vertical-align: middle;
|
|
64
|
-
margin: 0 16px;
|
|
65
|
-
|
|
66
|
-
// DOT
|
|
67
|
-
&:before, &:after {
|
|
68
|
-
content: "";
|
|
69
|
-
position: absolute;
|
|
70
|
-
display: inline-block;
|
|
71
|
-
width: var(--size-off);
|
|
72
|
-
height: var(--size-off);
|
|
73
|
-
border-radius: 50%;
|
|
74
|
-
|
|
75
|
-
left: var(--gap-off);
|
|
76
|
-
top: var(--gap-off);
|
|
77
|
-
|
|
78
|
-
transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease, transform .1s ease;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// NOT CHECKED [DOT]
|
|
82
|
-
&:after {
|
|
83
|
-
@extend .outline;
|
|
84
|
-
height: var(--size-off);
|
|
85
|
-
width: var(--size-off);
|
|
86
|
-
|
|
87
|
-
//@extend .surface-variant;
|
|
88
|
-
//box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
input[type=checkbox]:not(:disabled) ~ .lever:active:before,
|
|
93
|
-
input[type=checkbox]:not(:disabled).tabbed:focus ~ .lever::before,
|
|
94
|
-
input[type=checkbox]:not(:disabled) ~ .lever:hover::before {
|
|
95
|
-
transform: scale(2.4);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
input[type=checkbox]:checked:not(:disabled) ~ .lever:hover::before {
|
|
99
|
-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.06);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Switch active style
|
|
103
|
-
input[type=checkbox]:checked:not(:disabled) ~ .lever:active::before,
|
|
104
|
-
input[type=checkbox]:checked:not(:disabled).tabbed:focus ~ .lever::before {
|
|
105
|
-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
input[type=checkbox]:not(:disabled) ~ .lever:hover::before {
|
|
109
|
-
background-color: rgba(0, 0, 0, 0.04);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
input[type=checkbox]:not(:disabled) ~ .lever:active:before,
|
|
113
|
-
input[type=checkbox]:not(:disabled).tabbed:focus ~ .lever::before {
|
|
114
|
-
background-color: rgba(0, 0, 0, 0.12);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Disabled Styles
|
|
118
|
-
.switch input[type=checkbox][disabled] + .lever {
|
|
119
|
-
cursor: default;
|
|
120
|
-
opacity: 0.5;
|
|
121
|
-
}
|
|
122
|
-
|