matcha-theme 1.0.1
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/abstracts/_breakpoints.scss +33 -0
- package/abstracts/_colors.scss +422 -0
- package/abstracts/_elevation.scss +102 -0
- package/abstracts/_functions.scss +321 -0
- package/abstracts/_grid.scss +130 -0
- package/abstracts/_order.scss +46 -0
- package/abstracts/_position.scss +51 -0
- package/abstracts/_sizes.scss +74 -0
- package/abstracts/_spacings.scss +236 -0
- package/abstracts/_typography.scss +137 -0
- package/base/_helpers.scss +3019 -0
- package/base/_reset.scss +9 -0
- package/base/_typography.scss +242 -0
- package/components/matcha-audio-player.scss +37 -0
- package/components/matcha-buttons.scss +91 -0
- package/components/matcha-cards.scss +93 -0
- package/components/matcha-color-pick.scss +32 -0
- package/components/matcha-draggable.scss +25 -0
- package/components/matcha-header.scss +326 -0
- package/components/matcha-horizontal-tree.scss +275 -0
- package/components/matcha-icons.scss +11 -0
- package/components/matcha-progress-bar.scss +107 -0
- package/components/matcha-scrollbar.scss +36 -0
- package/components/matcha-scrollbox-shadow.scss +127 -0
- package/components/matcha-table.scss +259 -0
- package/fonts/CircularStd-Bold.eot +0 -0
- package/fonts/CircularStd-Bold.otf +0 -0
- package/fonts/CircularStd-Bold.svg +13532 -0
- package/fonts/CircularStd-Bold.ttf +0 -0
- package/fonts/CircularStd-Bold.woff +0 -0
- package/fonts/CircularStd-Bold.woff2 +0 -0
- package/fonts/CircularStd-Medium.eot +0 -0
- package/fonts/CircularStd-Medium.otf +0 -0
- package/fonts/CircularStd-Medium.svg +13511 -0
- package/fonts/CircularStd-Medium.ttf +0 -0
- package/fonts/CircularStd-Medium.woff +0 -0
- package/fonts/CircularStd-Medium.woff2 +0 -0
- package/fonts/CircularStd-Regular.eot +0 -0
- package/fonts/CircularStd-Regular.otf +0 -0
- package/fonts/CircularStd-Regular.svg +5562 -0
- package/fonts/CircularStd-Regular.ttf +0 -0
- package/fonts/CircularStd-Regular.woff +0 -0
- package/main.scss +87 -0
- package/package.json +11 -0
- package/tokens/_animations.scss +37 -0
- package/tokens/_breakpoints.scss +46 -0
- package/tokens/_color-tokens.scss +1419 -0
- package/tokens/_elevation-tokens.scss +14 -0
- package/tokens/_spacing-tokens.scss +96 -0
- package/tokens/_typography-tokens.scss +25 -0
- package/vendors/angular-editor.scss +56 -0
- package/vendors/angular-material-fixes.scss +21 -0
- package/vendors/calendar.scss +2876 -0
- package/vendors/charts.scss +92 -0
- package/vendors/ng5-slider.scss +56 -0
- package/vendors/ngx-material-timepicker.scss +50 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// @ Breakpoints generator
|
|
3
|
+
//
|
|
4
|
+
// Examples:
|
|
5
|
+
// @include media-breakpoint("xs") {
|
|
6
|
+
// Show styles in small devices ( Phones and Gadget, 0px and up < 600px )
|
|
7
|
+
// }
|
|
8
|
+
// @include media-breakpoint("gt-xs") {
|
|
9
|
+
// Show styles in medium devices (landscapes and tablets, 600px and up < 1024px )
|
|
10
|
+
// }
|
|
11
|
+
// @include media-breakpoint("gt-sm") {
|
|
12
|
+
// Show styles in large devices (tablets and small monitors, 1024px and up < 1440px)
|
|
13
|
+
// }
|
|
14
|
+
// @include media-breakpoint("gt-md") {
|
|
15
|
+
// Show styles in X-Large devices (big desktops, 1440px and up < 1920)
|
|
16
|
+
// }
|
|
17
|
+
// @include media-breakpoint("gt-lg") {
|
|
18
|
+
// Show styles in XX-Large devices (larger desktops, 1920px and up)
|
|
19
|
+
// }
|
|
20
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
21
|
+
@mixin media-breakpoint($breakpointName) {
|
|
22
|
+
$mediaQuery: map-get($breakpoints, $breakpointName);
|
|
23
|
+
|
|
24
|
+
@if ($mediaQuery ==null) {
|
|
25
|
+
@content;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@else {
|
|
29
|
+
@media #{$mediaQuery} {
|
|
30
|
+
@content;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// @ Text color levels generator
|
|
3
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
@mixin _generate-text-color-levels($classes, $contrast) {
|
|
5
|
+
@if ($contrast == "dark") {
|
|
6
|
+
#{$classes} {
|
|
7
|
+
&.secondary-text,
|
|
8
|
+
.secondary-text {
|
|
9
|
+
color: rgba(0, 0, 0, 0.54) !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.hint-text,
|
|
13
|
+
.hint-text,
|
|
14
|
+
&.disabled-text,
|
|
15
|
+
.disabled-text {
|
|
16
|
+
color: rgba(0, 0, 0, 0.38) !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.divider,
|
|
20
|
+
.divider {
|
|
21
|
+
color: rgba(0, 0, 0, 0.12) !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} @else {
|
|
25
|
+
#{$classes} {
|
|
26
|
+
&.secondary-text,
|
|
27
|
+
.secondary-text {
|
|
28
|
+
color: rgba(255, 255, 255, 0.7) !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.hint-text,
|
|
32
|
+
.hint-text,
|
|
33
|
+
&.disabled-text,
|
|
34
|
+
.disabled-text {
|
|
35
|
+
color: rgba(255, 255, 255, 0.5) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.divider,
|
|
39
|
+
.divider {
|
|
40
|
+
color: rgba(255, 255, 255, 0.12) !important;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
47
|
+
// @ Static color classes generator
|
|
48
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
49
|
+
@mixin _generate-static-color-classes($colorName, $color, $contrastColor, $hue) {
|
|
50
|
+
$colorSelector: unquote(".#{$colorName}#{$hue}");
|
|
51
|
+
|
|
52
|
+
#{$colorSelector}-bg {
|
|
53
|
+
background-color: $color !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#{$colorSelector} {
|
|
57
|
+
background-color: $color !important;
|
|
58
|
+
color: $contrastColor !important;
|
|
59
|
+
|
|
60
|
+
&[disabled] {
|
|
61
|
+
background-color: rgba($color, 0.12) !important;
|
|
62
|
+
color: rgba($contrastColor, 0.26) !important;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#{$colorSelector}-fg {
|
|
67
|
+
color: $color !important;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#{$colorSelector}-border,
|
|
71
|
+
#{$colorSelector}-border-top,
|
|
72
|
+
#{$colorSelector}-border-right,
|
|
73
|
+
#{$colorSelector}-border-bottom,
|
|
74
|
+
#{$colorSelector}-border-left {
|
|
75
|
+
border-color: $color !important;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#{$colorSelector}-fill {
|
|
79
|
+
fill: $color !important;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@mixin colors-classes-static($palettes) {
|
|
84
|
+
$light-contrasting-classes: ();
|
|
85
|
+
$dark-contrasting-classes: ();
|
|
86
|
+
|
|
87
|
+
@each $paletteName, $palette in $palettes {
|
|
88
|
+
$contrasts: map-get($palette, "contrast");
|
|
89
|
+
|
|
90
|
+
@each $hue in $matchaHues {
|
|
91
|
+
$color: map-get($palette, $hue);
|
|
92
|
+
$contrast: map-get($contrasts, $hue);
|
|
93
|
+
|
|
94
|
+
@if ($color != null and $contrast != null) {
|
|
95
|
+
@include _generate-static-color-classes($paletteName, $color, $contrast, "-#{$hue}");
|
|
96
|
+
|
|
97
|
+
// If the contrast color is dark
|
|
98
|
+
@if (rgba(black, 1) ==rgba($contrast, 1)) {
|
|
99
|
+
$dark-contrasting-classes: append(
|
|
100
|
+
$dark-contrasting-classes,
|
|
101
|
+
unquote(".#{$paletteName}-#{$hue}"),
|
|
102
|
+
"comma"
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// if the contrast color is light
|
|
107
|
+
@else {
|
|
108
|
+
$light-contrasting-classes: append(
|
|
109
|
+
$light-contrasting-classes,
|
|
110
|
+
unquote(".#{$paletteName}-#{$hue}"),
|
|
111
|
+
"comma"
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Run the generator one more time for default values (500)
|
|
116
|
+
// if we are not working with primary, accent or warn palettes
|
|
117
|
+
@if ($hue ==500 and $paletteName != "primary" and $paletteName != "accent" and $paletteName != "warn") {
|
|
118
|
+
// Generate color classes
|
|
119
|
+
@include _generate-static-color-classes($paletteName, $color, $contrast, "");
|
|
120
|
+
|
|
121
|
+
// Add color to the correct list depending on the contrasting color
|
|
122
|
+
|
|
123
|
+
// If the contrast color is dark
|
|
124
|
+
@if (rgba(black, 1) ==rgba($contrast, 1)) {
|
|
125
|
+
$dark-contrasting-classes: append(
|
|
126
|
+
$dark-contrasting-classes,
|
|
127
|
+
unquote(".#{$paletteName}"),
|
|
128
|
+
"comma"
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// if the contrast color is light
|
|
133
|
+
@else {
|
|
134
|
+
$light-contrasting-classes: append(
|
|
135
|
+
$light-contrasting-classes,
|
|
136
|
+
unquote(".#{$paletteName}"),
|
|
137
|
+
"comma"
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Run the generator again for the selected default hue values for
|
|
145
|
+
// primary, accent and warn palettes
|
|
146
|
+
//
|
|
147
|
+
// We are doing this because the default hue value can be changed
|
|
148
|
+
// by the user when the Material theme being generated.
|
|
149
|
+
@if ($paletteName == "primary" or $paletteName == "accent" or $paletteName == "warn") {
|
|
150
|
+
// Get the color and the contrasting color for the selected
|
|
151
|
+
// default hue
|
|
152
|
+
$color: map-get($palette, "default");
|
|
153
|
+
$contrast: map-get($palette, "default-contrast");
|
|
154
|
+
|
|
155
|
+
// Generate color classes
|
|
156
|
+
@include _generate-static-color-classes($paletteName, $color, $contrast, "");
|
|
157
|
+
|
|
158
|
+
// Add color to the correct list depending on the contrasting color
|
|
159
|
+
|
|
160
|
+
// If the contrast color is dark
|
|
161
|
+
@if (rgba(black, 1) ==rgba($contrast, 1)) {
|
|
162
|
+
$dark-contrasting-classes: append($dark-contrasting-classes, unquote(".#{$paletteName}"), "comma");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// if the contrast color is light
|
|
166
|
+
@else {
|
|
167
|
+
$light-contrasting-classes: append($light-contrasting-classes, unquote(".#{$paletteName}"), "comma");
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Generate contrasting colors
|
|
173
|
+
@include _generate-text-color-levels($dark-contrasting-classes, "dark");
|
|
174
|
+
@include _generate-text-color-levels($light-contrasting-classes, "light");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
178
|
+
// @ Dynamic color classes generator
|
|
179
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
180
|
+
@mixin _generate-dynamic-color-classes($attribute, $colorLevel, $colorName, $background, $foreground) {
|
|
181
|
+
$color: unquote("-#{$colorName}");
|
|
182
|
+
$selectors: (".#{$attribute}#{$color}", ".matcha-#{$attribute}#{$color}", ".matcha-#{$attribute}-graphic#{$color}");
|
|
183
|
+
|
|
184
|
+
@each $selector in $selectors {
|
|
185
|
+
#{$selector} {
|
|
186
|
+
#{$attribute}: map-get($colorLevel, $colorName) !important;
|
|
187
|
+
|
|
188
|
+
&-alpha {
|
|
189
|
+
#{$attribute}: map-get($colorLevel, ("#{$colorName}-alpha")) !important;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@if ($colorName != yellow or $colorName != amber) {
|
|
195
|
+
$baseClassName: (".base-#{$colorName}");
|
|
196
|
+
#{$baseClassName} {
|
|
197
|
+
background: map-get($background, $colorName);
|
|
198
|
+
color: map-get($foreground, text-inverse);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
@if ($colorName == yellow or $colorName == amber) {
|
|
202
|
+
$baseClassName: (".base-#{$colorName}");
|
|
203
|
+
#{$baseClassName} {
|
|
204
|
+
background: map-get($background, $colorName);
|
|
205
|
+
color: map-get($foreground, static-dark-text);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@mixin _generate-classes($prefix, $color-map, $saturation) {
|
|
211
|
+
$background: map-get($color-map, $saturation);
|
|
212
|
+
$contrast: map-get($color-map, #{$saturation}-contrast);
|
|
213
|
+
|
|
214
|
+
.#{$prefix}-#{$saturation} {
|
|
215
|
+
background: $background;
|
|
216
|
+
color: $contrast;
|
|
217
|
+
}
|
|
218
|
+
.#{$prefix}-#{$saturation}-bg {
|
|
219
|
+
background: $background;
|
|
220
|
+
}
|
|
221
|
+
.#{$prefix}-#{$saturation}-fg {
|
|
222
|
+
color: $background;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@mixin colors-classes-dynamic($theme) {
|
|
227
|
+
$is-dark: map-get($theme, isdark);
|
|
228
|
+
$primary: map-get($theme, primary);
|
|
229
|
+
$accent: map-get($theme, accent);
|
|
230
|
+
$warn: map-get($theme, warn);
|
|
231
|
+
$background: map-get($theme, background);
|
|
232
|
+
$foreground: map-get($theme, foreground);
|
|
233
|
+
|
|
234
|
+
$colorNames: red, pink, purple, deep-purple, indigo, blue, light-blue, cyan, teal, green, light-green, lime, yellow,
|
|
235
|
+
amber, orange, deep-orange, primary, accent, warn;
|
|
236
|
+
$attributes: (
|
|
237
|
+
color: $foreground,
|
|
238
|
+
border-color: $foreground,
|
|
239
|
+
background: $background,
|
|
240
|
+
fill: $background,
|
|
241
|
+
stroke: $background
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
.primary,
|
|
245
|
+
.base-primary {
|
|
246
|
+
background: map-get($primary, default);
|
|
247
|
+
color: map-get($primary, default-contrast);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.accent,
|
|
251
|
+
.base-accent {
|
|
252
|
+
background: map-get($accent, default);
|
|
253
|
+
color: map-get($accent, default-contrast);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.warn,
|
|
257
|
+
.base-warn {
|
|
258
|
+
background: map-get($warn, default);
|
|
259
|
+
color: map-get($warn, default-contrast);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@each $saturation in $matchaHues {
|
|
263
|
+
@include _generate-classes("primary", $primary, $saturation);
|
|
264
|
+
@include _generate-classes("accent", $accent, $saturation);
|
|
265
|
+
@include _generate-classes("warn", $warn, $saturation);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.background-transparent,
|
|
269
|
+
.matcha-background-transparent {
|
|
270
|
+
background: transparent;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@each $attribute, $colorLevel in $attributes {
|
|
274
|
+
@if ($attribute != "color") {
|
|
275
|
+
// border-color-bg
|
|
276
|
+
// background-bg
|
|
277
|
+
// fill-bg
|
|
278
|
+
// stroke-bg
|
|
279
|
+
.#{$attribute}-bg {
|
|
280
|
+
#{$attribute}: map-get($background, background) !important;
|
|
281
|
+
}
|
|
282
|
+
.#{$attribute}-bg-alpha {
|
|
283
|
+
#{$attribute}: map-get($background, background-alpha) !important;
|
|
284
|
+
}
|
|
285
|
+
.#{$attribute}-bg-inverse {
|
|
286
|
+
#{$attribute}: map-get($background, background-inverse) !important;
|
|
287
|
+
}
|
|
288
|
+
.#{$attribute}-bg-alpha-inverse {
|
|
289
|
+
#{$attribute}: map-get($background, background-alpha-inverse) !important;
|
|
290
|
+
}
|
|
291
|
+
.#{$attribute}-surface-inverse {
|
|
292
|
+
#{$attribute}: map-get($background, card-inverse) !important;
|
|
293
|
+
}
|
|
294
|
+
.#{$attribute}-surface-alpha-inverse {
|
|
295
|
+
#{$attribute}: map-get($background, card-alpha-inverse) !important;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.primary-bg {
|
|
300
|
+
background: map-get($primary, default) !important;
|
|
301
|
+
}
|
|
302
|
+
.primary-fg {
|
|
303
|
+
color: map-get($primary, default) !important;
|
|
304
|
+
}
|
|
305
|
+
.background-primary-alpha {
|
|
306
|
+
background: rgba(map-get($primary, default), 0.2);
|
|
307
|
+
}
|
|
308
|
+
.accent-bg {
|
|
309
|
+
background: map-get($accent, default) !important;
|
|
310
|
+
}
|
|
311
|
+
.accent-fg {
|
|
312
|
+
color: map-get($accent, default) !important;
|
|
313
|
+
}
|
|
314
|
+
.background-accent-alpha {
|
|
315
|
+
background: rgba(map-get($accent, default), 0.2);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.warn-bg {
|
|
319
|
+
background: map-get($warn, default) !important;
|
|
320
|
+
}
|
|
321
|
+
.warn-fg {
|
|
322
|
+
color: map-get($warn, default) !important;
|
|
323
|
+
}
|
|
324
|
+
.background-warn-alpha {
|
|
325
|
+
background: rgba(map-get($warn, default), 0.2);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.#{$attribute}-primary,
|
|
329
|
+
.matcha-#{$attribute}-primary {
|
|
330
|
+
#{$attribute}: map-get($primary, default) !important;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.#{$attribute}-accent,
|
|
334
|
+
.matcha-#{$attribute}-accent {
|
|
335
|
+
#{$attribute}: map-get($accent, default) !important;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.#{$attribute}-warn,
|
|
339
|
+
.matcha-#{$attribute}-warn {
|
|
340
|
+
#{$attribute}: map-get($warn, default) !important;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.#{$attribute}-error,
|
|
344
|
+
.matcha-#{$attribute}-error {
|
|
345
|
+
#{$attribute}: map-get($background, error) !important;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.#{$attribute}-info,
|
|
349
|
+
.matcha-#{$attribute}-info {
|
|
350
|
+
#{$attribute}: map-get($background, info) !important;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.#{$attribute}-success,
|
|
354
|
+
.matcha-#{$attribute}-success {
|
|
355
|
+
#{$attribute}: map-get($background, success) !important;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.#{$attribute}-warning,
|
|
359
|
+
.matcha-#{$attribute}-warning {
|
|
360
|
+
#{$attribute}: map-get($background, warning) !important;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.#{$attribute}-foreground,
|
|
364
|
+
.#{$attribute}-fg,
|
|
365
|
+
.#{$attribute}-base,
|
|
366
|
+
.#{$attribute}-text,
|
|
367
|
+
.matcha-#{$attribute}-foreground,
|
|
368
|
+
.matcha-#{$attribute}-fg,
|
|
369
|
+
.matcha-#{$attribute}-base,
|
|
370
|
+
.matcha-#{$attribute}-text {
|
|
371
|
+
#{$attribute}: map-get($foreground, text) !important;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.#{$attribute}-fg-inverse,
|
|
375
|
+
.#{$attribute}-base-inverse,
|
|
376
|
+
.matcha-#{$attribute}-text-inverse {
|
|
377
|
+
#{$attribute}: map-get($foreground, text-inverse) !important;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.#{$attribute}-surface,
|
|
381
|
+
.matcha-#{$attribute}-dialog,
|
|
382
|
+
.matcha-#{$attribute}-card {
|
|
383
|
+
#{$attribute}: map-get($background, card) !important;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.#{$attribute}-surface-alpha,
|
|
387
|
+
.matcha-#{$attribute}-surface-alpha,
|
|
388
|
+
.matcha-#{$attribute}-card-alpha {
|
|
389
|
+
#{$attribute}: map-get($background, card-alpha) !important;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.#{$attribute}-hover,
|
|
393
|
+
.matcha-#{$attribute}-hover,
|
|
394
|
+
.matcha-#{$attribute}-placeholder {
|
|
395
|
+
#{$attribute}: map-get($foreground, placeholder) !important;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.#{$attribute}-label,
|
|
399
|
+
.matcha-#{$attribute}-label {
|
|
400
|
+
#{$attribute}: map-get($foreground, label) !important;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.#{$attribute}-disabled,
|
|
404
|
+
.matcha-#{$attribute}-disabled {
|
|
405
|
+
#{$attribute}: map-get($background, disabled) !important;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.#{$attribute}-disabled-icon,
|
|
409
|
+
.matcha-#{$attribute}-disabled-icon {
|
|
410
|
+
#{$attribute}: map-get($foreground, disabled-icon) !important;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.#{$attribute}-selected,
|
|
414
|
+
.matcha-#{$attribute}-selected {
|
|
415
|
+
#{$attribute}: map-get($background, selected-button) !important;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
@each $colorName in $colorNames {
|
|
419
|
+
@include _generate-dynamic-color-classes($attribute, $colorLevel, $colorName, $background, $foreground);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// @ Elevations Mixins
|
|
3
|
+
//
|
|
4
|
+
// A collection of mixins and CSS classes that can be used to apply elevation to a material
|
|
5
|
+
// element.
|
|
6
|
+
// See: https://material.io/design/environment/elevation.html
|
|
7
|
+
// Examples:
|
|
8
|
+
//
|
|
9
|
+
//
|
|
10
|
+
// .matcha-foo {
|
|
11
|
+
// @include $elevation(2);
|
|
12
|
+
//
|
|
13
|
+
// &:active {
|
|
14
|
+
// @include $elevation(8);
|
|
15
|
+
// }
|
|
16
|
+
// }
|
|
17
|
+
//
|
|
18
|
+
// <div id="external-card" class="elevation-z2"><p>Some content</p></div>
|
|
19
|
+
//
|
|
20
|
+
// For an explanation of the design behind how elevation is implemented, see the design doc at
|
|
21
|
+
// https://goo.gl/Kq0k9Z.
|
|
22
|
+
|
|
23
|
+
// Colors for umbra, penumbra, and ambient shadows. As described in the design doc, each elevation
|
|
24
|
+
// level is created using a set of 3 shadow values, one for umbra (the shadow representing the
|
|
25
|
+
// space completely obscured by an object relative to its light source), one for penumbra (the
|
|
26
|
+
// space partially obscured by an object), and one for ambient (the space which contains the object
|
|
27
|
+
// itself). For a further explanation of these terms and their meanings, see
|
|
28
|
+
// https://en.wikipedia.org/wiki/Umbra,_penumbra_and_antumbra.
|
|
29
|
+
|
|
30
|
+
// Maps for the different shadow sets and their values within each z-space. These values were
|
|
31
|
+
// created by taking a few reference shadow sets created by Google's Designers and interpolating
|
|
32
|
+
// all of the values between them.
|
|
33
|
+
//
|
|
34
|
+
// -----------------------------------------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
// Applies the correct css rules to an element to give it the elevation specified by $zValue.
|
|
37
|
+
// The $zValue must be between 0 and 24.
|
|
38
|
+
@mixin elevation($zValue, $color: $elevation-color, $opacity: $elevation-opacity) {
|
|
39
|
+
@if type-of($zValue) !=number or not unitless($zValue) {
|
|
40
|
+
@error '$zValue must be a unitless number';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@if $zValue < 0 or $zValue >24 {
|
|
44
|
+
@error '$zValue must be between 0 and 24';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
box-shadow: #{map-get(_get-umbra-map($color, $opacity), $zValue)},
|
|
48
|
+
#{map-get(_get-penumbra-map($color, $opacity), $zValue)},
|
|
49
|
+
#{map-get(_get-ambient-map($color, $opacity), $zValue)};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@mixin _theme-elevation($zValue, $theme, $opacity: $elevation-opacity) {
|
|
53
|
+
$foreground: map-get($theme, foreground);
|
|
54
|
+
$elevation-color: map-get($foreground, elevation);
|
|
55
|
+
$elevation-color-or-default: if($elevation-color ==null, $elevation-color, $elevation-color);
|
|
56
|
+
|
|
57
|
+
@include elevation($zValue, $elevation-color-or-default, $opacity);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Applies the elevation to an element in a manner that allows
|
|
61
|
+
// consumers to override it via the Material elevation classes.
|
|
62
|
+
@mixin overridable-elevation($zValue, $color: $elevation-color, $opacity: $elevation-opacity) {
|
|
63
|
+
&:not([class*="#{$_elevation-prefix}"]) {
|
|
64
|
+
@include elevation($zValue, $color, $opacity);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@mixin _theme-overridable-elevation($zValue, $theme, $opacity: $elevation-opacity) {
|
|
69
|
+
$foreground: map-get($theme, foreground);
|
|
70
|
+
$elevation-color: map-get($foreground, elevation);
|
|
71
|
+
$elevation-color-or-default: if($elevation-color ==null, $elevation-color, $elevation-color);
|
|
72
|
+
|
|
73
|
+
@include overridable-elevation($zValue, $elevation-color-or-default, $opacity);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Applies the correct css rules needed to have an element transition between elevations.
|
|
77
|
+
// This mixin should be applied to elements whose elevation values will change depending on their
|
|
78
|
+
// context (e.g. when active or disabled).
|
|
79
|
+
//
|
|
80
|
+
// NOTE(traviskaufman): Both this mixin and the above function use default parameters so they can
|
|
81
|
+
// be used in the same way by clients.
|
|
82
|
+
@mixin elevation-transition($duration: $elevation-transition-duration,
|
|
83
|
+
$easing: $elevation-transition-timing-function) {
|
|
84
|
+
// Returns a string that can be used as the value for a transition property for elevation.
|
|
85
|
+
// Calling this function directly is useful in situations where a component needs to transition
|
|
86
|
+
// more than one property.
|
|
87
|
+
//
|
|
88
|
+
// .foo {
|
|
89
|
+
// transition: elevation-transition-property-value(), opacity 100ms ease;
|
|
90
|
+
// }
|
|
91
|
+
transition: elevation-transition-property-value($duration, $easing);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Css class generator for shadows
|
|
95
|
+
// $_elevation-prefix: "matcha-elevation-z";
|
|
96
|
+
@mixin elevation-theme($theme) {
|
|
97
|
+
@for $zValue from 0 through 24 {
|
|
98
|
+
.#{$_elevation-prefix}#{$zValue} {
|
|
99
|
+
@include _theme-elevation($zValue, $theme);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|