@graupl/core 1.0.0-beta.14 → 1.0.0-beta.16
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/dist/css/base/button.css +1 -1
- package/dist/css/base/button.css.map +1 -1
- package/dist/css/base/form.css +1 -1
- package/dist/css/base/form.css.map +1 -1
- package/dist/css/base/link.css +1 -1
- package/dist/css/base/link.css.map +1 -1
- package/dist/css/base/table.css.map +1 -1
- package/dist/css/base.css +1 -1
- package/dist/css/base.css.map +1 -1
- package/dist/css/component/accordion.css +2 -2
- package/dist/css/component/accordion.css.map +1 -1
- package/dist/css/component/alert.css +1 -1
- package/dist/css/component/alert.css.map +1 -1
- package/dist/css/component/carousel.css +1 -1
- package/dist/css/component/carousel.css.map +1 -1
- package/dist/css/component.css +2 -2
- package/dist/css/component.css.map +1 -1
- package/dist/css/graupl.css +2 -2
- package/dist/css/graupl.css.map +1 -1
- package/dist/css/layout.css +2 -2
- package/dist/css/layout.css.map +1 -1
- package/dist/css/state/focus.css +1 -1
- package/dist/css/state/focus.css.map +1 -1
- package/dist/css/state.css +1 -1
- package/dist/css/state.css.map +1 -1
- package/dist/css/theme/color.css +1 -1
- package/dist/css/theme/color.css.map +1 -1
- package/dist/css/theme.css +1 -1
- package/dist/css/theme.css.map +1 -1
- package/dist/css/utilities/border.css +1 -1
- package/dist/css/utilities/border.css.map +1 -1
- package/dist/css/utilities/color.css +1 -1
- package/dist/css/utilities/color.css.map +1 -1
- package/dist/css/utilities/gradient.css +1 -1
- package/dist/css/utilities/gradient.css.map +1 -1
- package/dist/css/utilities/order.css.map +1 -1
- package/dist/css/utilities/typography.css +1 -1
- package/dist/css/utilities/typography.css.map +1 -1
- package/dist/css/utilities/visually-hidden.css.map +1 -1
- package/dist/css/utilities.css +1 -1
- package/dist/css/utilities.css.map +1 -1
- package/dist/js/accordion.js.map +1 -1
- package/dist/js/alert.js.map +1 -1
- package/dist/js/carousel.js.map +1 -1
- package/dist/js/component/accordion.cjs.js.map +1 -1
- package/dist/js/component/accordion.es.js.map +1 -1
- package/dist/js/component/accordion.iife.js.map +1 -1
- package/dist/js/component/alert.cjs.js.map +1 -1
- package/dist/js/component/alert.es.js.map +1 -1
- package/dist/js/component/alert.iife.js.map +1 -1
- package/dist/js/component/carousel.cjs.js.map +1 -1
- package/dist/js/component/carousel.es.js.map +1 -1
- package/dist/js/component/carousel.iife.js.map +1 -1
- package/dist/js/generator/accordion.cjs.js.map +1 -1
- package/dist/js/generator/accordion.es.js.map +1 -1
- package/dist/js/generator/accordion.iife.js.map +1 -1
- package/dist/js/generator/alert.cjs.js.map +1 -1
- package/dist/js/generator/alert.es.js.map +1 -1
- package/dist/js/generator/alert.iife.js.map +1 -1
- package/dist/js/generator/carousel.cjs.js.map +1 -1
- package/dist/js/generator/carousel.es.js.map +1 -1
- package/dist/js/generator/carousel.iife.js.map +1 -1
- package/dist/js/generator/navigation.cjs.js.map +1 -1
- package/dist/js/generator/navigation.es.js.map +1 -1
- package/dist/js/generator/navigation.iife.js.map +1 -1
- package/dist/js/graupl.js.map +1 -1
- package/dist/js/navigation.js.map +1 -1
- package/package.json +1 -1
- package/src/js/domHelpers.js +5 -10
- package/src/scss/_defaults.scss +147 -29
- package/src/scss/base/button/_defaults.scss +21 -5
- package/src/scss/base/button/_mixins.scss +1 -1
- package/src/scss/base/table/_defaults.scss +15 -2
- package/src/scss/base/table/_index.scss +4 -7
- package/src/scss/component/alert/_defaults.scss +22 -5
- package/src/scss/component/alert/_index.scss +1 -1
- package/src/scss/functions/_theme.scss +14 -2
- package/src/scss/theme/color/_defaults.scss +84 -14
- package/src/scss/theme/color/_index.scss +18 -3
- package/src/scss/theme/color/_variables.scss +63 -30
- package/src/scss/theme/typography/_defaults.scss +37 -7
- package/src/scss/utilities/_template/_defaults.scss +7 -6
- package/src/scss/utilities/_template/_index.scss +2 -2
- package/src/scss/utilities/alignment/_defaults.scss +53 -15
- package/src/scss/utilities/alignment/_index.scss +4 -6
- package/src/scss/utilities/background/_defaults.scss +117 -35
- package/src/scss/utilities/background/_index.scss +8 -14
- package/src/scss/utilities/border/_defaults.scss +77 -15
- package/src/scss/utilities/border/_index.scss +73 -75
- package/src/scss/utilities/color/_defaults.scss +55 -7
- package/src/scss/utilities/color/_index.scss +143 -144
- package/src/scss/utilities/container/_defaults.scss +21 -5
- package/src/scss/utilities/container/_index.scss +2 -2
- package/src/scss/utilities/display/_defaults.scss +18 -5
- package/src/scss/utilities/display/_index.scss +2 -2
- package/src/scss/utilities/flex/_defaults.scss +88 -25
- package/src/scss/utilities/flex/_index.scss +6 -10
- package/src/scss/utilities/gradient/_defaults.scss +64 -9
- package/src/scss/utilities/gradient/_index.scss +127 -129
- package/src/scss/utilities/height/_defaults.scss +27 -2
- package/src/scss/utilities/height/_index.scss +169 -163
- package/src/scss/utilities/inset/_defaults.scss +25 -4
- package/src/scss/utilities/inset/_index.scss +3 -4
- package/src/scss/utilities/justification/_defaults.scss +53 -15
- package/src/scss/utilities/justification/_index.scss +4 -6
- package/src/scss/utilities/list/_defaults.scss +37 -10
- package/src/scss/utilities/list/_index.scss +3 -4
- package/src/scss/utilities/order/_defaults.scss +33 -2
- package/src/scss/utilities/order/_index.scss +55 -67
- package/src/scss/utilities/position/_defaults.scss +18 -5
- package/src/scss/utilities/position/_index.scss +2 -2
- package/src/scss/utilities/ratio/_defaults.scss +15 -2
- package/src/scss/utilities/ratio/_index.scss +2 -2
- package/src/scss/utilities/spacing/_defaults.scss +18 -5
- package/src/scss/utilities/spacing/_index.scss +2 -2
- package/src/scss/utilities/typography/_defaults.scss +146 -12
- package/src/scss/utilities/typography/_index.scss +854 -704
- package/src/scss/utilities/visibility/_defaults.scss +20 -5
- package/src/scss/utilities/visibility/_index.scss +2 -2
- package/src/scss/utilities/visually-hidden/_defaults.scss +1 -0
- package/src/scss/utilities/visually-hidden/_index.scss +1 -0
- package/src/scss/utilities/width/_defaults.scss +27 -2
- package/src/scss/utilities/width/_index.scss +163 -163
- package/src/scss/utilities/z-index/_defaults.scss +17 -5
- package/src/scss/utilities/z-index/_index.scss +2 -2
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
background-color: $alert-background;
|
|
95
95
|
color: $alert-color;
|
|
96
96
|
|
|
97
|
-
@each $color
|
|
97
|
+
@each $color in theme.get-colors() {
|
|
98
98
|
&#{defaults.$alert-theme-selector-prefix}#{$color} {
|
|
99
99
|
@each $prop, $shade in defaults.$alert-state-theme-map {
|
|
100
100
|
--#{root-defaults.$prefix}alert-#{$prop}: #{theme.get(
|
|
@@ -27,13 +27,25 @@
|
|
|
27
27
|
@return map.get(map.get(map.get(color.$themes, $theme), $color), $shade);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
@if map.has-key(color.$themes, $theme, $color, _default) {
|
|
31
|
+
@return map.get(map.get(map.get(color.$themes, $theme), $color), _default);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@function get-color($color, $theme: active) {
|
|
38
|
+
@if map.has-key(color.$themes, $theme, $color) {
|
|
39
|
+
@return map.get(map.get(color.$themes, $theme), $color);
|
|
40
|
+
}
|
|
41
|
+
|
|
30
42
|
@return null;
|
|
31
43
|
}
|
|
32
44
|
|
|
33
|
-
@function
|
|
45
|
+
@function get-colors($theme: active) {
|
|
34
46
|
@if map.has-key(color.$themes, $theme) {
|
|
35
47
|
@return map.keys(map.get(color.$themes, $theme));
|
|
36
48
|
}
|
|
37
49
|
|
|
38
|
-
@return
|
|
50
|
+
@return ();
|
|
39
51
|
}
|
|
@@ -6,9 +6,13 @@
|
|
|
6
6
|
// They should not be used to define direct property values (i.e. font-size, color, etc.).
|
|
7
7
|
// Those should be defined as custom properties in the `_variables.scss` file.
|
|
8
8
|
|
|
9
|
+
@use "../../defaults" as root-defaults;
|
|
9
10
|
@use "sass:map";
|
|
10
11
|
@use "sass:list";
|
|
12
|
+
@use "sass:meta";
|
|
11
13
|
|
|
14
|
+
$generate-base-colors: root-defaults.$generate-base-colors !default;
|
|
15
|
+
$generate-base-themes: root-defaults.$generate-base-themes !default;
|
|
12
16
|
$theme-selector-prefix: "." !default;
|
|
13
17
|
$theme-selector-suffix: "-mode" !default;
|
|
14
18
|
|
|
@@ -27,8 +31,9 @@ $theme-selector-suffix: "-mode" !default;
|
|
|
27
31
|
// Users can override any part of this giant map, allowing for fine-tuned control of theme colours.
|
|
28
32
|
|
|
29
33
|
// Colours.
|
|
30
|
-
|
|
34
|
+
$-colors: (
|
|
31
35
|
primary: (
|
|
36
|
+
_default: hsl(219deg 75% 50%),
|
|
32
37
|
100: hsl(219deg 100% 95%),
|
|
33
38
|
200: hsl(219deg 90% 80%),
|
|
34
39
|
300: hsl(219deg 80% 65%),
|
|
@@ -40,6 +45,7 @@ $default-colors: (
|
|
|
40
45
|
900: hsl(219deg 100% 10%),
|
|
41
46
|
),
|
|
42
47
|
secondary: (
|
|
48
|
+
_default: hsl(235deg 15% 50%),
|
|
43
49
|
100: hsl(235deg 40% 95%),
|
|
44
50
|
200: hsl(235deg 30% 80%),
|
|
45
51
|
300: hsl(235deg 20% 65%),
|
|
@@ -51,6 +57,7 @@ $default-colors: (
|
|
|
51
57
|
900: hsl(235deg 40% 10%),
|
|
52
58
|
),
|
|
53
59
|
tertiary: (
|
|
60
|
+
_default: hsl(340deg 60% 50%),
|
|
54
61
|
100: hsl(340deg 85% 95%),
|
|
55
62
|
200: hsl(340deg 75% 80%),
|
|
56
63
|
300: hsl(340deg 65% 65%),
|
|
@@ -63,16 +70,51 @@ $default-colors: (
|
|
|
63
70
|
),
|
|
64
71
|
);
|
|
65
72
|
$custom-colors: () !default;
|
|
66
|
-
$colors:
|
|
73
|
+
$colors: () !default;
|
|
74
|
+
|
|
75
|
+
// Loop through the customized colors and convert them to a map structure.
|
|
76
|
+
// This allows users to more easlily add 1-off custom colours without having to define the entire color map structure.
|
|
77
|
+
@each $color, $value in $colors {
|
|
78
|
+
@if meta.type-of($value) == "color" {
|
|
79
|
+
$colors: map.merge(
|
|
80
|
+
$colors,
|
|
81
|
+
(
|
|
82
|
+
$color: (
|
|
83
|
+
_default: $value,
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// @todo remove this once $custom-colors is removed
|
|
91
|
+
@if $custom-colors != () {
|
|
92
|
+
@warn "`$custom-colors` is deprecated and will be removed in a future release of Graupl. Use `$colors` instead.";
|
|
93
|
+
|
|
94
|
+
$colors: map.deep-merge($colors, $custom-colors);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Merge the custom colors with the default ones.
|
|
98
|
+
@if $generate-base-colors {
|
|
99
|
+
$colors: map.deep-merge($-colors, $colors);
|
|
100
|
+
}
|
|
67
101
|
|
|
68
102
|
// Themes.
|
|
69
|
-
|
|
103
|
+
$-themes: (light, dark);
|
|
70
104
|
$custom-themes: () !default;
|
|
71
|
-
$themes:
|
|
105
|
+
$themes: () !default;
|
|
106
|
+
|
|
107
|
+
// @todo remove this once $custom-themes is removed
|
|
108
|
+
@if $custom-themes != () {
|
|
109
|
+
@warn "`$custom-themes` is deprecated and will be removed in a future release of Graupl. Use `$themes` instead.";
|
|
110
|
+
|
|
111
|
+
$themes: list.join($themes, $custom-themes);
|
|
112
|
+
}
|
|
113
|
+
|
|
72
114
|
$default-theme: light !default;
|
|
73
115
|
|
|
74
116
|
// Theme mappings.
|
|
75
|
-
|
|
117
|
+
$-theme-mappings: (
|
|
76
118
|
light: (
|
|
77
119
|
100: 100,
|
|
78
120
|
200: 200,
|
|
@@ -97,13 +139,23 @@ $default-theme-mappings: (
|
|
|
97
139
|
),
|
|
98
140
|
);
|
|
99
141
|
$custom-theme-mappings: () !default;
|
|
100
|
-
$theme-mappings:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
)
|
|
142
|
+
$theme-mappings: () !default;
|
|
143
|
+
|
|
144
|
+
// @todo remove this once $custom-theme-mappings is removed
|
|
145
|
+
@if $custom-theme-mappings != () {
|
|
146
|
+
@warn "`$custom-theme-mappings` is deprecated and will be removed in a future release of Graupl. Use `$theme-mappings` instead.";
|
|
147
|
+
|
|
148
|
+
$theme-mappings: map.deep-merge($theme-mappings, $custom-theme-mappings);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Merge the custom themes with the default ones.
|
|
152
|
+
@if $generate-base-themes {
|
|
153
|
+
$themes: list.join($-themes, $themes);
|
|
154
|
+
$theme-mappings: map.deep-merge($-theme-mappings, $theme-mappings);
|
|
155
|
+
}
|
|
104
156
|
|
|
105
157
|
// Theme map.
|
|
106
|
-
|
|
158
|
+
$-theme-map: ();
|
|
107
159
|
|
|
108
160
|
@each $theme in $themes {
|
|
109
161
|
$theme-map: ();
|
|
@@ -112,12 +164,21 @@ $default-theme-map: ();
|
|
|
112
164
|
$color-theme-map: ();
|
|
113
165
|
|
|
114
166
|
@each $shade, $value in $color-map {
|
|
167
|
+
$color-property: null;
|
|
168
|
+
|
|
169
|
+
// Handle _default shade vs proper shade mappings.
|
|
170
|
+
@if map.has-key($theme-mappings, $theme, $shade) {
|
|
171
|
+
$color-property: map.get($theme-mappings, $theme, $shade);
|
|
172
|
+
} @else if $shade == "_default" {
|
|
173
|
+
$color-property: $shade;
|
|
174
|
+
}
|
|
175
|
+
|
|
115
176
|
$color-theme-map: map.merge(
|
|
116
177
|
$color-theme-map,
|
|
117
178
|
(
|
|
118
179
|
$shade: (
|
|
119
180
|
color: $color-name,
|
|
120
|
-
shade:
|
|
181
|
+
shade: $color-property,
|
|
121
182
|
),
|
|
122
183
|
)
|
|
123
184
|
);
|
|
@@ -131,8 +192,8 @@ $default-theme-map: ();
|
|
|
131
192
|
);
|
|
132
193
|
}
|
|
133
194
|
|
|
134
|
-
|
|
135
|
-
|
|
195
|
+
$-theme-map: map.merge(
|
|
196
|
+
$-theme-map,
|
|
136
197
|
(
|
|
137
198
|
$theme: $theme-map,
|
|
138
199
|
)
|
|
@@ -140,4 +201,13 @@ $default-theme-map: ();
|
|
|
140
201
|
}
|
|
141
202
|
|
|
142
203
|
$custom-theme-map: () !default;
|
|
143
|
-
$theme-map:
|
|
204
|
+
$theme-map: () !default;
|
|
205
|
+
|
|
206
|
+
// @todo remove this once $custom-theme-map is removed
|
|
207
|
+
@if $custom-theme-map != () {
|
|
208
|
+
@warn "`$custom-theme-map` is deprecated and will be removed in a future release of Graupl. Use `$theme-map` instead.";
|
|
209
|
+
|
|
210
|
+
$theme-map: map.deep-merge($theme-map, $custom-theme-map);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
$theme-map: map.deep-merge($-theme-map, $theme-map);
|
|
@@ -15,14 +15,24 @@
|
|
|
15
15
|
// Generate the default colour properties.
|
|
16
16
|
@each $color, $map in defaults.$colors {
|
|
17
17
|
@each $shade, $value in $map {
|
|
18
|
-
|
|
18
|
+
// Handle _default shade vs proper shade mappings.
|
|
19
|
+
@if $shade == "_default" {
|
|
20
|
+
--#{root-defaults.$prefix}#{$color}: #{$value};
|
|
21
|
+
} @else {
|
|
22
|
+
--#{root-defaults.$prefix}#{$color}--#{$shade}: #{$value};
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
// Generate the active theme properties.
|
|
23
28
|
@each $color, $map in map.get($themes, defaults.$default-theme) {
|
|
24
29
|
@each $shade, $value in $map {
|
|
25
|
-
|
|
30
|
+
// Handle _default shade vs proper shade mappings.
|
|
31
|
+
@if $shade == "_default" {
|
|
32
|
+
--#{root-defaults.$prefix}theme-active--#{$color}: #{$value};
|
|
33
|
+
} @else {
|
|
34
|
+
--#{root-defaults.$prefix}theme-active--#{$color}--#{$shade}: #{$value};
|
|
35
|
+
}
|
|
26
36
|
}
|
|
27
37
|
}
|
|
28
38
|
}
|
|
@@ -32,7 +42,12 @@
|
|
|
32
42
|
@include theme.theme($theme-name) {
|
|
33
43
|
@each $color, $map in $theme {
|
|
34
44
|
@each $shade, $value in $map {
|
|
35
|
-
|
|
45
|
+
// Handle _default shade vs proper shade mappings.
|
|
46
|
+
@if $shade == "_default" {
|
|
47
|
+
--#{root-defaults.$prefix}theme-active--#{$color}: #{$value};
|
|
48
|
+
} @else {
|
|
49
|
+
--#{root-defaults.$prefix}theme-active--#{$color}--#{$shade}: #{$value};
|
|
50
|
+
}
|
|
36
51
|
}
|
|
37
52
|
}
|
|
38
53
|
|
|
@@ -16,11 +16,18 @@ $colors: ();
|
|
|
16
16
|
$color-map: ();
|
|
17
17
|
|
|
18
18
|
@each $shade, $value in $map {
|
|
19
|
+
$color-property: "";
|
|
20
|
+
|
|
19
21
|
// Set the custom prop name and fallback value.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
$value
|
|
23
|
-
|
|
22
|
+
// Handle _default shade vs proper shade mappings.
|
|
23
|
+
@if $shade == "_default" {
|
|
24
|
+
$color-property: var(--#{root-defaults.$prefix}#{$color}, $value);
|
|
25
|
+
} @else {
|
|
26
|
+
$color-property: var(
|
|
27
|
+
--#{root-defaults.$prefix}#{$color}--#{$shade},
|
|
28
|
+
$value
|
|
29
|
+
);
|
|
30
|
+
}
|
|
24
31
|
|
|
25
32
|
// Add the custom prop to the map.
|
|
26
33
|
$color-map: map.merge(
|
|
@@ -52,10 +59,22 @@ $themes: (
|
|
|
52
59
|
$color-map: ();
|
|
53
60
|
|
|
54
61
|
@each $shade, $value in $map {
|
|
55
|
-
$color-property:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
$color-property: "";
|
|
63
|
+
|
|
64
|
+
// Set the custom prop name and fallback value.
|
|
65
|
+
// Handle _default shade vs proper shade mappings.
|
|
66
|
+
@if $shade == "_default" {
|
|
67
|
+
$color-property: var(
|
|
68
|
+
--#{root-defaults.$prefix}theme--#{$theme-name}--#{$color-name},
|
|
69
|
+
#{map.get($colors, map.get($value, color), map.get($value, shade))}
|
|
70
|
+
);
|
|
71
|
+
} @else {
|
|
72
|
+
$color-property: var(
|
|
73
|
+
--#{root-defaults.$prefix}theme-#{$theme-name}--#{$color-name}--#{$shade},
|
|
74
|
+
#{map.get($colors, map.get($value, color), map.get($value, shade))}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
59
78
|
$color-map: map.merge(
|
|
60
79
|
$color-map,
|
|
61
80
|
(
|
|
@@ -81,33 +100,47 @@ $themes: (
|
|
|
81
100
|
}
|
|
82
101
|
|
|
83
102
|
// Generate the active theme properties.
|
|
84
|
-
@
|
|
85
|
-
$color-map
|
|
103
|
+
@if map.has-key($themes, defaults.$default-theme) {
|
|
104
|
+
@each $color-name, $map in map.get($themes, defaults.$default-theme) {
|
|
105
|
+
$color-map: ();
|
|
86
106
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
107
|
+
@each $shade, $value in $map {
|
|
108
|
+
$color-property: "";
|
|
109
|
+
|
|
110
|
+
// Set the custom prop name and fallback value.
|
|
111
|
+
// Handle _default shade vs proper shade mappings.
|
|
112
|
+
@if $shade == "_default" {
|
|
113
|
+
$color-property: var(
|
|
114
|
+
--#{root-defaults.$prefix}theme-active--#{$color-name},
|
|
115
|
+
#{$value}
|
|
116
|
+
);
|
|
117
|
+
} @else {
|
|
118
|
+
$color-property: var(
|
|
119
|
+
--#{root-defaults.$prefix}theme-active--#{$color-name}--#{$shade},
|
|
120
|
+
#{$value}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
$color-map: map.merge(
|
|
125
|
+
$color-map,
|
|
126
|
+
(
|
|
127
|
+
$shade: $color-property,
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
$themes: map.merge(
|
|
133
|
+
$themes,
|
|
94
134
|
(
|
|
95
|
-
|
|
135
|
+
active: map.merge(
|
|
136
|
+
map.get($themes, active),
|
|
137
|
+
(
|
|
138
|
+
$color-name: $color-map,
|
|
139
|
+
)
|
|
140
|
+
),
|
|
96
141
|
)
|
|
97
142
|
);
|
|
98
143
|
}
|
|
99
|
-
|
|
100
|
-
$themes: map.merge(
|
|
101
|
-
$themes,
|
|
102
|
-
(
|
|
103
|
-
active: map.merge(
|
|
104
|
-
map.get($themes, active),
|
|
105
|
-
(
|
|
106
|
-
$color-name: $color-map,
|
|
107
|
-
)
|
|
108
|
-
),
|
|
109
|
-
)
|
|
110
|
-
);
|
|
111
144
|
}
|
|
112
145
|
|
|
113
146
|
// Colour properties.
|
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
// They should not be used to define direct property values (i.e. font-size, color, etc.).
|
|
7
7
|
// Those should be defined as custom properties in the `_variables.scss` file.
|
|
8
8
|
|
|
9
|
+
@use "../../defaults" as root-defaults;
|
|
9
10
|
@use "sass:map";
|
|
10
11
|
|
|
11
12
|
// font properties.
|
|
13
|
+
$generate-base-font-sizes: root-defaults.$generate-base-font-sizes !default;
|
|
14
|
+
$generate-base-font-weights: root-defaults.$generate-base-font-weights !default;
|
|
12
15
|
$font-size-base: 1rem !default;
|
|
13
16
|
$root-font-size: clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem) !default;
|
|
14
17
|
$line-height: 1.2em !default;
|
|
@@ -16,7 +19,7 @@ $line-height: 1.2em !default;
|
|
|
16
19
|
// Multipliers for font sizes.
|
|
17
20
|
// This uses a minor third scale.
|
|
18
21
|
// See: https://typescale.com/?size=16&scale=1.250&text=A%20Visual%20Type%20Scale&font=Lato&fontweight=400&bodyfont=body_font_default&bodyfontweight=400&lineheight=1.75&backgroundcolor=%23ffffff&fontcolor=%23000000
|
|
19
|
-
|
|
22
|
+
$-font-size-multipliers: (
|
|
20
23
|
xs: 0.694,
|
|
21
24
|
sm: 0.833,
|
|
22
25
|
base: 1,
|
|
@@ -28,19 +31,46 @@ $base-font-size-multipliers: (
|
|
|
28
31
|
5xl: 2.986,
|
|
29
32
|
);
|
|
30
33
|
$custom-font-size-multipliers: () !default;
|
|
31
|
-
$font-size-multipliers:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
34
|
+
$font-size-multipliers: () !default;
|
|
35
|
+
|
|
36
|
+
// @todo remove this once $custom-font-size-multipliers is removed
|
|
37
|
+
@if $custom-font-size-multipliers != () {
|
|
38
|
+
@warn "`$custom-font-size-multipliers` is deprecated and will be removed in a future release of Graupl. Use `$font-size-multipliers` instead.";
|
|
39
|
+
|
|
40
|
+
$font-size-multipliers: map.merge(
|
|
41
|
+
$font-size-multipliers,
|
|
42
|
+
$custom-font-size-multipliers
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Merge the font size multipliers with the default ones.
|
|
47
|
+
@if $generate-base-font-sizes {
|
|
48
|
+
$font-size-multipliers: map.merge(
|
|
49
|
+
$-font-size-multipliers,
|
|
50
|
+
$font-size-multipliers
|
|
51
|
+
);
|
|
52
|
+
}
|
|
35
53
|
|
|
36
54
|
// Weights.
|
|
37
|
-
|
|
55
|
+
$-font-weights: (
|
|
38
56
|
light: 300,
|
|
39
57
|
normal: 400,
|
|
40
58
|
bold: 700,
|
|
41
59
|
);
|
|
42
60
|
$custom-font-weights: () !default;
|
|
43
|
-
$font-weights:
|
|
61
|
+
$font-weights: () !default;
|
|
62
|
+
|
|
63
|
+
// @todo remove this once $custom-font-weights is removed
|
|
64
|
+
@if $custom-font-weights != () {
|
|
65
|
+
@warn "`$custom-font-weights` is deprecated and will be removed in a future release of Graupl. Use `$font-weights` instead.";
|
|
66
|
+
|
|
67
|
+
$font-weights: map.merge($font-weights, $custom-font-weights);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Merge the custom font weights with the default ones.
|
|
71
|
+
@if $generate-base-font-weights {
|
|
72
|
+
$font-weights: map.merge($-font-weights, $font-weights);
|
|
73
|
+
}
|
|
44
74
|
|
|
45
75
|
/* stylelint-disable-next-line scss/dollar-variable-colon-space-after */
|
|
46
76
|
$root-font-family:
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// Utility modifiers.
|
|
13
13
|
$selector-base: root-defaults.$utility-selector-base !default;
|
|
14
14
|
$use-important: root-defaults.$use-important !default;
|
|
15
|
+
$generate-base-utilities: root-defaults.$generate-base-utilities !default;
|
|
15
16
|
$screen-aware: false !default;
|
|
16
17
|
$theme-aware: false !default;
|
|
17
18
|
$state-aware: false !default;
|
|
@@ -33,9 +34,9 @@ $container-aware-selector-prefix: root-defaults.$utility-container-aware-selecto
|
|
|
33
34
|
// Remember to replace references like [_template], or other placeholder content with appropriate descriptions!
|
|
34
35
|
|
|
35
36
|
$template-selector-prefix: "template-" !default;
|
|
36
|
-
|
|
37
|
-
$
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
$
|
|
41
|
-
|
|
37
|
+
$-template-properties: ();
|
|
38
|
+
$template-properties: () !default;
|
|
39
|
+
|
|
40
|
+
@if $generate-base-utilities {
|
|
41
|
+
$template-properties: map.merge($-template-properties, $template-properties);
|
|
42
|
+
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// The following variables control the generated classes:
|
|
12
12
|
// - `$selector-base`: The base selector for the utility classes.
|
|
13
13
|
// - `$use-important`: A flag to determine if the `!important` flag should be added to the utility classes.
|
|
14
|
+
// - `$generate-base-utilities`: A flag to determine if the base utility classes should be generated.
|
|
14
15
|
// - `$screen-aware`: A flag to generate screen-aware utility classes.
|
|
15
16
|
// - `$theme-aware`: A flag to generate theme-aware utility classes.
|
|
16
17
|
// - `$state-aware`: A flag to generate state-aware utility classes.
|
|
@@ -24,8 +25,7 @@
|
|
|
24
25
|
// - `$state-aware-selector-prefix`: The prefix for state-aware utility classes.
|
|
25
26
|
// - `$container-aware-selector-prefix`: The prefix for container-aware utility classes.
|
|
26
27
|
// - `$template-selector-prefix`: The prefix for the utility classes.
|
|
27
|
-
// - `$
|
|
28
|
-
// - `$custom-template-properties`: The custom properties and values for the template utility classes.
|
|
28
|
+
// - `$custom-template-properties`: [DEPRECATED] The custom properties and values for the template utility classes.
|
|
29
29
|
// - `$template-properties`: The merged properties and values for the template utility classes.
|
|
30
30
|
//
|
|
31
31
|
// Generating responsive utility classes can be done by setting `$screen-aware`, `$theme-aware`, or `$state-aware` to `true`.
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// Utility modifiers.
|
|
13
13
|
$selector-base: root-defaults.$utility-selector-base !default;
|
|
14
14
|
$use-important: root-defaults.$use-important !default;
|
|
15
|
+
$generate-base-utilities: root-defaults.$generate-base-utilities !default;
|
|
15
16
|
$screen-aware: false !default;
|
|
16
17
|
$theme-aware: false !default;
|
|
17
18
|
$state-aware: false !default;
|
|
@@ -27,7 +28,7 @@ $container-aware-selector-prefix: root-defaults.$utility-container-aware-selecto
|
|
|
27
28
|
|
|
28
29
|
// Align content properties.
|
|
29
30
|
$align-content-selector-prefix: "align-content-" !default;
|
|
30
|
-
|
|
31
|
+
$-align-content-properties: (
|
|
31
32
|
normal: normal,
|
|
32
33
|
start: flex-start,
|
|
33
34
|
end: flex-end,
|
|
@@ -39,14 +40,21 @@ $base-align-content-properties: (
|
|
|
39
40
|
stretch: stretch,
|
|
40
41
|
);
|
|
41
42
|
$custom-align-content-properties: () !default;
|
|
42
|
-
$align-content-properties:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
)
|
|
43
|
+
$align-content-properties: () !default;
|
|
44
|
+
|
|
45
|
+
// @todo remove this once $custom-align-content-properties is removed
|
|
46
|
+
@if $custom-align-content-properties != () {
|
|
47
|
+
@warn "`$custom-align-content-properties` is deprecated and will be removed in a future release of Graupl. Use `$align-content-properties` instead.";
|
|
48
|
+
|
|
49
|
+
$align-content-properties: map.merge(
|
|
50
|
+
$align-content-properties,
|
|
51
|
+
$custom-align-content-properties
|
|
52
|
+
);
|
|
53
|
+
}
|
|
46
54
|
|
|
47
55
|
// Align items properties.
|
|
48
56
|
$align-items-selector-prefix: "align-items-" !default;
|
|
49
|
-
|
|
57
|
+
$-align-items-properties: (
|
|
50
58
|
start: start,
|
|
51
59
|
end: end,
|
|
52
60
|
center: center,
|
|
@@ -54,14 +62,21 @@ $base-align-items-properties: (
|
|
|
54
62
|
stretch: stretch,
|
|
55
63
|
);
|
|
56
64
|
$custom-align-items-properties: () !default;
|
|
57
|
-
$align-items-properties:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)
|
|
65
|
+
$align-items-properties: () !default;
|
|
66
|
+
|
|
67
|
+
// @todo remove this once $custom-align-items-properties is removed
|
|
68
|
+
@if $custom-align-items-properties != () {
|
|
69
|
+
@warn "`$custom-align-items-properties` is deprecated and will be removed in a future release of Graupl. Use `$align-items-properties` instead.";
|
|
70
|
+
|
|
71
|
+
$align-items-properties: map.merge(
|
|
72
|
+
$align-items-properties,
|
|
73
|
+
$custom-align-items-properties
|
|
74
|
+
);
|
|
75
|
+
}
|
|
61
76
|
|
|
62
77
|
// Align self properties.
|
|
63
78
|
$align-self-selector-prefix: "align-self-" !default;
|
|
64
|
-
|
|
79
|
+
$-align-self-properties: (
|
|
65
80
|
auto: auto,
|
|
66
81
|
start: start,
|
|
67
82
|
end: end,
|
|
@@ -70,7 +85,30 @@ $base-align-self-properties: (
|
|
|
70
85
|
stretch: stretch,
|
|
71
86
|
);
|
|
72
87
|
$custom-align-self-properties: () !default;
|
|
73
|
-
$align-self-properties:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
)
|
|
88
|
+
$align-self-properties: () !default;
|
|
89
|
+
|
|
90
|
+
// @todo remove this once $custom-align-self-properties is removed
|
|
91
|
+
@if $custom-align-self-properties != () {
|
|
92
|
+
@warn "`$custom-align-self-properties` is deprecated and will be removed in a future release of Graupl. Use `$align-self-properties` instead.";
|
|
93
|
+
|
|
94
|
+
$align-self-properties: map.merge(
|
|
95
|
+
$align-self-properties,
|
|
96
|
+
$custom-align-self-properties
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Merge custom properties with base properties if generating base utilities.
|
|
101
|
+
@if $generate-base-utilities {
|
|
102
|
+
$align-content-properties: map.merge(
|
|
103
|
+
$-align-content-properties,
|
|
104
|
+
$align-content-properties
|
|
105
|
+
);
|
|
106
|
+
$align-items-properties: map.merge(
|
|
107
|
+
$-align-items-properties,
|
|
108
|
+
$align-items-properties
|
|
109
|
+
);
|
|
110
|
+
$align-self-properties: map.merge(
|
|
111
|
+
$-align-self-properties,
|
|
112
|
+
$align-self-properties
|
|
113
|
+
);
|
|
114
|
+
}
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
// The following variables control the generated classes:
|
|
31
31
|
// - `$selector-base`: The base selector for the utility classes.
|
|
32
32
|
// - `$use-important`: A flag to determine if the `!important` flag should be added to the utility classes.
|
|
33
|
+
// - `$generate-base-utilities`: A flag to determine if the base utility classes should be generated.
|
|
33
34
|
// - `$screen-aware`: A flag to generate screen-aware utility classes.
|
|
34
35
|
// - `$theme-aware`: A flag to generate theme-aware utility classes.
|
|
35
36
|
// - `$state-aware`: A flag to generate state-aware utility classes.
|
|
@@ -43,16 +44,13 @@
|
|
|
43
44
|
// - `$state-aware-selector-prefix`: The prefix for state-aware utility classes.
|
|
44
45
|
// - `$container-aware-selector-prefix`: The prefix for container-aware utility classes.
|
|
45
46
|
// - `$align-content-selector-prefix`: The prefix for the align content utility classes.
|
|
46
|
-
// - `$
|
|
47
|
-
// - `$custom-align-content-properties`: The custom properties and values for the align content utility classes.
|
|
47
|
+
// - `$custom-align-content-properties`: [DEPRECATED] The custom properties and values for the align content utility classes.
|
|
48
48
|
// - `$align-content-properties`: The combined properties and values for the align content utility classes.
|
|
49
49
|
// - `$align-items-selector-prefix`: The prefix for the align items utility classes.
|
|
50
|
-
// - `$
|
|
51
|
-
// - `$custom-align-items-properties`: The custom properties and values for the align items utility classes.
|
|
50
|
+
// - `$custom-align-items-properties`: [DEPRECATED] The custom properties and values for the align items utility classes.
|
|
52
51
|
// - `$align-items-properties`: The combined properties and values for the align items utility classes.
|
|
53
52
|
// - `$align-self-selector-prefix`: The prefix for the align self utility classes.
|
|
54
|
-
// - `$
|
|
55
|
-
// - `$custom-align-self-properties`: The custom properties and values for the align self utility classes.
|
|
53
|
+
// - `$custom-align-self-properties`: [DEPRECATED] The custom properties and values for the align self utility classes.
|
|
56
54
|
// - `$align-self-properties`: The combined properties and values for the align self utility classes.
|
|
57
55
|
//
|
|
58
56
|
// Generating responsive utility classes can be done by setting `$screen-aware`, `$theme-aware`, or `$state-aware` to `true`.
|