matcha-theme 18.0.27 → 18.0.28

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.
Files changed (67) hide show
  1. package/README.md +304 -0
  2. package/abstracts/_breakpoints.scss +33 -0
  3. package/abstracts/_colors.scss +833 -0
  4. package/abstracts/_elevation.scss +102 -0
  5. package/abstracts/_functions.scss +424 -0
  6. package/abstracts/_grid.scss +163 -0
  7. package/abstracts/_order.scss +46 -0
  8. package/abstracts/_position.scss +51 -0
  9. package/abstracts/_sizes.scss +95 -0
  10. package/abstracts/_spacings.scss +216 -0
  11. package/abstracts/_typography.scss +124 -0
  12. package/base/_helpers.scss +2181 -0
  13. package/base/_reset.scss +9 -0
  14. package/base/_typography.scss +244 -0
  15. package/components/matcha-audio-player.scss +37 -0
  16. package/components/matcha-buttons.scss +165 -0
  17. package/components/matcha-cards.scss +93 -0
  18. package/components/matcha-color-pick.scss +32 -0
  19. package/components/matcha-draggable.scss +25 -0
  20. package/components/matcha-header.scss +327 -0
  21. package/components/matcha-horizontal-tree.scss +277 -0
  22. package/components/matcha-menu.scss +71 -0
  23. package/components/matcha-progress-bar.scss +107 -0
  24. package/components/matcha-scrollbar.scss +36 -0
  25. package/components/matcha-scrollbox-shadow.scss +127 -0
  26. package/components/matcha-table.scss +279 -0
  27. package/css/matcha-style.css +76772 -0
  28. package/fonts/CircularStd-Black.eot +0 -0
  29. package/fonts/CircularStd-Black.svg +3426 -0
  30. package/fonts/CircularStd-Black.ttf +0 -0
  31. package/fonts/CircularStd-Black.woff +0 -0
  32. package/fonts/CircularStd-Black.woff2 +0 -0
  33. package/fonts/CircularStd-Bold.eot +0 -0
  34. package/fonts/CircularStd-Bold.otf +0 -0
  35. package/fonts/CircularStd-Bold.svg +13532 -0
  36. package/fonts/CircularStd-Bold.ttf +0 -0
  37. package/fonts/CircularStd-Bold.woff +0 -0
  38. package/fonts/CircularStd-Bold.woff2 +0 -0
  39. package/fonts/CircularStd-Medium.eot +0 -0
  40. package/fonts/CircularStd-Medium.otf +0 -0
  41. package/fonts/CircularStd-Medium.svg +13511 -0
  42. package/fonts/CircularStd-Medium.ttf +0 -0
  43. package/fonts/CircularStd-Medium.woff +0 -0
  44. package/fonts/CircularStd-Medium.woff2 +0 -0
  45. package/fonts/CircularStd-Regular.eot +0 -0
  46. package/fonts/CircularStd-Regular.otf +0 -0
  47. package/fonts/CircularStd-Regular.svg +2378 -0
  48. package/fonts/CircularStd-Regular.ttf +0 -0
  49. package/fonts/CircularStd-Regular.woff +0 -0
  50. package/fonts/CircularStd-Regular.woff2 +0 -0
  51. package/main.scss +135 -0
  52. package/package.json +2 -2
  53. package/tokens/_animations.scss +37 -0
  54. package/tokens/_breakpoints.scss +38 -0
  55. package/tokens/_color-tokens.scss +1216 -0
  56. package/tokens/_elevation-tokens.scss +14 -0
  57. package/tokens/_spacing-tokens.scss +96 -0
  58. package/tokens/_typography-tokens.scss +25 -0
  59. package/vendors/angular-editor.scss +56 -0
  60. package/vendors/angular-material-fixes.scss +261 -0
  61. package/vendors/calendar.scss +2880 -0
  62. package/vendors/charts.scss +92 -0
  63. package/vendors/ng5-slider.scss +56 -0
  64. package/vendors/ngx-material-timepicker.scss +50 -0
  65. package/core.scss +0 -1210
  66. package/matcha-core.css +0 -62385
  67. package/matcha-core.min.css +0 -1
