@expressivecss/expressive 0.1.0-alpha.3
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 -0
- package/README.md +82 -0
- package/dist/css/expressive.css +9914 -0
- package/dist/css/expressive.min.css +1 -0
- package/dist/js/components/autocomplete.d.ts +152 -0
- package/dist/js/components/buttons.d.ts +66 -0
- package/dist/js/components/cards.d.ts +50 -0
- package/dist/js/components/carousel.d.ts +131 -0
- package/dist/js/components/chips.d.ts +135 -0
- package/dist/js/components/collapsible.d.ts +74 -0
- package/dist/js/components/datepicker.d.ts +336 -0
- package/dist/js/components/dropdown.d.ts +148 -0
- package/dist/js/components/index.d.ts +21 -0
- package/dist/js/components/materialbox.d.ts +97 -0
- package/dist/js/components/modal.d.ts +45 -0
- package/dist/js/components/parallax.d.ts +40 -0
- package/dist/js/components/pushpin.d.ts +51 -0
- package/dist/js/components/scrollspy.d.ts +80 -0
- package/dist/js/components/sidenav.d.ts +125 -0
- package/dist/js/components/slider.d.ts +101 -0
- package/dist/js/components/tabs.d.ts +80 -0
- package/dist/js/components/tap-target.d.ts +58 -0
- package/dist/js/components/timepicker.d.ts +207 -0
- package/dist/js/components/toast.d.ts +93 -0
- package/dist/js/components/tooltip.d.ts +117 -0
- package/dist/js/components/waves.d.ts +15 -0
- package/dist/js/expressive.js +8239 -0
- package/dist/js/expressive.js.map +1 -0
- package/dist/js/expressive.min.js +2 -0
- package/dist/js/expressive.min.js.map +1 -0
- package/dist/js/expressive.mjs +8206 -0
- package/dist/js/expressive.mjs.map +1 -0
- package/dist/js/forms/character-counter.d.ts +36 -0
- package/dist/js/forms/forms.d.ts +17 -0
- package/dist/js/forms/index.d.ts +4 -0
- package/dist/js/forms/range.d.ts +40 -0
- package/dist/js/forms/select.d.ts +77 -0
- package/dist/js/foundation/component.d.ts +73 -0
- package/dist/js/foundation/index.d.ts +2 -0
- package/dist/js/foundation/utils.d.ts +122 -0
- package/dist/js/index.d.ts +52 -0
- package/dist/js/plugins/docked-display.d.ts +34 -0
- package/dist/js/plugins/index.d.ts +1 -0
- package/package.json +71 -0
- package/src/scss/components/_appbar.scss +454 -0
- package/src/scss/components/_badges.scss +77 -0
- package/src/scss/components/_breadcrumb.scss +27 -0
- package/src/scss/components/_buttons.scss +412 -0
- package/src/scss/components/_cards.scss +267 -0
- package/src/scss/components/_carousel.scss +93 -0
- package/src/scss/components/_chips.scss +147 -0
- package/src/scss/components/_collapsible.scss +84 -0
- package/src/scss/components/_collection.scss +114 -0
- package/src/scss/components/_date-picker.scss +268 -0
- package/src/scss/components/_dropdown.scss +98 -0
- package/src/scss/components/_index.scss +28 -0
- package/src/scss/components/_material-box.scss +42 -0
- package/src/scss/components/_material-icons.scss +6 -0
- package/src/scss/components/_modal.scss +84 -0
- package/src/scss/components/_pagination.scss +45 -0
- package/src/scss/components/_parallax.scss +26 -0
- package/src/scss/components/_preloader.scss +422 -0
- package/src/scss/components/_pulse.scss +35 -0
- package/src/scss/components/_sidenav.scss +229 -0
- package/src/scss/components/_slider.scss +119 -0
- package/src/scss/components/_table-of-contents.scss +32 -0
- package/src/scss/components/_tabs.scss +176 -0
- package/src/scss/components/_tap-target.scss +102 -0
- package/src/scss/components/_time-picker.scss +294 -0
- package/src/scss/components/_toast.scss +70 -0
- package/src/scss/components/_tooltip.scss +49 -0
- package/src/scss/components/_transitions.scss +19 -0
- package/src/scss/components/_video.scss +15 -0
- package/src/scss/expressive.scss +7 -0
- package/src/scss/forms/_checkboxes.scss +199 -0
- package/src/scss/forms/_file-input.scss +41 -0
- package/src/scss/forms/_index.scss +17 -0
- package/src/scss/forms/_input-fields.scss +360 -0
- package/src/scss/forms/_radio-buttons.scss +114 -0
- package/src/scss/forms/_range.scss +148 -0
- package/src/scss/forms/_select.scss +108 -0
- package/src/scss/forms/_switches.scss +127 -0
- package/src/scss/foundation/_base.scss +71 -0
- package/src/scss/foundation/_color-palette.scss +402 -0
- package/src/scss/foundation/_index.scss +10 -0
- package/src/scss/foundation/_mixins.scss +198 -0
- package/src/scss/foundation/_motion.scss +70 -0
- package/src/scss/foundation/_normalize.scss +349 -0
- package/src/scss/foundation/_shape.scss +30 -0
- package/src/scss/foundation/_state-layers.scss +68 -0
- package/src/scss/foundation/_theme.scss +238 -0
- package/src/scss/foundation/_tokens.scss +511 -0
- package/src/scss/foundation/_variables.scss +57 -0
- package/src/scss/layout/_footer.scss +26 -0
- package/src/scss/layout/_grid.scss +172 -0
- package/src/scss/layout/_index.scss +3 -0
- package/src/scss/layout/_table.scss +119 -0
- package/src/scss/utilities/_a11y.scss +77 -0
- package/src/scss/utilities/_colors.scss +74 -0
- package/src/scss/utilities/_elevation.scss +63 -0
- package/src/scss/utilities/_helpers.scss +50 -0
- package/src/scss/utilities/_index.scss +7 -0
- package/src/scss/utilities/_responsive.scss +62 -0
- package/src/scss/utilities/_spacing.scss +38 -0
- package/src/scss/utilities/_typography.scss +115 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
@use '../foundation/variables' as *;
|
|
2
|
+
|
|
3
|
+
/* Style Placeholders */
|
|
4
|
+
::placeholder {
|
|
5
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* Text inputs */
|
|
9
|
+
input:not([type]):not(.browser-default),
|
|
10
|
+
input[type=text]:not(.browser-default),
|
|
11
|
+
input[type=password]:not(.browser-default),
|
|
12
|
+
input[type=email]:not(.browser-default),
|
|
13
|
+
input[type=url]:not(.browser-default),
|
|
14
|
+
input[type=time]:not(.browser-default),
|
|
15
|
+
input[type=date]:not(.browser-default),
|
|
16
|
+
input[type=datetime]:not(.browser-default),
|
|
17
|
+
input[type=datetime-local]:not(.browser-default),
|
|
18
|
+
input[type=month]:not(.browser-default),
|
|
19
|
+
input[type=tel]:not(.browser-default),
|
|
20
|
+
input[type=number]:not(.browser-default),
|
|
21
|
+
input[type=search]:not(.browser-default),
|
|
22
|
+
textarea.materialize-textarea {
|
|
23
|
+
outline: none;
|
|
24
|
+
color: var(--md-sys-color-on-background);
|
|
25
|
+
width: 100%;
|
|
26
|
+
font-size: $md_sys_typescale_body-large_size; //16px; // => 16 dp
|
|
27
|
+
height: 56px; // 56dp
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
%invalid-input-style {
|
|
32
|
+
border-bottom: 2px solid var(--md-sys-color-error);
|
|
33
|
+
box-shadow: 0 1px 0 0 var(--md-sys-color-error);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
%hidden-text > span {
|
|
37
|
+
display: none
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
%custom-error-message {
|
|
41
|
+
content: attr(data-error);
|
|
42
|
+
color: var(--md-sys-color-error);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.input-field {
|
|
46
|
+
--input-color: var(--md-sys-color-primary);
|
|
47
|
+
|
|
48
|
+
position: relative;
|
|
49
|
+
clear: both;
|
|
50
|
+
|
|
51
|
+
// Default
|
|
52
|
+
|
|
53
|
+
input, textarea {
|
|
54
|
+
box-sizing: border-box; /* https://stackoverflow.com/questions/1377719/padding-within-inputs-breaks-width-100*/
|
|
55
|
+
padding: 0 16px;
|
|
56
|
+
padding-top: 20px;
|
|
57
|
+
//background-color: transparent; //background-color: var(--md-sys-color-surface);
|
|
58
|
+
border: none; // reset
|
|
59
|
+
border-radius: 4px; // md.sys.shape.corner.extra-small.top
|
|
60
|
+
border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
|
|
61
|
+
border-bottom-left-radius: 0;
|
|
62
|
+
border-bottom-right-radius: 0;
|
|
63
|
+
|
|
64
|
+
&:focus:not([readonly]) {
|
|
65
|
+
border-bottom: 2px solid var(--input-color);
|
|
66
|
+
padding-top: 20px + 1px; // add border-width
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:disabled, &[readonly="readonly"] {
|
|
70
|
+
color: rgba(var(--md_sys_color_on-surface), 0.38);
|
|
71
|
+
border-color: rgba(var(--md_sys_color_on-surface), 0.12);
|
|
72
|
+
background-color: rgba(var(--md_sys_color_on-surface), 0.04);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Label
|
|
76
|
+
&:focus:not([readonly]) + label {
|
|
77
|
+
color: var(--input-color);
|
|
78
|
+
}
|
|
79
|
+
&:focus:not([readonly]) + label,
|
|
80
|
+
&:not([placeholder=' ']) + label,
|
|
81
|
+
&:not(:placeholder-shown) + label {
|
|
82
|
+
//font-size: 12px; // md.sys.typescale.body-small.size
|
|
83
|
+
// https://stackoverflow.com/questions/34717492/css-transition-font-size-avoid-jittering-wiggling
|
|
84
|
+
transform: scale(calc(12 / 16));
|
|
85
|
+
top: 8px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:disabled + label, &[readonly="readonly"] + label {
|
|
89
|
+
color: rgba(var(--md_sys_color_on-surface), 0.38);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Hide helper text on data message
|
|
93
|
+
&.invalid ~ .supporting-text[data-error] {
|
|
94
|
+
@extend %hidden-text;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Invalid Input Style
|
|
98
|
+
&.invalid {
|
|
99
|
+
@extend %invalid-input-style;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Custom Error message
|
|
103
|
+
&.invalid ~ .supporting-text:after {
|
|
104
|
+
@extend %custom-error-message;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.invalid ~ label,
|
|
108
|
+
&:focus.invalid ~ label {
|
|
109
|
+
color: var(--md-sys-color-error);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
input::placeholder {
|
|
114
|
+
user-select: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
& > label {
|
|
118
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
119
|
+
user-select: none;
|
|
120
|
+
font-size: 16px;
|
|
121
|
+
position: absolute;
|
|
122
|
+
left: 16px;
|
|
123
|
+
top: 16px;
|
|
124
|
+
cursor: text;
|
|
125
|
+
transform-origin: top left;
|
|
126
|
+
transition:
|
|
127
|
+
left 0.2s ease-out,
|
|
128
|
+
top 0.2s ease-out,
|
|
129
|
+
transform 0.2s ease-out
|
|
130
|
+
;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Sub-Infos
|
|
134
|
+
|
|
135
|
+
.supporting-text {
|
|
136
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
padding: 0 16px;
|
|
139
|
+
margin-top: 4px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.character-counter {
|
|
143
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
144
|
+
font-size: 12px;
|
|
145
|
+
float: right;
|
|
146
|
+
padding: 0 16px;
|
|
147
|
+
margin-top: 4px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.prefix {
|
|
151
|
+
position: absolute;
|
|
152
|
+
left: 12px;
|
|
153
|
+
top: 16px;
|
|
154
|
+
user-select: none;
|
|
155
|
+
display: flex;
|
|
156
|
+
align-self: center;
|
|
157
|
+
|
|
158
|
+
~ input, ~ textarea {
|
|
159
|
+
padding-left: calc(12px + 24px + 16px);
|
|
160
|
+
}
|
|
161
|
+
~ label {
|
|
162
|
+
left: calc(12px + 24px + 16px);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.suffix {
|
|
167
|
+
position: absolute;
|
|
168
|
+
right: 12px;
|
|
169
|
+
top: 16px;
|
|
170
|
+
user-select: none;
|
|
171
|
+
|
|
172
|
+
~ input, ~ textarea {
|
|
173
|
+
padding-right: calc(12px + 24px + 16px);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Outlined
|
|
178
|
+
|
|
179
|
+
// todo: use this approach for floating labels with outline
|
|
180
|
+
// https://dev.to/icyjoseph/use-more-html-elements-floating-from-field-37o9
|
|
181
|
+
|
|
182
|
+
&.outlined {
|
|
183
|
+
|
|
184
|
+
input, textarea {
|
|
185
|
+
padding-top: 0;
|
|
186
|
+
background-color: transparent; //(--md-sys-color-background);
|
|
187
|
+
border: 1px solid var(--md-sys-color-on-surface-variant);
|
|
188
|
+
border-radius: 4px; // md.sys.shape.corner.extra-small
|
|
189
|
+
|
|
190
|
+
&:focus:not([readonly]) {
|
|
191
|
+
border: 2px solid var(--input-color);
|
|
192
|
+
padding-top: 0;
|
|
193
|
+
margin-left: -1px; // subtract border-width
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Label
|
|
198
|
+
&:focus:not([readonly]) + label {
|
|
199
|
+
color: var(--input-color);
|
|
200
|
+
}
|
|
201
|
+
&:focus:not([readonly]) + label,
|
|
202
|
+
&:not([placeholder=' ']) + label,
|
|
203
|
+
&:not(:placeholder-shown) + label {
|
|
204
|
+
top: -8px;
|
|
205
|
+
left: 16px;
|
|
206
|
+
margin-left: -4px;
|
|
207
|
+
padding: 0 4px;
|
|
208
|
+
background-color: transparent; //var(--md-sys-color-background);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&:disabled, &[readonly="readonly"] {
|
|
212
|
+
color: rgba(var(--md_sys_color_on-surface), 0.38);
|
|
213
|
+
border-color: rgba(var(--md_sys_color_on-surface), 0.12);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Error
|
|
219
|
+
&.error {
|
|
220
|
+
input, textarea {
|
|
221
|
+
border-color: var(--md-sys-color-error);
|
|
222
|
+
|
|
223
|
+
&:focus:not([readonly]) {
|
|
224
|
+
border-color: var(--md-sys-color-error);
|
|
225
|
+
|
|
226
|
+
+ label {
|
|
227
|
+
color: var(--md-sys-color-error);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
label {
|
|
232
|
+
color: var(--md-sys-color-error);
|
|
233
|
+
}
|
|
234
|
+
.supporting-text {
|
|
235
|
+
color: var(--md-sys-color-error);
|
|
236
|
+
}
|
|
237
|
+
.suffix {
|
|
238
|
+
color: var(--md-sys-color-error);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Inline */
|
|
244
|
+
.inline {
|
|
245
|
+
display: inline-block;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Search Field */
|
|
249
|
+
.searchbar {
|
|
250
|
+
.prefix {
|
|
251
|
+
position: absolute;
|
|
252
|
+
padding-left: 1rem;
|
|
253
|
+
top: 0;
|
|
254
|
+
user-select: none;
|
|
255
|
+
display: flex;
|
|
256
|
+
align-self: center;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
& > input {
|
|
260
|
+
border-width: 0;
|
|
261
|
+
background-color: transparent;
|
|
262
|
+
padding-left: 3rem;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&.has-sidebar {
|
|
266
|
+
margin-left: 0;
|
|
267
|
+
@media #{$large-and-up} {
|
|
268
|
+
margin-left: 300px;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/*
|
|
274
|
+
.input-field input[type=search] {
|
|
275
|
+
display: block;
|
|
276
|
+
line-height: inherit;
|
|
277
|
+
|
|
278
|
+
.nav-wrapper & {
|
|
279
|
+
height: inherit;
|
|
280
|
+
padding-left: 4rem;
|
|
281
|
+
width: calc(100% - 4rem);
|
|
282
|
+
border: 0;
|
|
283
|
+
box-shadow: none;
|
|
284
|
+
}
|
|
285
|
+
&:focus:not(.browser-default) {
|
|
286
|
+
border: 0;
|
|
287
|
+
box-shadow: none;
|
|
288
|
+
}
|
|
289
|
+
& + .label-icon {
|
|
290
|
+
transform: none;
|
|
291
|
+
left: 1rem;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
*/
|
|
295
|
+
|
|
296
|
+
/* Textarea */
|
|
297
|
+
// Default textarea
|
|
298
|
+
textarea {
|
|
299
|
+
width: 100%;
|
|
300
|
+
height: 3rem;
|
|
301
|
+
background-color: transparent;
|
|
302
|
+
|
|
303
|
+
&.materialize-textarea {
|
|
304
|
+
padding-top: 26px !important;
|
|
305
|
+
padding-bottom: 4px !important;
|
|
306
|
+
line-height: normal;
|
|
307
|
+
overflow-y: hidden; /* prevents scroll bar flash */
|
|
308
|
+
resize: none;
|
|
309
|
+
min-height: 3rem;
|
|
310
|
+
box-sizing: border-box;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// For textarea autoresize
|
|
315
|
+
.hiddendiv {
|
|
316
|
+
visibility: hidden;
|
|
317
|
+
white-space: pre-wrap;
|
|
318
|
+
word-wrap: break-word;
|
|
319
|
+
overflow-wrap: break-word; /* future version of deprecated 'word-wrap' */
|
|
320
|
+
padding-top: 1.2rem; /* prevents text jump on Enter keypress */
|
|
321
|
+
// Reduces repaints
|
|
322
|
+
position: absolute;
|
|
323
|
+
top: 0;
|
|
324
|
+
z-index: -1;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* Autocomplete Items */
|
|
328
|
+
.autocomplete-content {
|
|
329
|
+
li {
|
|
330
|
+
.highlight { color: var(--md-sys-color-on-background); }
|
|
331
|
+
img {
|
|
332
|
+
height: $dropdown-item-height - 10;
|
|
333
|
+
width: $dropdown-item-height - 10;
|
|
334
|
+
margin: 5px 15px;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* Datepicker date input fields */
|
|
340
|
+
.datepicker-date-input {
|
|
341
|
+
position: relative;
|
|
342
|
+
text-indent: -9999px;
|
|
343
|
+
|
|
344
|
+
&::after {
|
|
345
|
+
display: block;
|
|
346
|
+
position: absolute;
|
|
347
|
+
top: 1.10rem;
|
|
348
|
+
content: attr(data-date);
|
|
349
|
+
color: var(--input-color);
|
|
350
|
+
text-indent: 0;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
&:focus-visible {
|
|
354
|
+
text-indent: 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
&:focus-visible:after {
|
|
358
|
+
text-indent: -9999px;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Remove default Radio Buttons
|
|
2
|
+
[type="radio"] {
|
|
3
|
+
&:not(:checked),
|
|
4
|
+
&:checked {
|
|
5
|
+
position: absolute;
|
|
6
|
+
opacity: 0;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&:not(:checked) + span,
|
|
11
|
+
&:checked + span {
|
|
12
|
+
position: relative;
|
|
13
|
+
padding-left: 35px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
height: 25px;
|
|
17
|
+
line-height: 25px;
|
|
18
|
+
font-size: 1rem;
|
|
19
|
+
transition: .28s ease;
|
|
20
|
+
user-select: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
+ span:before,
|
|
24
|
+
+ span:after {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
left: 0;
|
|
28
|
+
top: 0;
|
|
29
|
+
margin: 4px;
|
|
30
|
+
width: 16px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
z-index: 0;
|
|
33
|
+
transition: .28s ease;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Unchecked styles */
|
|
37
|
+
&:not(:checked) + span:before,
|
|
38
|
+
&:not(:checked) + span:after,
|
|
39
|
+
&:checked + span:before,
|
|
40
|
+
&:checked + span:after,
|
|
41
|
+
&.with-gap:checked + span:before,
|
|
42
|
+
&.with-gap:checked + span:after {
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:not(:checked) + span:before,
|
|
47
|
+
&:not(:checked) + span:after {
|
|
48
|
+
border: 2px solid var(--md-sys-color-on-surface-variant);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:not(:checked) + span:after {
|
|
52
|
+
transform: scale(0);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Checked styles */
|
|
56
|
+
&:checked + span:before {
|
|
57
|
+
border: 2px solid transparent;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:checked + span:after,
|
|
61
|
+
&.with-gap:checked + span:before,
|
|
62
|
+
&.with-gap:checked + span:after {
|
|
63
|
+
border: 2px solid var(--md-sys-color-primary);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:checked + span:after,
|
|
67
|
+
&.with-gap:checked + span:after {
|
|
68
|
+
background-color: var(--md-sys-color-primary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:checked + span:after {
|
|
72
|
+
transform: scale(1.02);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Radio With gap */
|
|
76
|
+
&.with-gap:checked + span:after {
|
|
77
|
+
transform: scale(.5);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Focused styles */
|
|
81
|
+
&.tabbed:focus + span:before {
|
|
82
|
+
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Disabled Radio With gap */
|
|
86
|
+
&.with-gap:disabled:checked + span:before {
|
|
87
|
+
border: 2px solid var(--md-sys-color-on-surface);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.with-gap:disabled:checked + span:after {
|
|
91
|
+
border: none;
|
|
92
|
+
background-color: var(--md-sys-color-on-surface);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Disabled style */
|
|
96
|
+
&:disabled:not(:checked) + span:before,
|
|
97
|
+
&:disabled:checked + span:before {
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
border-color: var(--md-sys-color-on-surface);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:disabled + span {
|
|
103
|
+
color: var(--md-sys-color-on-surface);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&:disabled:not(:checked) + span:before {
|
|
107
|
+
border-color: var(--md-sys-color-on-surface);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:disabled:checked + span:after {
|
|
111
|
+
background-color: var(--md-sys-color-on-surface);
|
|
112
|
+
border-color: var(--md-sys-color-on-surface);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
@use '../utilities/colors' as *;
|
|
2
|
+
@use '../utilities/helpers' as *;
|
|
3
|
+
|
|
4
|
+
.range-field {
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
input[type=range] {
|
|
9
|
+
@extend .no-select;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
position: relative;
|
|
12
|
+
background: linear-gradient(var(--md-sys-color-outline-variant), var(--md-sys-color-outline-variant));
|
|
13
|
+
border: none;
|
|
14
|
+
outline: none;
|
|
15
|
+
width: 100%;
|
|
16
|
+
margin: 15px 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
height: 3px;
|
|
19
|
+
appearance: none;
|
|
20
|
+
-webkit-appearance: none;
|
|
21
|
+
|
|
22
|
+
&:focus {
|
|
23
|
+
outline: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+ .thumb {
|
|
27
|
+
@extend .no-select;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 10px;
|
|
31
|
+
left: 0;
|
|
32
|
+
border: none;
|
|
33
|
+
height: 0;
|
|
34
|
+
width: 0;
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
background-color: var(--md-sys-color-primary);
|
|
37
|
+
margin-left: 7px;
|
|
38
|
+
|
|
39
|
+
transform-origin: 50% 50%;
|
|
40
|
+
transform: rotate(-45deg);
|
|
41
|
+
|
|
42
|
+
.value {
|
|
43
|
+
display: block;
|
|
44
|
+
width: 30px;
|
|
45
|
+
text-align: center;
|
|
46
|
+
color: var(--md-sys-color-primary);
|
|
47
|
+
font-size: 0;
|
|
48
|
+
transform: rotate(45deg);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.active {
|
|
52
|
+
border-radius: 50% 50% 50% 0;
|
|
53
|
+
|
|
54
|
+
.value {
|
|
55
|
+
color: var(--md-sys-color-on-primary);
|
|
56
|
+
margin-left: -1px;
|
|
57
|
+
margin-top: 8px;
|
|
58
|
+
font-size: 10px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Shared
|
|
65
|
+
@mixin range-track {
|
|
66
|
+
height: 3px;
|
|
67
|
+
@extend .surface-variant;
|
|
68
|
+
border: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@mixin range-thumb {
|
|
72
|
+
border: none;
|
|
73
|
+
height: 14px;
|
|
74
|
+
width: 14px;
|
|
75
|
+
border-radius: 50%;
|
|
76
|
+
background: var(--md-sys-color-primary);
|
|
77
|
+
transition: box-shadow .3s;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// WebKit
|
|
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
|
+
.keyboard-focused input[type=range]:focus:not(.active)::-webkit-slider-thumb {
|
|
94
|
+
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// FireFox
|
|
98
|
+
input[type=range]::-moz-range-track {
|
|
99
|
+
@include range-track;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
input[type=range]::-moz-focus-inner {
|
|
103
|
+
border: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
input[type=range]::-moz-range-thumb {
|
|
107
|
+
@include range-thumb;
|
|
108
|
+
margin-top: -5px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// hide the outline behind the border
|
|
112
|
+
input[type=range]:-moz-focusring {
|
|
113
|
+
outline: 1px solid #fff;
|
|
114
|
+
outline-offset: -1px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.keyboard-focused input[type=range]:focus:not(.active)::-moz-range-thumb {
|
|
118
|
+
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//------------------------------- Remove this?
|
|
122
|
+
// IE 10+
|
|
123
|
+
input[type=range]::-ms-track {
|
|
124
|
+
height: 3px;
|
|
125
|
+
// remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead
|
|
126
|
+
background: transparent;
|
|
127
|
+
// leave room for the larger thumb to overflow with a transparent border */
|
|
128
|
+
border-color: transparent;
|
|
129
|
+
border-width: 6px 0;
|
|
130
|
+
/*remove default tick marks*/
|
|
131
|
+
color: transparent;
|
|
132
|
+
}
|
|
133
|
+
input[type=range]::-ms-fill-lower,
|
|
134
|
+
input[type=range]::-moz-range-progress {
|
|
135
|
+
background: var(--md-sys-color-primary);
|
|
136
|
+
}
|
|
137
|
+
input[type=range]::-ms-fill-upper,
|
|
138
|
+
input[type=range]::-moz-range-track {
|
|
139
|
+
background: var(--md-sys-color-shadow-light);
|
|
140
|
+
}
|
|
141
|
+
input[type=range]::-ms-thumb {
|
|
142
|
+
@include range-thumb;
|
|
143
|
+
}
|
|
144
|
+
//--------------------------------
|
|
145
|
+
|
|
146
|
+
.keyboard-focused input[type=range]:focus:not(.active)::-ms-thumb {
|
|
147
|
+
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
|
|
148
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@use '../foundation/variables' as *;
|
|
2
|
+
|
|
3
|
+
select {
|
|
4
|
+
background-color: var(--md-sys-color-surface);
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
8
|
+
border-radius: 2px;
|
|
9
|
+
height: 3rem;
|
|
10
|
+
|
|
11
|
+
// TODO: Change to ".select" and not use tag name directly
|
|
12
|
+
// Keep selects useable without javascript
|
|
13
|
+
|
|
14
|
+
&.browser-default {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
color: var(--md-sys-color-on-background);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:disabled {
|
|
20
|
+
color: var(--md-sys-color-on-surface);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.select-wrapper {
|
|
25
|
+
position: relative;
|
|
26
|
+
|
|
27
|
+
&:focus-within {
|
|
28
|
+
outline: 2px solid var(--md-sys-color-primary);
|
|
29
|
+
border-radius: 4px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.caret {
|
|
33
|
+
position: absolute;
|
|
34
|
+
right: 0;
|
|
35
|
+
top: 0;
|
|
36
|
+
bottom: 0;
|
|
37
|
+
margin: auto 0;
|
|
38
|
+
z-index: 0;
|
|
39
|
+
fill: var(--md-sys-color-on-background);
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Hide select with overflow hidden instead of using display none
|
|
44
|
+
// (this prevents form validation errors with hidden form elements)
|
|
45
|
+
.hide-select {
|
|
46
|
+
width: 0;
|
|
47
|
+
height: 0;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 0;
|
|
51
|
+
z-index: -1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.disabled {
|
|
55
|
+
+ label {
|
|
56
|
+
color: var(--md-sys-color-on-surface);
|
|
57
|
+
}
|
|
58
|
+
.caret {
|
|
59
|
+
fill: var(--md-sys-color-on-surface);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
input.select-dropdown:disabled {
|
|
64
|
+
color: var(--md-sys-color-on-surface);
|
|
65
|
+
cursor: default;
|
|
66
|
+
user-select: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
i {
|
|
70
|
+
color: var(--md-sys-color-on-surface);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.select-dropdown {
|
|
75
|
+
li {
|
|
76
|
+
&.disabled,
|
|
77
|
+
&.disabled > span,
|
|
78
|
+
&.optgroup {
|
|
79
|
+
color: var(--md-sys-color-on-surface);
|
|
80
|
+
//background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Icons
|
|
84
|
+
img {
|
|
85
|
+
height: $dropdown-item-height - 10;
|
|
86
|
+
width: $dropdown-item-height - 10;
|
|
87
|
+
margin: 5px 15px;
|
|
88
|
+
float: right;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Optgroup styles
|
|
92
|
+
&.optgroup {
|
|
93
|
+
border-top: 1px solid rgba(0, 0, 0, 0.04);
|
|
94
|
+
|
|
95
|
+
&.selected > span {
|
|
96
|
+
color: var(--md-sys-color-on-background);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
& > span {
|
|
100
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
& ~ li.optgroup-option {
|
|
104
|
+
padding-left: 1rem;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|