@graupl/graupl 1.0.0-alpha.1 → 1.0.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/CHANGELOG.md +44 -0
- package/dist/base/form/form.css +1 -77
- package/dist/base/form/form.css.map +1 -1
- package/dist/base/link/link.css +1 -25
- package/dist/base/link/link.css.map +1 -1
- package/dist/component/button/button.css +1 -61
- package/dist/component/button/button.css.map +1 -1
- package/dist/graupl.css +1 -284
- package/dist/graupl.css.map +1 -1
- package/dist/layout/columns/columns.css +1 -40
- package/dist/layout/columns/columns.css.map +1 -1
- package/dist/layout/container/container.css +1 -37
- package/dist/layout/container/container.css.map +1 -1
- package/dist/state/focus/focus.css +1 -9
- package/dist/state/focus/focus.css.map +1 -1
- package/dist/theme/theme.css +1 -41
- package/dist/theme/theme.css.map +1 -1
- package/dist/utilities/background/background.css +1 -0
- package/dist/utilities/colors/colors.css +2 -0
- package/dist/utilities/colors/colors.css.map +1 -0
- package/docs/.vitepress/config.js +41 -1
- package/docs/.vitepress/theme/custom.scss +29 -29
- package/docs/compiling-graupl.md +56 -0
- package/docs/introduction.md +5 -0
- package/index.html +11 -2
- package/package.json +27 -1
- package/postcss.config.cjs +1 -1
- package/scss/_defaults.scss +3 -0
- package/scss/_index.scss +14 -0
- package/scss/_init.scss +3 -0
- package/scss/base/form/_index.scss +12 -0
- package/scss/base/form/_variables.scss +8 -8
- package/scss/base/link/_variables.scss +5 -8
- package/scss/component/button/_defaults.scss +2 -0
- package/scss/component/button/_index.scss +47 -19
- package/scss/component/button/_variables.scss +36 -10
- package/scss/functions/_important.scss +11 -0
- package/scss/functions/_theme.scss +11 -0
- package/scss/graupl.scss +1 -5
- package/scss/layout/columns/_index.scss +1 -1
- package/scss/state/focus/_variables.scss +3 -3
- package/scss/theme/_defaults.scss +48 -31
- package/scss/theme/_index.scss +13 -28
- package/scss/theme/_variables.scss +94 -280
- package/scss/utilities/_index.scss +3 -0
- package/scss/utilities/colors/_defaults.scss +7 -0
- package/scss/utilities/colors/_index.scss +22 -0
- package/scss/utilities/colors/_variables.scss +3 -0
- package/scss/utilities/colors/colors.scss +3 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
3
|
@use "../../variables" as base;
|
|
4
|
-
@use "../../theme/variables" as theme;
|
|
5
4
|
@use "defaults";
|
|
5
|
+
@use "../../functions/theme";
|
|
6
6
|
|
|
7
7
|
$focus-width: var(--#{defaults.$prefix}-focus-width, #{base.$border-width});
|
|
8
8
|
$focus-outline-color: var(
|
|
9
9
|
--#{defaults.$prefix}-focus-outline-color,
|
|
10
|
-
#{theme
|
|
10
|
+
#{theme.get(primary, 900)}
|
|
11
11
|
);
|
|
12
12
|
$focus-outline-width: var(
|
|
13
13
|
--#{defaults.$prefix}-focus-outline-width,
|
|
@@ -23,7 +23,7 @@ $focus-outline-offset: var(
|
|
|
23
23
|
);
|
|
24
24
|
$focus-box-shadow-color: var(
|
|
25
25
|
--#{defaults.$prefix}-focus-box-shadow-color,
|
|
26
|
-
#{theme
|
|
26
|
+
#{theme.get(primary, 100)}
|
|
27
27
|
);
|
|
28
28
|
$focus-box-shadow-style: var(
|
|
29
29
|
--#{defaults.$prefix}-focus-box-shadow-style,
|
|
@@ -8,38 +8,55 @@
|
|
|
8
8
|
@forward "../defaults";
|
|
9
9
|
|
|
10
10
|
// Colours.
|
|
11
|
-
$
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
$default-colors: (
|
|
12
|
+
primary: (
|
|
13
|
+
100: hsl(219deg 100% 95%),
|
|
14
|
+
200: hsl(219deg 90% 80%),
|
|
15
|
+
300: hsl(219deg 80% 65%),
|
|
16
|
+
400: hsl(219deg 75% 55%),
|
|
17
|
+
500: hsl(219deg 75% 50%),
|
|
18
|
+
600: hsl(219deg 75% 45%),
|
|
19
|
+
700: hsl(219deg 80% 35%),
|
|
20
|
+
800: hsl(219deg 90% 20%),
|
|
21
|
+
900: hsl(219deg 100% 10%),
|
|
22
|
+
),
|
|
23
|
+
secondary: (
|
|
24
|
+
100: hsl(235deg 40% 95%),
|
|
25
|
+
200: hsl(235deg 30% 80%),
|
|
26
|
+
300: hsl(235deg 20% 65%),
|
|
27
|
+
400: hsl(235deg 15% 55%),
|
|
28
|
+
500: hsl(235deg 15% 50%),
|
|
29
|
+
600: hsl(235deg 15% 45%),
|
|
30
|
+
700: hsl(235deg 20% 35%),
|
|
31
|
+
800: hsl(235deg 30% 20%),
|
|
32
|
+
900: hsl(235deg 40% 10%),
|
|
33
|
+
),
|
|
34
|
+
tertiary: (
|
|
35
|
+
100: hsl(340deg 85% 95%),
|
|
36
|
+
200: hsl(340deg 75% 80%),
|
|
37
|
+
300: hsl(340deg 65% 65%),
|
|
38
|
+
400: hsl(340deg 60% 55%),
|
|
39
|
+
500: hsl(340deg 60% 50%),
|
|
40
|
+
600: hsl(340deg 60% 45%),
|
|
41
|
+
700: hsl(340deg 65% 35%),
|
|
42
|
+
800: hsl(340deg 75% 20%),
|
|
43
|
+
900: hsl(340deg 85% 10%),
|
|
44
|
+
),
|
|
21
45
|
) !default;
|
|
22
|
-
$
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
300: hsl(340deg 65% 65%),
|
|
37
|
-
400: hsl(340deg 60% 55%),
|
|
38
|
-
500: hsl(340deg 60% 50%),
|
|
39
|
-
600: hsl(340deg 60% 45%),
|
|
40
|
-
700: hsl(340deg 65% 35%),
|
|
41
|
-
800: hsl(340deg 75% 20%),
|
|
42
|
-
900: hsl(340deg 85% 10%),
|
|
46
|
+
$custom-colors: () !default;
|
|
47
|
+
$colors: map.merge($default-colors, $custom-colors) !default;
|
|
48
|
+
|
|
49
|
+
// A map for reversing the shade values of the dark theme.
|
|
50
|
+
$dark-map: (
|
|
51
|
+
100: 900,
|
|
52
|
+
200: 800,
|
|
53
|
+
300: 700,
|
|
54
|
+
400: 600,
|
|
55
|
+
500: 500,
|
|
56
|
+
600: 400,
|
|
57
|
+
700: 300,
|
|
58
|
+
800: 200,
|
|
59
|
+
900: 100,
|
|
43
60
|
) !default;
|
|
44
61
|
|
|
45
62
|
// Font properties.
|
package/scss/theme/_index.scss
CHANGED
|
@@ -4,49 +4,34 @@
|
|
|
4
4
|
@use "../mixins/layer" as *;
|
|
5
5
|
@use "defaults";
|
|
6
6
|
@use "sass:map";
|
|
7
|
+
@use "../functions/theme";
|
|
7
8
|
|
|
8
9
|
@include layer(theme) {
|
|
9
10
|
:root {
|
|
10
|
-
background:
|
|
11
|
-
color:
|
|
11
|
+
background: theme.get(primary, 100);
|
|
12
|
+
color: theme.get(primary, 900);
|
|
12
13
|
font-family: $font-family;
|
|
13
14
|
font-size: $font-size;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
// Set the active theme for dark mode.
|
|
17
18
|
.dark-mode {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
--#{defaults.$prefix}-theme-active--secondary--light: #{$theme-dark--secondary--light};
|
|
24
|
-
--#{defaults.$prefix}-theme-active--tertiary: #{$theme-dark--tertiary};
|
|
25
|
-
--#{defaults.$prefix}-theme-active--tertiary--dark: #{$theme-dark--tertiary--dark};
|
|
26
|
-
--#{defaults.$prefix}-theme-active--tertiary--light: #{$theme-dark--tertiary--light};
|
|
27
|
-
--#{defaults.$prefix}-theme-active--light: #{$theme-dark--light};
|
|
28
|
-
--#{defaults.$prefix}-theme-active--dark: #{$theme-dark--dark};
|
|
29
|
-
--#{defaults.$prefix}-theme-active--shade--light: #{$theme-dark--shade--light};
|
|
30
|
-
--#{defaults.$prefix}-theme-active--shade--dark: #{$theme-dark--shade--dark};
|
|
19
|
+
@each $color, $map in $theme-dark {
|
|
20
|
+
@each $shade, $value in $map {
|
|
21
|
+
--#{defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
31
24
|
|
|
32
25
|
color-scheme: dark;
|
|
33
26
|
}
|
|
34
27
|
|
|
35
28
|
// Set the active theme for light mode.
|
|
36
29
|
.light-mode {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
--#{defaults.$prefix}-theme-active--secondary--light: #{$theme-light--secondary--light};
|
|
43
|
-
--#{defaults.$prefix}-theme-active--tertiary: #{$theme-light--tertiary};
|
|
44
|
-
--#{defaults.$prefix}-theme-active--tertiary--dark: #{$theme-light--tertiary--dark};
|
|
45
|
-
--#{defaults.$prefix}-theme-active--tertiary--light: #{$theme-light--tertiary--light};
|
|
46
|
-
--#{defaults.$prefix}-theme-active--light: #{$theme-light--light};
|
|
47
|
-
--#{defaults.$prefix}-theme-active--dark: #{$theme-light--dark};
|
|
48
|
-
--#{defaults.$prefix}-theme-active--shade--light: #{$theme-light--shade--light};
|
|
49
|
-
--#{defaults.$prefix}-theme-active--shade--dark: #{$theme-light--shade--dark};
|
|
30
|
+
@each $color, $map in $theme-light {
|
|
31
|
+
@each $shade, $value in $map {
|
|
32
|
+
--#{defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
50
35
|
|
|
51
36
|
color-scheme: light;
|
|
52
37
|
}
|
|
@@ -3,294 +3,108 @@
|
|
|
3
3
|
@use "defaults";
|
|
4
4
|
@use "sass:map";
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
$
|
|
8
|
-
100:
|
|
9
|
-
var(--#{defaults.$prefix}-primary--100, #{map.get(defaults.$primary, 100)}),
|
|
10
|
-
200:
|
|
11
|
-
var(--#{defaults.$prefix}-primary--200, #{map.get(defaults.$primary, 200)}),
|
|
12
|
-
300:
|
|
13
|
-
var(--#{defaults.$prefix}-primary--300, #{map.get(defaults.$primary, 300)}),
|
|
14
|
-
400:
|
|
15
|
-
var(--#{defaults.$prefix}-primary--400, #{map.get(defaults.$primary, 400)}),
|
|
16
|
-
500:
|
|
17
|
-
var(--#{defaults.$prefix}-primary--500, #{map.get(defaults.$primary, 500)}),
|
|
18
|
-
600:
|
|
19
|
-
var(--#{defaults.$prefix}-primary--600, #{map.get(defaults.$primary, 600)}),
|
|
20
|
-
700:
|
|
21
|
-
var(--#{defaults.$prefix}-primary--700, #{map.get(defaults.$primary, 700)}),
|
|
22
|
-
800:
|
|
23
|
-
var(--#{defaults.$prefix}-primary--800, #{map.get(defaults.$primary, 800)}),
|
|
24
|
-
900:
|
|
25
|
-
var(--#{defaults.$prefix}-primary--900, #{map.get(defaults.$primary, 900)}),
|
|
26
|
-
);
|
|
6
|
+
// A colour map of base colours and their shades.
|
|
7
|
+
$colors: ();
|
|
27
8
|
|
|
28
|
-
//
|
|
29
|
-
$
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
--#{defaults.$prefix}-secondary--100,
|
|
33
|
-
#{map.get(defaults.$secondary, 100)}
|
|
34
|
-
),
|
|
35
|
-
200:
|
|
36
|
-
var(
|
|
37
|
-
--#{defaults.$prefix}-secondary--200,
|
|
38
|
-
#{map.get(defaults.$secondary, 200)}
|
|
39
|
-
),
|
|
40
|
-
300:
|
|
41
|
-
var(
|
|
42
|
-
--#{defaults.$prefix}-secondary--300,
|
|
43
|
-
#{map.get(defaults.$secondary, 300)}
|
|
44
|
-
),
|
|
45
|
-
400:
|
|
46
|
-
var(
|
|
47
|
-
--#{defaults.$prefix}-secondary--400,
|
|
48
|
-
#{map.get(defaults.$secondary, 400)}
|
|
49
|
-
),
|
|
50
|
-
500:
|
|
51
|
-
var(
|
|
52
|
-
--#{defaults.$prefix}-secondary--500,
|
|
53
|
-
#{map.get(defaults.$secondary, 500)}
|
|
54
|
-
),
|
|
55
|
-
600:
|
|
56
|
-
var(
|
|
57
|
-
--#{defaults.$prefix}-secondary--600,
|
|
58
|
-
#{map.get(defaults.$secondary, 600)}
|
|
59
|
-
),
|
|
60
|
-
700:
|
|
61
|
-
var(
|
|
62
|
-
--#{defaults.$prefix}-secondary--700,
|
|
63
|
-
#{map.get(defaults.$secondary, 700)}
|
|
64
|
-
),
|
|
65
|
-
800:
|
|
66
|
-
var(
|
|
67
|
-
--#{defaults.$prefix}-secondary--800,
|
|
68
|
-
#{map.get(defaults.$secondary, 800)}
|
|
69
|
-
),
|
|
70
|
-
900:
|
|
71
|
-
var(
|
|
72
|
-
--#{defaults.$prefix}-secondary--900,
|
|
73
|
-
#{map.get(defaults.$secondary, 900)}
|
|
74
|
-
),
|
|
75
|
-
);
|
|
9
|
+
// Create a map for each colour.
|
|
10
|
+
@each $color, $map in defaults.$colors {
|
|
11
|
+
// A map for the current colour.
|
|
12
|
+
$color-map: ();
|
|
76
13
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var(
|
|
81
|
-
--#{defaults.$prefix}-tertiary--100,
|
|
82
|
-
#{map.get(defaults.$tertiary, 100)}
|
|
83
|
-
),
|
|
84
|
-
200:
|
|
85
|
-
var(
|
|
86
|
-
--#{defaults.$prefix}-tertiary--200,
|
|
87
|
-
#{map.get(defaults.$tertiary, 200)}
|
|
88
|
-
),
|
|
89
|
-
300:
|
|
90
|
-
var(
|
|
91
|
-
--#{defaults.$prefix}-tertiary--300,
|
|
92
|
-
#{map.get(defaults.$tertiary, 300)}
|
|
93
|
-
),
|
|
94
|
-
400:
|
|
95
|
-
var(
|
|
96
|
-
--#{defaults.$prefix}-tertiary--400,
|
|
97
|
-
#{map.get(defaults.$tertiary, 400)}
|
|
98
|
-
),
|
|
99
|
-
500:
|
|
100
|
-
var(
|
|
101
|
-
--#{defaults.$prefix}-tertiary--500,
|
|
102
|
-
#{map.get(defaults.$tertiary, 500)}
|
|
103
|
-
),
|
|
104
|
-
600:
|
|
105
|
-
var(
|
|
106
|
-
--#{defaults.$prefix}-tertiary--600,
|
|
107
|
-
#{map.get(defaults.$tertiary, 600)}
|
|
108
|
-
),
|
|
109
|
-
700:
|
|
110
|
-
var(
|
|
111
|
-
--#{defaults.$prefix}-tertiary--700,
|
|
112
|
-
#{map.get(defaults.$tertiary, 700)}
|
|
113
|
-
),
|
|
114
|
-
800:
|
|
115
|
-
var(
|
|
116
|
-
--#{defaults.$prefix}-tertiary--800,
|
|
117
|
-
#{map.get(defaults.$tertiary, 800)}
|
|
118
|
-
),
|
|
119
|
-
900:
|
|
120
|
-
var(
|
|
121
|
-
--#{defaults.$prefix}-tertiary--900,
|
|
122
|
-
#{map.get(defaults.$tertiary, 900)}
|
|
123
|
-
),
|
|
124
|
-
);
|
|
14
|
+
@each $shade, $value in $map {
|
|
15
|
+
// Set the custom prop name and fallback value.
|
|
16
|
+
$color-property: var(--#{defaults.$prefix}-#{$color}--#{$shade}, $value);
|
|
125
17
|
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
$
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
#{map.get($primary, 800)}
|
|
135
|
-
);
|
|
136
|
-
$theme-light--primary--light: var(
|
|
137
|
-
--#{defaults.$prefix}-theme-light--primary--light,
|
|
138
|
-
#{map.get($primary, 600)}
|
|
139
|
-
);
|
|
140
|
-
$theme-dark--primary: var(
|
|
141
|
-
--#{defaults.$prefix}-theme-dark--primary,
|
|
142
|
-
#{map.get($primary, 300)}
|
|
143
|
-
);
|
|
144
|
-
$theme-dark--primary--dark: var(
|
|
145
|
-
--#{defaults.$prefix}-theme-dark--primary--dark,
|
|
146
|
-
#{map.get($primary, 200)}
|
|
147
|
-
);
|
|
148
|
-
$theme-dark--primary--light: var(
|
|
149
|
-
--#{defaults.$prefix}-theme-dark--primary--light,
|
|
150
|
-
#{map.get($primary, 400)}
|
|
151
|
-
);
|
|
152
|
-
$theme-active--primary: var(
|
|
153
|
-
--#{defaults.$prefix}-theme-active--primary,
|
|
154
|
-
#{$theme-light--primary}
|
|
155
|
-
);
|
|
156
|
-
$theme-active--primary--dark: var(
|
|
157
|
-
--#{defaults.$prefix}-theme-active--primary--dark,
|
|
158
|
-
#{$theme-light--primary--dark}
|
|
159
|
-
);
|
|
160
|
-
$theme-active--primary--light: var(
|
|
161
|
-
--#{defaults.$prefix}-theme-active--primary--light,
|
|
162
|
-
#{$theme-light--primary--light}
|
|
163
|
-
);
|
|
18
|
+
// Add the custom prop to the map.
|
|
19
|
+
$color-map: map.merge(
|
|
20
|
+
$color-map,
|
|
21
|
+
(
|
|
22
|
+
$shade: $color-property,
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
164
26
|
|
|
165
|
-
//
|
|
166
|
-
$
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
);
|
|
174
|
-
$theme-light--secondary--light: var(
|
|
175
|
-
--#{defaults.$prefix}-theme-light--secondary--light,
|
|
176
|
-
#{map.get($secondary, 600)}
|
|
177
|
-
);
|
|
178
|
-
$theme-dark--secondary: var(
|
|
179
|
-
--#{defaults.$prefix}-theme-dark--secondary,
|
|
180
|
-
#{map.get($secondary, 300)}
|
|
181
|
-
);
|
|
182
|
-
$theme-dark--secondary--dark: var(
|
|
183
|
-
--#{defaults.$prefix}-theme-dark--secondary--dark,
|
|
184
|
-
#{map.get($secondary, 200)}
|
|
185
|
-
);
|
|
186
|
-
$theme-dark--secondary--light: var(
|
|
187
|
-
--#{defaults.$prefix}-theme-dark--secondary--light,
|
|
188
|
-
#{map.get($secondary, 400)}
|
|
189
|
-
);
|
|
190
|
-
$theme-active--secondary: var(
|
|
191
|
-
--#{defaults.$prefix}-theme-active--secondary,
|
|
192
|
-
#{$theme-light--secondary}
|
|
193
|
-
);
|
|
194
|
-
$theme-active--secondary--dark: var(
|
|
195
|
-
--#{defaults.$prefix}-theme-active--secondary--dark,
|
|
196
|
-
#{$theme-light--secondary--dark}
|
|
197
|
-
);
|
|
198
|
-
$theme-active--secondary--light: var(
|
|
199
|
-
--#{defaults.$prefix}-theme-active--secondary--light,
|
|
200
|
-
#{$theme-light--secondary--light}
|
|
201
|
-
);
|
|
27
|
+
// Merge the colour map with the existing colours.
|
|
28
|
+
$colors: map.merge(
|
|
29
|
+
$colors,
|
|
30
|
+
(
|
|
31
|
+
$color: $color-map,
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
202
35
|
|
|
203
|
-
//
|
|
204
|
-
$theme-light
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
);
|
|
208
|
-
$theme-light--tertiary--dark: var(
|
|
209
|
-
--#{defaults.$prefix}-theme-light--tertiary--dark,
|
|
210
|
-
#{map.get($tertiary, 800)}
|
|
211
|
-
);
|
|
212
|
-
$theme-light--tertiary--light: var(
|
|
213
|
-
--#{defaults.$prefix}-theme-light--tertiary--light,
|
|
214
|
-
#{map.get($tertiary, 600)}
|
|
215
|
-
);
|
|
216
|
-
$theme-dark--tertiary: var(
|
|
217
|
-
--#{defaults.$prefix}-theme-dark--tertiary,
|
|
218
|
-
#{map.get($tertiary, 300)}
|
|
219
|
-
);
|
|
220
|
-
$theme-dark--tertiary--dark: var(
|
|
221
|
-
--#{defaults.$prefix}-theme-dark--tertiary--dark,
|
|
222
|
-
#{map.get($tertiary, 200)}
|
|
223
|
-
);
|
|
224
|
-
$theme-dark--tertiary--light: var(
|
|
225
|
-
--#{defaults.$prefix}-theme-dark--tertiary--light,
|
|
226
|
-
#{map.get($tertiary, 400)}
|
|
227
|
-
);
|
|
228
|
-
$theme-active--tertiary: var(
|
|
229
|
-
--#{defaults.$prefix}-theme-active--tertiary,
|
|
230
|
-
#{$theme-light--tertiary}
|
|
231
|
-
);
|
|
232
|
-
$theme-active--tertiary--dark: var(
|
|
233
|
-
--#{defaults.$prefix}-theme-active--tertiary--dark,
|
|
234
|
-
#{$theme-light--tertiary--dark}
|
|
235
|
-
);
|
|
236
|
-
$theme-active--tertiary--light: var(
|
|
237
|
-
--#{defaults.$prefix}-theme-active--tertiary--light,
|
|
238
|
-
#{$theme-light--tertiary--light}
|
|
239
|
-
);
|
|
36
|
+
// Theme properties.
|
|
37
|
+
$theme-light: ();
|
|
38
|
+
$theme-dark: ();
|
|
39
|
+
$theme-active: ();
|
|
240
40
|
|
|
241
|
-
//
|
|
242
|
-
$
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
);
|
|
246
|
-
$
|
|
247
|
-
--#{defaults.$prefix}-theme-dark--light,
|
|
248
|
-
#{map.get($primary, 900)}
|
|
249
|
-
);
|
|
250
|
-
$theme-active--light: var(
|
|
251
|
-
--#{defaults.$prefix}-theme-active--light,
|
|
252
|
-
#{$theme-light--light}
|
|
253
|
-
);
|
|
41
|
+
// Create a map for each colour theme.
|
|
42
|
+
@each $color, $map in $colors {
|
|
43
|
+
// Maps for the current colour theme variants.
|
|
44
|
+
$light-map: ();
|
|
45
|
+
$dark-map: ();
|
|
46
|
+
$active-map: ();
|
|
254
47
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
);
|
|
260
|
-
$theme-dark--dark: var(
|
|
261
|
-
--#{defaults.$prefix}-theme-dark--dark,
|
|
262
|
-
#{map.get($primary, 100)}
|
|
263
|
-
);
|
|
264
|
-
$theme-active--dark: var(
|
|
265
|
-
--#{defaults.$prefix}-theme-active--dark,
|
|
266
|
-
#{$theme-light--dark}
|
|
267
|
-
);
|
|
48
|
+
@each $shade, $value in $map {
|
|
49
|
+
// Get the dark shade and value.
|
|
50
|
+
$dark-shade: map.get(defaults.$dark-map, $shade);
|
|
51
|
+
$dark-value: map.get($map, $dark-shade);
|
|
268
52
|
|
|
269
|
-
//
|
|
270
|
-
$
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
);
|
|
274
|
-
$
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
);
|
|
278
|
-
$
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
);
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
);
|
|
290
|
-
$
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
53
|
+
// Set the custom prop names and fallback values.
|
|
54
|
+
$light-property: var(
|
|
55
|
+
--#{defaults.$prefix}-theme-light--#{$color}--#{$shade},
|
|
56
|
+
$value
|
|
57
|
+
);
|
|
58
|
+
$dark-property: var(
|
|
59
|
+
--#{defaults.$prefix}-theme-dark--#{$color}--#{$shade},
|
|
60
|
+
$dark-value
|
|
61
|
+
);
|
|
62
|
+
$active-property: var(
|
|
63
|
+
--#{defaults.$prefix}-theme-active--#{$color}--#{$shade},
|
|
64
|
+
$light-property
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
// Add the custom props to the maps.
|
|
68
|
+
$light-map: map.merge(
|
|
69
|
+
$light-map,
|
|
70
|
+
(
|
|
71
|
+
$shade: $light-property,
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
$dark-map: map.merge(
|
|
75
|
+
$dark-map,
|
|
76
|
+
(
|
|
77
|
+
$shade: $dark-property,
|
|
78
|
+
)
|
|
79
|
+
);
|
|
80
|
+
$active-map: map.merge(
|
|
81
|
+
$active-map,
|
|
82
|
+
(
|
|
83
|
+
$shade: $active-property,
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Merge the theme maps with the existing themes.
|
|
89
|
+
$theme-light: map.merge(
|
|
90
|
+
$theme-light,
|
|
91
|
+
(
|
|
92
|
+
$color: $light-map,
|
|
93
|
+
)
|
|
94
|
+
);
|
|
95
|
+
$theme-dark: map.merge(
|
|
96
|
+
$theme-dark,
|
|
97
|
+
(
|
|
98
|
+
$color: $dark-map,
|
|
99
|
+
)
|
|
100
|
+
);
|
|
101
|
+
$theme-active: map.merge(
|
|
102
|
+
$theme-active,
|
|
103
|
+
(
|
|
104
|
+
$color: $active-map,
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
294
108
|
|
|
295
109
|
// Font properties.
|
|
296
110
|
$font-family: var(--#{defaults.$prefix}-font-family, #{defaults.$font-family});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Default values for Graupl.
|
|
2
|
+
//
|
|
3
|
+
// Generally, these should not be used directly when styling components.
|
|
4
|
+
// They are mainly used to provide default fallbacks for custom properties
|
|
5
|
+
// which can be found in the `variables.scss` file.
|
|
6
|
+
|
|
7
|
+
@forward "../../defaults";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Graupl color utilities.
|
|
2
|
+
|
|
3
|
+
@use "variables" as *;
|
|
4
|
+
@use "../../mixins/layer" as *;
|
|
5
|
+
@use "../../functions/important";
|
|
6
|
+
@use "../../theme/variables" as theme;
|
|
7
|
+
|
|
8
|
+
@include layer(utilities) {
|
|
9
|
+
@each $color, $map in theme.$theme-active {
|
|
10
|
+
@each $shade, $value in $map {
|
|
11
|
+
$name: #{$color}-#{$shade};
|
|
12
|
+
|
|
13
|
+
.background-#{$name} {
|
|
14
|
+
background: important.insert($value);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.color-#{$name} {
|
|
18
|
+
color: important.insert($value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|