@@ -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
+ }
@@ -0,0 +1,424 @@
1
+ // -------------------------------------------------------------------------------------------------------------------
2
+ // @ Theme functions
3
+ // --------------------------------------------------------------------------------------------------------------------
4
+ // For a given hue in a palette, return the contrast color from the map of contrast palettes.
5
+ // @param $color-map
6
+ // @param $hue
7
+ @function map-contrast($palette, $hue) {
8
+ @return map-get(map-get($palette, contrast), $hue);
9
+ }
10
+
11
+ // Creates a map of hues to colors for a theme. This is used to define a theme palette in terms
12
+ // of the Material Design hues.
13
+ // @param $color-map
14
+ // @param $primary
15
+ // @param $lighter
16
+ @function palette($base-palette, $default: 500, $lighter: 100, $darker: 700) {
17
+ $result: map_merge(
18
+ $base-palette,
19
+ (
20
+ default: map-get($base-palette, $default),
21
+ lighter: map-get($base-palette, $lighter),
22
+ darker: map-get($base-palette, $darker),
23
+ default-contrast: map-contrast($base-palette, $default),
24
+ lighter-contrast: map-contrast($base-palette, $lighter),
25
+ darker-contrast: map-contrast($base-palette, $darker)
26
+ )
27
+ );
28
+
29
+ // For each hue in the palette, add a "-contrast" color to the map.
30
+ @each $hue, $color in $base-palette {
31
+ $result: map_merge(
32
+ $result,
33
+ (
34
+ "#{$hue}-contrast": map-contrast($base-palette, $hue)
35
+ )
36
+ );
37
+ }
38
+
39
+ @return $result;
40
+ }
41
+
42
+ @function getBaseColorsPalettes() {
43
+ // base colors
44
+ $palettes: (
45
+ red: $red,
46
+ pink: $pink,
47
+ purple: $purple,
48
+ deep-purple: $deep-purple,
49
+ indigo: $indigo,
50
+ blue: $blue,
51
+ light-blue: $light-blue,
52
+ cyan: $cyan,
53
+ teal: $teal,
54
+ green: $green,
55
+ light-green: $light-green,
56
+ lime: $lime,
57
+ yellow: $yellow,
58
+ amber: $amber,
59
+ orange: $orange,
60
+ deep-orange: $deep-orange,
61
+ brown: $brown,
62
+ grey: $grey,
63
+ blue-grey: $blue-grey
64
+ );
65
+ @return $palettes;
66
+ }
67
+
68
+ @function getAllPalettes($theme) {
69
+ $primary: map-get($theme, primary);
70
+ $accent: map-get($theme, accent);
71
+ $warn: map-get($theme, warn);
72
+
73
+ // base colors
74
+ $palettes: (
75
+ red: $red,
76
+ pink: $pink,
77
+ purple: $purple,
78
+ deep-purple: $deep-purple,
79
+ indigo: $indigo,
80
+ blue: $blue,
81
+ light-blue: $light-blue,
82
+ cyan: $cyan,
83
+ teal: $teal,
84
+ green: $green,
85
+ light-green: $light-green,
86
+ lime: $lime,
87
+ yellow: $yellow,
88
+ amber: $amber,
89
+ orange: $orange,
90
+ deep-orange: $deep-orange,
91
+ brown: $brown,
92
+ grey: $grey,
93
+ blue-grey: $blue-grey,
94
+ primary: $primary,
95
+ accent: $accent,
96
+ warn: $warn
97
+ );
98
+ @return $palettes;
99
+ }
100
+
101
+ // Gets a color from a theme palette (the output of mat-palette).
102
+ // The hue can be one of the standard values (500, A400, etc.), one of the three preconfigured
103
+ // hues (default, lighter, darker), or any of the aforementioned prefixed with "-contrast".
104
+ //
105
+ // @param $color-map The theme palette (output of mat-palette).
106
+ // @param $hue The hue from the palette to use. If this is a value between 0 and 1, it will
107
+ // be treated as opacity.
108
+ // @param $opacity The alpha channel value for the color.
109
+ @function map-color($palette, $hue: default, $opacity: null) {
110
+ // If hueKey is a number between zero and one, then it actually contains an
111
+ // opacity value, so recall this function with the default hue and that given opacity.
112
+ @if type-of($hue) ==number and $hue >=0 and $hue <=1 {
113
+ @return map-color($palette, default, $hue);
114
+ }
115
+
116
+ $color: map-get($palette, $hue);
117
+
118
+ @if (type-of($color) !=color) {
119
+ // If the $color resolved to something different from a color (e.g. a CSS variable),
120
+ // we can't apply the opacity anyway so we return the value as is, otherwise Sass can
121
+ // throw an error or output something invalid.
122
+ @return $color;
123
+ }
124
+
125
+ @return rgba($color, if($opacity ==null, opacity($color), $opacity));
126
+ }
127
+
128
+ // Creates a container object for a light theme to be given to individual component theme mixins.
129
+ @function light-theme($primary, $accent, $warn) {
130
+ @return (
131
+ primary: $primary,
132
+ accent: $accent,
133
+ warn: $warn,
134
+ is-dark: false,
135
+ foreground: $light-theme-foreground-palette,
136
+ background: $light-theme-background-palette
137
+ );
138
+ }
139
+
140
+ // Creates a container object for a dark theme to be given to individual component theme mixins.
141
+ @function dark-theme($primary, $accent, $warn) {
142
+ @return (
143
+ primary: $primary,
144
+ accent: $accent,
145
+ warn: $warn,
146
+ is-dark: true,
147
+ foreground: $dark-theme-foreground-palette,
148
+ background: $dark-theme-background-palette
149
+ );
150
+ }
151
+
152
+ // Creates a container object for a custom light theme to be given to individual component theme mixins.
153
+ @function light-custom-theme($primary, $accent, $warn, $custom-light-fg, $custom-light-bg) {
154
+ @return (
155
+ primary: $primary,
156
+ accent: $accent,
157
+ warn: $warn,
158
+ is-dark: false,
159
+ foreground: $custom-light-fg,
160
+ background: $custom-light-bg
161
+ );
162
+ }
163
+
164
+ // Creates a container object for a custom dark theme to be given to individual component theme mixins.
165
+ @function dark-custom-theme($primary, $accent, $warn, $custom-dark-fg, $custom-dark-bg) {
166
+ @return (
167
+ primary: $primary,
168
+ accent: $accent,
169
+ warn: $warn,
170
+ is-dark: true,
171
+ foreground: $custom-dark-fg,
172
+ background: $custom-dark-bg
173
+ );
174
+ }
175
+
176
+ // -------------------------------------------------------------------------------------------------------------------
177
+ // @ Typography functions
178
+ // --------------------------------------------------------------------------------------------------------------------
179
+ // Represents a typography level from the Material design spec.
180
+ @function matcha-typography-level(
181
+ $font-size,
182
+ $line-height: $font-size,
183
+ $font-weight: 400,
184
+ $font-family: null,
185
+ $letter-spacing: null
186
+ ) {
187
+ @return (
188
+ font-size: $font-size,
189
+ line-height: $line-height,
190
+ font-weight: $font-weight,
191
+ font-family: $font-family,
192
+ letter-spacing: $letter-spacing
193
+ );
194
+ }
195
+
196
+ // Represents a collection of typography levels.
197
+ // Defaults come from https://material.io/guidelines/style/typography.html
198
+ // Note: The spec doesn't mention letter spacing. The values here come from
199
+ // eyeballing it until it looked exactly like the spec examples.
200
+ @function matcha-typography-config(
201
+ $font-family: 'CircularStd, "Helvetica Neue", "Arial", sans-serif, "angular";',
202
+ $display-4: matcha-typography-level(112px, 112px, 300, $letter-spacing: -0.05em),
203
+ $display-3: matcha-typography-level(56px, 56px, 400, $letter-spacing: -0.02em),
204
+ $display-2: matcha-typography-level(45px, 48px, 400, $letter-spacing: -0.005em),
205
+ $display-1: matcha-typography-level(34px, 40px, 400),
206
+ $headline: matcha-typography-level(24px, 32px, 400),
207
+ $title: matcha-typography-level(20px, 32px, 700),
208
+ $subheading-2: matcha-typography-level(16px, 28px, 900),
209
+ $subheading-1: matcha-typography-level(15px, 24px, 900),
210
+ $body-2: matcha-typography-level(14px, 24px, 500),
211
+ $body-1: matcha-typography-level(14px, 20px, 400),
212
+ $caption: matcha-typography-level(12px, 20px, 500),
213
+ $button: matcha-typography-level(14px, 14px, 500),
214
+ $input: matcha-typography-level(inherit, 1.125, 400)
215
+ ) {
216
+ // Line-height must be unit-less fraction of the font-size.
217
+ // Declare an initial map with all of the levels.
218
+ $config: (
219
+ display-4: $display-4,
220
+ display-3: $display-3,
221
+ display-2: $display-2,
222
+ display-1: $display-1,
223
+ headline: $headline,
224
+ title: $title,
225
+ subheading-2: $subheading-2,
226
+ subheading-1: $subheading-1,
227
+ body-2: $body-2,
228
+ body-1: $body-1,
229
+ caption: $caption,
230
+ button: $button,
231
+ input: $input
232
+ );
233
+
234
+ // Loop through the levels and set the `font-family` of the ones that don't have one to the base.
235
+ // Note that Sass can't modify maps in place, which means that we need to merge and re-assign.
236
+ @each $key, $level in $config {
237
+ @if map-get($level, font-family) ==null {
238
+ $new-level: map-merge(
239
+ $level,
240
+ (
241
+ font-family: $font-family
242
+ )
243
+ );
244
+ $config: map-merge(
245
+ $config,
246
+ (
247
+ $key: $new-level
248
+ )
249
+ );
250
+ }
251
+ }
252
+
253
+ // Add the base font family to the config.
254
+ @return map-merge(
255
+ $config,
256
+ (
257
+ font-family: $font-family
258
+ )
259
+ );
260
+ }
261
+
262
+ // Utility for fetching a nested value from a typography config.
263
+ @function _matcha-get-type-value($config, $level, $name) {
264
+ @return map-get(map-get($config, $level), $name);
265
+ }
266
+
267
+ // Gets the font size for a level inside a typography config.
268
+ @function matcha-font-size($config, $level) {
269
+ @return _matcha-get-type-value($config, $level, font-size);
270
+ }
271
+
272
+ // Gets the line height for a level inside a typography config.
273
+ @function matcha-line-height($config, $level) {
274
+ @return _matcha-get-type-value($config, $level, line-height);
275
+ }
276
+
277
+ // Gets the font weight for a level inside a typography config.
278
+ @function matcha-font-weight($config, $level) {
279
+ @return _matcha-get-type-value($config, $level, font-weight);
280
+ }
281
+
282
+ // Gets the letter spacing for a level inside a typography config.
283
+ @function matcha-letter-spacing($config, $level) {
284
+ @return _matcha-get-type-value($config, $level, letter-spacing);
285
+ }
286
+
287
+ // Gets the font-family from a typography config and removes the quotes around it.
288
+ @function matcha-font-family($config, $level: null) {
289
+ $font-family: map-get($config, font-family);
290
+
291
+ @if $level !=null {
292
+ $font-family: _matcha-get-type-value($config, $level, font-family);
293
+ }
294
+
295
+ // Guard against unquoting non-string values, because it's deprecated.
296
+ @return if(type-of($font-family) ==string, unquote($font-family), $font-family);
297
+ }
298
+
299
+ // -------------------------------------------------------------------------------------------------------------------
300
+ // @ Elevation functions
301
+ // --------------------------------------------------------------------------------------------------------------------
302
+ // A collection of functions that can be used to apply elevation to a material
303
+
304
+ @function _get-umbra-map($color, $opacity) {
305
+ $shadow-color: if(type-of($color) ==color, rgba($color, $opacity * 0.033), $color);
306
+
307
+ @return (
308
+ 0: "0px 0px 0px 0px #{$shadow-color}",
309
+ 1: "0px 2px 2px 0px #{$shadow-color}",
310
+ 2: "0px 3px 2px -2px #{$shadow-color}",
311
+ 3: "0px 3px 3px -2px #{$shadow-color}",
312
+ 4: "0px 2px 4px -1px #{$shadow-color}",
313
+ 5: "0px 3px 5px -1px #{$shadow-color}",
314
+ 6: "0px 3px 5px -1px #{$shadow-color}",
315
+ 7: "0px 4px 5px -2px #{$shadow-color}",
316
+ 8: "0px 5px 5px -3px #{$shadow-color}",
317
+ 9: "0px 5px 6px -3px #{$shadow-color}",
318
+ 10: "0px 6px 6px -3px #{$shadow-color}",
319
+ 11: "0px 6px 7px -4px #{$shadow-color}",
320
+ 12: "0px 7px 8px -4px #{$shadow-color}",
321
+ 13: "0px 7px 8px -4px #{$shadow-color}",
322
+ 14: "0px 7px 9px -4px #{$shadow-color}",
323
+ 15: "0px 8px 9px -5px #{$shadow-color}",
324
+ 16: "0px 8px 10px -5px #{$shadow-color}",
325
+ 17: "0px 8px 11px -5px #{$shadow-color}",
326
+ 18: "0px 9px 11px -5px #{$shadow-color}",
327
+ 19: "0px 9px 12px -6px #{$shadow-color}",
328
+ 20: "0px 10px 13px -6px #{$shadow-color}",
329
+ 21: "0px 10px 13px -6px #{$shadow-color}",
330
+ 22: "0px 10px 14px -6px #{$shadow-color}",
331
+ 23: "0px 11px 14px -7px #{$shadow-color}",
332
+ 24: "0px 11px 15px -7px #{$shadow-color}"
333
+ );
334
+ }
335
+
336
+ @function _get-penumbra-map($color, $opacity) {
337
+ $shadow-color: if(type-of($color) ==color, rgba($color, $opacity * 0.033), $color);
338
+
339
+ @return (
340
+ 0: "0px 0px 0px 0px #{$shadow-color}",
341
+ 1: "0px 2px 2px 0px #{$shadow-color}",
342
+ 2: "0px 2px 3px 0px #{$shadow-color}",
343
+ 3: "0px 3px 4px 0px #{$shadow-color}",
344
+ 4: "0px 4px 5px 0px #{$shadow-color}",
345
+ 5: "0px 5px 8px 0px #{$shadow-color}",
346
+ 6: "0px 6px 10px 0px #{$shadow-color}",
347
+ 7: "0px 7px 10px 1px #{$shadow-color}",
348
+ 8: "0px 8px 10px 1px #{$shadow-color}",
349
+ 9: "0px 9px 12px 1px #{$shadow-color}",
350
+ 10: "0px 10px 14px 1px #{$shadow-color}",
351
+ 11: "0px 11px 15px 1px #{$shadow-color}",
352
+ 12: "0px 12px 17px 2px #{$shadow-color}",
353
+ 13: "0px 13px 19px 2px #{$shadow-color}",
354
+ 14: "0px 14px 21px 2px #{$shadow-color}",
355
+ 15: "0px 15px 22px 2px #{$shadow-color}",
356
+ 16: "0px 16px 24px 2px #{$shadow-color}",
357
+ 17: "0px 17px 26px 2px #{$shadow-color}",
358
+ 18: "0px 18px 28px 2px #{$shadow-color}",
359
+ 19: "0px 19px 29px 2px #{$shadow-color}",
360
+ 20: "0px 20px 31px 3px #{$shadow-color}",
361
+ 21: "0px 21px 33px 3px #{$shadow-color}",
362
+ 22: "0px 22px 35px 3px #{$shadow-color}",
363
+ 23: "0px 23px 36px 3px #{$shadow-color}",
364
+ 24: "0px 24px 38px 3px #{$shadow-color}"
365
+ );
366
+ }
367
+
368
+ @function _get-ambient-map($color, $opacity) {
369
+ $shadow-color: if(type-of($color) ==color, rgba($color, $opacity * 0.033), $color);
370
+
371
+ @return (
372
+ 0: "0px 0px 0px 0px #{$shadow-color}",
373
+ 1: "0px 2px 2px 0px #{$shadow-color}",
374
+ 2: "0px 1px 5px 0px #{$shadow-color}",
375
+ 3: "0px 1px 8px 0px #{$shadow-color}",
376
+ 4: "0px 1px 10px 0px #{$shadow-color}",
377
+ 5: "0px 1px 14px 0px #{$shadow-color}",
378
+ 6: "0px 1px 18px 0px #{$shadow-color}",
379
+ 7: "0px 2px 16px 1px #{$shadow-color}",
380
+ 8: "0px 3px 14px 2px #{$shadow-color}",
381
+ 9: "0px 3px 16px 2px #{$shadow-color}",
382
+ 10: "0px 4px 18px 3px #{$shadow-color}",
383
+ 11: "0px 4px 20px 3px #{$shadow-color}",
384
+ 12: "0px 5px 22px 4px #{$shadow-color}",
385
+ 13: "0px 5px 24px 4px #{$shadow-color}",
386
+ 14: "0px 5px 26px 4px #{$shadow-color}",
387
+ 15: "0px 6px 28px 5px #{$shadow-color}",
388
+ 16: "0px 6px 30px 5px #{$shadow-color}",
389
+ 17: "0px 6px 32px 5px #{$shadow-color}",
390
+ 18: "0px 7px 34px 6px #{$shadow-color}",
391
+ 19: "0px 7px 36px 6px #{$shadow-color}",
392
+ 20: "0px 8px 38px 7px #{$shadow-color}",
393
+ 21: "0px 8px 40px 7px #{$shadow-color}",
394
+ 22: "0px 8px 42px 7px #{$shadow-color}",
395
+ 23: "0px 9px 44px 8px #{$shadow-color}",
396
+ 24: "0px 9px 46px 8px #{$shadow-color}"
397
+ );
398
+ }
399
+
400
+ // Returns a string that can be used as the value for a transition property for elevation.
401
+ // Calling this function directly is useful in situations where a component needs to transition
402
+ // more than one property.
403
+ //
404
+ // .foo {
405
+ // transition: elevation-transition-property-value(), opacity 100ms ease;
406
+ // }
407
+ @function elevation-transition-property-value(
408
+ $duration: $elevation-transition-duration,
409
+ $easing: $elevation-transition-timing-function
410
+ ) {
411
+ @return box-shadow #{$duration} #{$easing};
412
+ }
413
+
414
+ // Define the variable for the base size (usually 16 pixels = 1 rem).
415
+ $base-font-size: 16px;
416
+
417
+ // Function to convert pixels to rem.
418
+ @function px-to-rem($value-in-px) {
419
+ @if $value-in-px != 0 {
420
+ @return calc($value-in-px / $base-font-size) * 1rem;
421
+ } @else {
422
+ @return $value-in-px;
423
+ }
424
+ }
@@ -0,0 +1,163 @@
1
+ // -------------------------------------------------------------------------------------------------------------------
2
+ // @ Display grids generator
3
+ // -------------------------------------------------------------------------------------------------------------------
4
+ @mixin display-grid($grid-prefix, $grid-length, $grid-sizes, $helper-breakpoints) {
5
+ @each $sizeLabel, $value in $grid-sizes {
6
+ .row-#{$sizeLabel} {
7
+ display: flex;
8
+ flex-direction: column;
9
+ }
10
+
11
+ @media only screen and (min-width: #{$value}) {
12
+ @for $i from 1 through $grid-length {
13
+ .row > .#{$grid-prefix}-#{$sizeLabel}-#{$i} {
14
+ $calculated-flex-basis: calc($i / $grid-length) * 100%;
15
+ flex-basis: $calculated-flex-basis;
16
+ }
17
+
18
+ .row > .#{$grid-prefix}-offset-#{$sizeLabel}-#{$i} {
19
+ $calculated-margin-left: calc($i / $grid-length) * 100%;
20
+ margin-left: $calculated-margin-left;
21
+ }
22
+ }
23
+
24
+ .row-#{$sizeLabel} {
25
+ flex-direction: row;
26
+ }
27
+ }
28
+ }
29
+
30
+ [class^="grid-"] {
31
+ display: grid;
32
+ grid-template-columns: minmax(0, 1fr);
33
+ }
34
+
35
+ @for $i from 0 through 12 {
36
+ $size: $i * 4;
37
+ .gap-#{$size} {
38
+ column-gap: #{$size}px;
39
+ row-gap: #{$size}px;
40
+ }
41
+ @each $breakpoint, $materialBreakpoint in $helper-breakpoints {
42
+ @include media-breakpoint($materialBreakpoint) {
43
+ $infix: if($materialBreakpoint == null, "", "-#{$breakpoint}");
44
+ .gap#{$infix}-#{$size} {
45
+ column-gap: #{$size}px;
46
+ row-gap: #{$size}px;
47
+ }
48
+ }
49
+ }
50
+ }
51
+
52
+ @each $breakpoint, $materialBreakpoint in $helper-breakpoints {
53
+ @include media-breakpoint($materialBreakpoint) {
54
+ $infix: if($materialBreakpoint ==null, "", "-#{$breakpoint}");
55
+
56
+ @for $i from 1 through $grid-length {
57
+ .grid#{$infix}-#{$i} {
58
+ @include _grid-prop($i);
59
+ }
60
+
61
+ .colspan#{$infix}-#{$i} {
62
+ grid-column-end: span #{$i};
63
+ }
64
+
65
+ .rowspan#{$infix}-#{$i} {
66
+ grid-row-end: span #{$i};
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+
74
+
75
+ @mixin _grid-prop($i) {
76
+ display: grid;
77
+ grid-template-columns: repeat($i, minmax(0, 1fr));
78
+ }
79
+
80
+ // -------------------------------------------------------------------------------------------------------------------
81
+ // @ Display flex generator
82
+ // -------------------------------------------------------------------------------------------------------------------
83
+ @mixin display-flex($grid-prefix, $grid-length, $grid-sizes) {
84
+ .row {
85
+ display: flex;
86
+ flex-wrap: wrap;
87
+
88
+ > div[class*="#{$grid-prefix}-"] {
89
+ box-sizing: border-box;
90
+ }
91
+
92
+ > div:not([class*="#{$grid-prefix}-"]) {
93
+ flex: 1;
94
+ }
95
+
96
+ @for $i from 1 through $grid-length {
97
+ .#{$grid-prefix}-#{$i} {
98
+ $calculated-flex-basis: calc($i / $grid-length) * 100%;
99
+ flex-basis: $calculated-flex-basis;
100
+ }
101
+
102
+ .#{$grid-prefix}-offset-#{$i} {
103
+ $calculated-margin-left: calc($i / $grid-length) * 100%;
104
+ margin-left: $calculated-margin-left;
105
+ }
106
+
107
+ @each $sizeLabel, $value in $grid-sizes {
108
+ [class*="#{$grid-prefix}-offset-#{$sizeLabel}-"] {
109
+ margin-left: 0;
110
+ }
111
+
112
+ .#{$grid-prefix}-#{$sizeLabel}-#{$i} {
113
+ flex-basis: 100%;
114
+ }
115
+ }
116
+ }
117
+
118
+ @each $classLabel, $cssValue in (align-start flex-start, align-center center, align-end flex-end) {
119
+ > div[class*="#{$grid-prefix}-"].#{$classLabel} {
120
+ align-self: $cssValue;
121
+ }
122
+ }
123
+
124
+ @each $classLabel,
125
+ $cssValue
126
+ in (
127
+ align-start flex-start,
128
+ align-center center,
129
+ align-end flex-end,
130
+ space-around space-around,
131
+ space-between space-between
132
+ )
133
+ {
134
+ &.#{$classLabel} {
135
+ justify-content: $cssValue;
136
+ }
137
+ }
138
+ }
139
+ }
140
+
141
+ @include display-grid($grid-prefix, $grid-length, $grid-sizes, $helper-breakpoints);
142
+ @include display-flex($grid-prefix, $grid-length, $grid-sizes);
143
+
144
+ // -------------------------------------------------------------------------------------------------------------------
145
+ // Dynamic gaps
146
+ // -------------------------------------------------------------------------------------------------------------------
147
+ .gap-inside {
148
+ -moz-column-gap: 16px;
149
+ column-gap: 16px;
150
+ row-gap: 16px;
151
+ }
152
+ .gap-outside {
153
+ -moz-column-gap: 16px;
154
+ column-gap: 16px;
155
+ row-gap: 16px;
156
+ }
157
+ @media screen and (min-width: 600px) {
158
+ .gap-outside {
159
+ -moz-column-gap: 24px;
160
+ column-gap: 24px;
161
+ row-gap: 24px;
162
+ }
163
+ }