@graupl/graupl 1.0.0-alpha.4 → 1.0.0-alpha.6
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 +36 -0
- package/dist/base/form/form.css +1 -1
- package/dist/base/form/form.css.map +1 -1
- package/dist/base/link/link.css.map +1 -1
- package/dist/component/button/button.css +1 -1
- package/dist/component/button/button.css.map +1 -1
- package/dist/graupl.css +1 -1
- package/dist/graupl.css.map +1 -1
- package/dist/layout/columns/columns.css +1 -1
- package/dist/layout/columns/columns.css.map +1 -1
- package/dist/layout/container/container.css +1 -1
- package/dist/layout/container/container.css.map +1 -1
- package/dist/state/focus/focus.css.map +1 -1
- package/dist/theme/color/color.css +2 -0
- package/dist/theme/color/color.css.map +1 -0
- package/dist/theme/typography/typography.css +2 -0
- package/dist/theme/typography/typography.css.map +1 -0
- package/dist/utilities/colors/colors.css.map +1 -1
- package/dist/utilities/spacing/spacing.css +2 -0
- package/dist/utilities/spacing/spacing.css.map +1 -0
- package/dist/utilities/typography/typography.css +2 -0
- package/dist/utilities/typography/typography.css.map +1 -0
- package/package.json +4 -4
- package/scss/_defaults.scss +14 -9
- package/scss/_variables.scss +10 -20
- package/scss/base/form/_defaults.scss +0 -2
- package/scss/base/form/_variables.scss +50 -39
- package/scss/base/link/_defaults.scss +0 -2
- package/scss/base/link/_variables.scss +12 -8
- package/scss/component/button/_defaults.scss +0 -2
- package/scss/component/button/_index.scss +21 -9
- package/scss/component/button/_variables.scss +48 -43
- package/scss/functions/_theme.scss +2 -2
- package/scss/layout/columns/_defaults.scss +0 -2
- package/scss/layout/columns/_index.scss +6 -9
- package/scss/layout/columns/_variables.scss +30 -7
- package/scss/layout/container/_defaults.scss +0 -2
- package/scss/layout/container/_index.scss +16 -12
- package/scss/layout/container/_variables.scss +13 -8
- package/scss/mixins/_layer.scss +2 -2
- package/scss/state/focus/_defaults.scss +0 -2
- package/scss/state/focus/_variables.scss +13 -9
- package/scss/theme/_index.scss +3 -37
- package/scss/theme/{_defaults.scss → color/_defaults.scss} +2 -16
- package/scss/theme/color/_index.scss +42 -0
- package/scss/theme/{_variables.scss → color/_variables.scss} +12 -12
- package/scss/theme/color/color.scss +3 -0
- package/scss/theme/typography/_defaults.scss +41 -0
- package/scss/theme/typography/_index.scss +111 -0
- package/scss/theme/typography/_variables.scss +224 -0
- package/scss/theme/typography/typography.scss +3 -0
- package/scss/utilities/_index.scss +2 -0
- package/scss/utilities/colors/_defaults.scss +0 -2
- package/scss/utilities/colors/_index.scss +2 -2
- package/scss/utilities/spacing/_defaults.scss +25 -0
- package/scss/utilities/spacing/_index.scss +64 -0
- package/scss/utilities/spacing/_variables.scss +3 -0
- package/scss/utilities/spacing/spacing.scss +3 -0
- package/scss/utilities/typography/_defaults.scss +5 -0
- package/scss/utilities/typography/_index.scss +92 -0
- package/scss/utilities/typography/_variables.scss +3 -0
- package/scss/utilities/typography/typography.scss +3 -0
- package/dist/theme/theme.css +0 -2
- package/dist/theme/theme.css.map +0 -1
- package/dist/utilities/background/background.css +0 -1
- package/scss/theme/theme.scss +0 -3
|
@@ -1,128 +1,133 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
|
-
@use "../../variables" as base;
|
|
4
3
|
@use "defaults";
|
|
5
|
-
@use "
|
|
4
|
+
@use "../../variables" as root-variables;
|
|
5
|
+
@use "../../defaults" as root-defaults;
|
|
6
|
+
@use "../../theme/typography/variables" as typography;
|
|
6
7
|
@use "../../functions/theme";
|
|
8
|
+
@use "sass:map";
|
|
7
9
|
|
|
8
10
|
// Button properties.
|
|
9
11
|
$button-min-width: var(
|
|
10
|
-
--#{defaults.$prefix}-button-min-width,
|
|
11
|
-
#{defaults.$interactive-min-width}
|
|
12
|
+
--#{root-defaults.$prefix}-button-min-width,
|
|
13
|
+
#{root-defaults.$interactive-min-width}
|
|
12
14
|
);
|
|
13
15
|
$button-min-height: var(
|
|
14
|
-
--#{defaults.$prefix}-button-min-height,
|
|
15
|
-
#{defaults.$interactive-min-height}
|
|
16
|
+
--#{root-defaults.$prefix}-button-min-height,
|
|
17
|
+
#{root-defaults.$interactive-min-height}
|
|
18
|
+
);
|
|
19
|
+
$button-padding-x: var(
|
|
20
|
+
--#{root-defaults.$prefix}-button-padding-x,
|
|
21
|
+
#{map.get(root-variables.$spacers, 5)}
|
|
16
22
|
);
|
|
17
|
-
$button-padding-x: var(--#{defaults.$prefix}-button-padding-x, #{base.$gap});
|
|
18
23
|
$button-padding-y: var(
|
|
19
|
-
--#{defaults.$prefix}-button-padding-y,
|
|
20
|
-
|
|
24
|
+
--#{root-defaults.$prefix}-button-padding-y,
|
|
25
|
+
#{map.get(root-variables.$spacers, 3)}
|
|
21
26
|
);
|
|
22
27
|
$button-padding: var(
|
|
23
|
-
--#{defaults.$prefix}-button-padding,
|
|
28
|
+
--#{root-defaults.$prefix}-button-padding,
|
|
24
29
|
#{$button-padding-y} #{$button-padding-x}
|
|
25
30
|
);
|
|
26
31
|
$button-font-size: var(
|
|
27
|
-
--#{defaults.$prefix}-button-font-size,
|
|
28
|
-
#{map.get(
|
|
32
|
+
--#{root-defaults.$prefix}-button-font-size,
|
|
33
|
+
#{map.get(typography.$font-sizes, base)}
|
|
29
34
|
);
|
|
30
35
|
$button-transition: var(
|
|
31
|
-
--#{defaults.$prefix}-button-transition,
|
|
32
|
-
background #{map.get(
|
|
33
|
-
color #{map.get(
|
|
34
|
-
border-color #{map.get(
|
|
35
|
-
transform #{map.get(
|
|
36
|
+
--#{root-defaults.$prefix}-button-transition,
|
|
37
|
+
background #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function},
|
|
38
|
+
color #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function},
|
|
39
|
+
border-color #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function},
|
|
40
|
+
transform #{map.get(root-variables.$transition-duration, fast)} #{root-variables.$transition-timing-function}
|
|
36
41
|
);
|
|
37
42
|
$button-transition-reduced-motion: var(
|
|
38
|
-
--#{defaults.$prefix}-button-transition-reduced-motion,
|
|
39
|
-
background #{map.get(
|
|
40
|
-
color #{map.get(
|
|
41
|
-
border-color #{map.get(
|
|
43
|
+
--#{root-defaults.$prefix}-button-transition-reduced-motion,
|
|
44
|
+
background #{map.get(root-variables.$transition-duration, none)} #{root-variables.$transition-timing-function},
|
|
45
|
+
color #{map.get(root-variables.$transition-duration, none)} #{root-variables.$transition-timing-function},
|
|
46
|
+
border-color #{map.get(root-variables.$transition-duration, none)} #{root-variables.$transition-timing-function}
|
|
42
47
|
);
|
|
43
48
|
|
|
44
49
|
// Transform properties.
|
|
45
50
|
$button-hover-transform: var(
|
|
46
|
-
--#{defaults.$prefix}-button-hover-transform,
|
|
51
|
+
--#{root-defaults.$prefix}-button-hover-transform,
|
|
47
52
|
#{defaults.$button-hover-transform}
|
|
48
53
|
);
|
|
49
54
|
$button-active-transform: var(
|
|
50
|
-
--#{defaults.$prefix}-button-active-transform,
|
|
55
|
+
--#{root-defaults.$prefix}-button-active-transform,
|
|
51
56
|
#{defaults.$button-active-transform}
|
|
52
57
|
);
|
|
53
58
|
$button-hover-transform-reduced-motion: var(
|
|
54
|
-
--#{defaults.$prefix}-button-hover-transform-reduced-motion,
|
|
59
|
+
--#{root-defaults.$prefix}-button-hover-transform-reduced-motion,
|
|
55
60
|
#{defaults.$button-hover-transform-reduced-motion}
|
|
56
61
|
);
|
|
57
62
|
$button-active-transform-reduced-motion: var(
|
|
58
|
-
--#{defaults.$prefix}-button-active-transform-reduced-motion,
|
|
63
|
+
--#{root-defaults.$prefix}-button-active-transform-reduced-motion,
|
|
59
64
|
#{defaults.$button-active-transform-reduced-motion}
|
|
60
65
|
);
|
|
61
66
|
|
|
62
67
|
// Background properties.
|
|
63
68
|
$button-background: var(
|
|
64
|
-
--#{defaults.$prefix}-button-background,
|
|
69
|
+
--#{root-defaults.$prefix}-button-background,
|
|
65
70
|
#{theme.get(primary, 100)}
|
|
66
71
|
);
|
|
67
72
|
$button-hover-background: var(
|
|
68
|
-
--#{defaults.$prefix}-button-hover-background,
|
|
73
|
+
--#{root-defaults.$prefix}-button-hover-background,
|
|
69
74
|
#{theme.get(primary, 900)}
|
|
70
75
|
);
|
|
71
76
|
$button-active-background: var(
|
|
72
|
-
--#{defaults.$prefix}-button-active-background,
|
|
77
|
+
--#{root-defaults.$prefix}-button-active-background,
|
|
73
78
|
#{theme.get(primary, 900)}
|
|
74
79
|
);
|
|
75
80
|
$button-disabled-background: var(
|
|
76
|
-
--#{defaults.$prefix}-button-disabled-background,
|
|
81
|
+
--#{root-defaults.$prefix}-button-disabled-background,
|
|
77
82
|
#{theme.get(primary, 100)}
|
|
78
83
|
);
|
|
79
84
|
|
|
80
85
|
// Text properties.
|
|
81
86
|
$button-color: var(
|
|
82
|
-
--#{defaults.$prefix}-button-color,
|
|
87
|
+
--#{root-defaults.$prefix}-button-color,
|
|
83
88
|
#{theme.get(primary, 900)}
|
|
84
89
|
);
|
|
85
90
|
$button-hover-color: var(
|
|
86
|
-
--#{defaults.$prefix}-button-hover-color,
|
|
91
|
+
--#{root-defaults.$prefix}-button-hover-color,
|
|
87
92
|
#{theme.get(primary, 100)}
|
|
88
93
|
);
|
|
89
94
|
$button-active-color: var(
|
|
90
|
-
--#{defaults.$prefix}-button-active-color,
|
|
95
|
+
--#{root-defaults.$prefix}-button-active-color,
|
|
91
96
|
#{theme.get(primary, 100)}
|
|
92
97
|
);
|
|
93
98
|
$button-disabled-color: var(
|
|
94
|
-
--#{defaults.$prefix}-button-disabled-color,
|
|
99
|
+
--#{root-defaults.$prefix}-button-disabled-color,
|
|
95
100
|
#{theme.get(primary, 200)}
|
|
96
101
|
);
|
|
97
102
|
|
|
98
103
|
// Border properties.
|
|
99
104
|
$button-border-width: var(
|
|
100
|
-
--#{defaults.$prefix}-button-border-width,
|
|
101
|
-
#{
|
|
105
|
+
--#{root-defaults.$prefix}-button-border-width,
|
|
106
|
+
#{root-variables.$border-width}
|
|
102
107
|
);
|
|
103
108
|
$button-border-style: var(
|
|
104
|
-
--#{defaults.$prefix}-botton-border-style,
|
|
105
|
-
#{
|
|
109
|
+
--#{root-defaults.$prefix}-botton-border-style,
|
|
110
|
+
#{root-variables.$border-style}
|
|
106
111
|
);
|
|
107
112
|
$button-border-radius: var(
|
|
108
|
-
--#{defaults.$prefix}-button-border-radius,
|
|
109
|
-
#{
|
|
113
|
+
--#{root-defaults.$prefix}-button-border-radius,
|
|
114
|
+
#{root-variables.$border-radius}
|
|
110
115
|
);
|
|
111
116
|
|
|
112
117
|
// Border colour properties.
|
|
113
118
|
$button-border-color: var(
|
|
114
|
-
--#{defaults.$prefix}-button-border-color,
|
|
119
|
+
--#{root-defaults.$prefix}-button-border-color,
|
|
115
120
|
#{theme.get(primary, 900)}
|
|
116
121
|
);
|
|
117
122
|
$button-hover-border-color: var(
|
|
118
|
-
--#{defaults.$prefix}-button-hover-border-color,
|
|
123
|
+
--#{root-defaults.$prefix}-button-hover-border-color,
|
|
119
124
|
#{theme.get(primary, 900)}
|
|
120
125
|
);
|
|
121
126
|
$button-active-border-color: var(
|
|
122
|
-
--#{defaults.$prefix}-button-active-border-color,
|
|
127
|
+
--#{root-defaults.$prefix}-button-active-border-color,
|
|
123
128
|
#{theme.get(primary, 900)}
|
|
124
129
|
);
|
|
125
130
|
$button-disabled-border-color: var(
|
|
126
|
-
--#{defaults.$prefix}-button-disabled-border-color,
|
|
131
|
+
--#{root-defaults.$prefix}-button-disabled-border-color,
|
|
127
132
|
#{theme.get(primary, 200)}
|
|
128
133
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// A function to get the specific theme shades.
|
|
2
2
|
|
|
3
3
|
@use "sass:map";
|
|
4
|
-
@use "../theme/variables" as
|
|
4
|
+
@use "../theme/color/variables" as color;
|
|
5
5
|
|
|
6
6
|
@function get($color, $shade) {
|
|
7
|
-
$color-map: map.get(
|
|
7
|
+
$color-map: map.get(color.$theme-active, $color);
|
|
8
8
|
$value: map.get($color-map, $shade);
|
|
9
9
|
|
|
10
10
|
@return $value;
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
// They are mainly used to provide default fallbacks for custom properties
|
|
5
5
|
// which can be found in the `variables.scss` file.
|
|
6
6
|
|
|
7
|
-
@forward "../../defaults";
|
|
8
|
-
|
|
9
7
|
$columns-max-width: 1fr !default;
|
|
10
8
|
$columns-count: 3 !default;
|
|
11
9
|
$columns-disable-width: 48ch !default;
|
|
@@ -2,17 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
@use "variables" as *;
|
|
4
4
|
@use "defaults";
|
|
5
|
-
@use "../../
|
|
5
|
+
@use "../../defaults" as root-defaults;
|
|
6
6
|
@use "../../mixins/layer" as *;
|
|
7
7
|
|
|
8
8
|
@include layer(layout) {
|
|
9
9
|
.columns {
|
|
10
10
|
display: grid;
|
|
11
|
-
grid-template-columns:
|
|
12
|
-
|
|
13
|
-
repeat(auto-fit, minmax(#{$columns-min-width}, #{$columns-max-width}))
|
|
14
|
-
);
|
|
15
|
-
gap: $columns-gap;
|
|
11
|
+
grid-template-columns: $columns-grid-template-columns;
|
|
12
|
+
gap: $columns-row-gap $columns-column-gap;
|
|
16
13
|
|
|
17
14
|
> * {
|
|
18
15
|
grid-column: span $columns-span;
|
|
@@ -21,18 +18,18 @@
|
|
|
21
18
|
|
|
22
19
|
@for $i from defaults.$columns-min-count through defaults.$columns-max-count {
|
|
23
20
|
.count-#{$i} {
|
|
24
|
-
--#{defaults.$prefix}-columns-count: #{$i};
|
|
21
|
+
--#{root-defaults.$prefix}-columns-count: #{$i};
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
.span-#{$i} {
|
|
28
|
-
--#{defaults.$prefix}-columns-span: #{$i};
|
|
25
|
+
--#{root-defaults.$prefix}-columns-span: #{$i};
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
// Disable columns on small screens to avoid horizontal bleeding.
|
|
33
30
|
@media screen and (max-width: #{defaults.$columns-disable-width}) {
|
|
34
31
|
.columns {
|
|
35
|
-
--#{defaults.$prefix}-columns-min-width: #{defaults.$columns-max-width};
|
|
32
|
+
--#{root-defaults.$prefix}-columns-min-width: #{defaults.$columns-max-width};
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
35
|
}
|
|
@@ -1,24 +1,47 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
|
-
@use "../../variables" as base;
|
|
4
3
|
@use "defaults";
|
|
4
|
+
@use "../../variables" as root-variables;
|
|
5
|
+
@use "../../defaults" as root-defaults;
|
|
6
|
+
@use "sass:map";
|
|
5
7
|
|
|
6
|
-
$columns-gap: var(
|
|
8
|
+
$columns-row-gap: var(
|
|
9
|
+
--#{root-defaults.$prefix}-columns-row-gap,
|
|
10
|
+
#{map.get(root-variables.$spacers, 5)}
|
|
11
|
+
);
|
|
12
|
+
$columns-column-gap: var(
|
|
13
|
+
--#{root-defaults.$prefix}-columns-column-gap,
|
|
14
|
+
#{map.get(root-variables.$spacers, 5)}
|
|
15
|
+
);
|
|
7
16
|
$columns-count: var(
|
|
8
|
-
--#{defaults.$prefix}-columns-count,
|
|
17
|
+
--#{root-defaults.$prefix}-columns-count,
|
|
9
18
|
#{defaults.$columns-count}
|
|
10
19
|
);
|
|
20
|
+
|
|
21
|
+
// Calculate the min-width of each column based on the content-max-width and column-gap.
|
|
22
|
+
// We take the maximum width of the page and subtract the gap width multiplied by the number of
|
|
23
|
+
// columns minus one (to account for the gaps between columns).
|
|
24
|
+
// We then divide this by the number of columns to get the min-width of each column.
|
|
25
|
+
/* stylelint-disable scss/operator-no-newline-after -- Prettier wants to format it this way. */
|
|
11
26
|
$columns-min-width: var(
|
|
12
|
-
--#{defaults.$prefix}-columns-min-width,
|
|
27
|
+
--#{root-defaults.$prefix}-columns-min-width,
|
|
13
28
|
calc(
|
|
14
|
-
(
|
|
29
|
+
(
|
|
30
|
+
#{root-variables.$content-max-width} - #{$columns-column-gap} *
|
|
31
|
+
(#{$columns-count} - 1)
|
|
32
|
+
) / #{$columns-count}
|
|
15
33
|
)
|
|
16
34
|
);
|
|
35
|
+
/* stylelint-enable scss/operator-no-newline-after */
|
|
17
36
|
$columns-max-width: var(
|
|
18
|
-
--#{defaults.$prefix}-columns-max-width,
|
|
37
|
+
--#{root-defaults.$prefix}-columns-max-width,
|
|
19
38
|
#{defaults.$columns-max-width}
|
|
20
39
|
);
|
|
40
|
+
$columns-grid-template-columns: var(
|
|
41
|
+
--#{root-defaults.$prefix}-columns-grid-template-columns,
|
|
42
|
+
repeat(auto-fit, minmax(#{$columns-min-width}, #{$columns-max-width}))
|
|
43
|
+
);
|
|
21
44
|
$columns-span: var(
|
|
22
|
-
--#{defaults.$prefix}-columns-span,
|
|
45
|
+
--#{root-defaults.$prefix}-columns-span,
|
|
23
46
|
#{defaults.$columns-span}
|
|
24
47
|
);
|
|
@@ -2,34 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
@use "variables" as *;
|
|
4
4
|
@use "../../mixins/layer" as *;
|
|
5
|
-
@use "defaults";
|
|
5
|
+
@use "../../defaults" as root-defaults;
|
|
6
6
|
|
|
7
7
|
@include layer(layout) {
|
|
8
8
|
.container,
|
|
9
9
|
.container > .full-width {
|
|
10
|
-
--#{defaults.$prefix}-container-full-width: minmax(
|
|
11
|
-
|
|
10
|
+
--#{root-defaults.$prefix}-container-full-width: minmax(
|
|
11
|
+
#{$container-gap},
|
|
12
|
+
1fr
|
|
13
|
+
);
|
|
14
|
+
--#{root-defaults.$prefix}-container-content: min(
|
|
12
15
|
#{$container-content-max-width},
|
|
13
16
|
calc(100% - #{$container-gap} * 2)
|
|
14
17
|
);
|
|
15
|
-
--#{defaults.$prefix}-container-breakout: minmax(
|
|
18
|
+
--#{root-defaults.$prefix}-container-breakout: minmax(
|
|
16
19
|
0,
|
|
17
20
|
#{$container-breakout-width}
|
|
18
21
|
);
|
|
19
|
-
--#{defaults.$prefix}-container-feature: minmax(
|
|
22
|
+
--#{root-defaults.$prefix}-container-feature: minmax(
|
|
20
23
|
0,
|
|
21
24
|
#{$container-feature-width}
|
|
22
25
|
);
|
|
23
26
|
|
|
24
27
|
display: grid;
|
|
25
28
|
grid-template-columns:
|
|
26
|
-
[full-width-start] var(--#{defaults.$prefix}-container-full-width)
|
|
27
|
-
[feature-start] var(--#{defaults.$prefix}-container-feature)
|
|
28
|
-
[breakout-start] var(--#{defaults.$prefix}-container-breakout)
|
|
29
|
-
[content-start] var(--#{defaults.$prefix}-container-content)
|
|
30
|
-
|
|
31
|
-
var(--#{defaults.$prefix}-container-
|
|
32
|
-
var(--#{defaults.$prefix}-container-
|
|
29
|
+
[full-width-start] var(--#{root-defaults.$prefix}-container-full-width)
|
|
30
|
+
[feature-start] var(--#{root-defaults.$prefix}-container-feature)
|
|
31
|
+
[breakout-start] var(--#{root-defaults.$prefix}-container-breakout)
|
|
32
|
+
[content-start] var(--#{root-defaults.$prefix}-container-content)
|
|
33
|
+
[content-end]
|
|
34
|
+
var(--#{root-defaults.$prefix}-container-breakout) [breakout-end]
|
|
35
|
+
var(--#{root-defaults.$prefix}-container-feature) [feature-end]
|
|
36
|
+
var(--#{root-defaults.$prefix}-container-full-width) [full-width-end];
|
|
33
37
|
|
|
34
38
|
> :not(.breakout, .full-width, .feature) {
|
|
35
39
|
grid-column: content;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
|
-
@use "../../variables" as base;
|
|
4
3
|
@use "defaults";
|
|
4
|
+
@use "../../variables" as root-variables;
|
|
5
|
+
@use "../../defaults" as root-defaults;
|
|
6
|
+
@use "sass:map";
|
|
5
7
|
|
|
6
|
-
$container-gap: var(
|
|
8
|
+
$container-gap: var(
|
|
9
|
+
--#{root-defaults.$prefix}-container-gap,
|
|
10
|
+
#{map.get(root-variables.$spacers, 5)}
|
|
11
|
+
);
|
|
7
12
|
$container-content-max-width: var(
|
|
8
|
-
--#{defaults.$prefix}-container-content-max-width,
|
|
9
|
-
#{
|
|
13
|
+
--#{root-defaults.$prefix}-container-content-max-width,
|
|
14
|
+
#{root-variables.$content-max-width}
|
|
10
15
|
);
|
|
11
16
|
$container-breakout-max-width: var(
|
|
12
|
-
--#{defaults.$prefix}-container-breakout-max-width,
|
|
17
|
+
--#{root-defaults.$prefix}-container-breakout-max-width,
|
|
13
18
|
calc(#{$container-content-max-width} + #{defaults.$container-breakout-width})
|
|
14
19
|
);
|
|
15
20
|
$container-breakout-width: var(
|
|
16
|
-
--#{defaults.$prefix}-container-breakout-width,
|
|
21
|
+
--#{root-defaults.$prefix}-container-breakout-width,
|
|
17
22
|
calc((#{$container-breakout-max-width} - #{$container-content-max-width}) / 2)
|
|
18
23
|
);
|
|
19
24
|
$container-feature-max-width: var(
|
|
20
|
-
--#{defaults.$prefix}-container-feature-max-width,
|
|
25
|
+
--#{root-defaults.$prefix}-container-feature-max-width,
|
|
21
26
|
calc(#{$container-breakout-max-width} + #{defaults.$container-feature-width})
|
|
22
27
|
);
|
|
23
28
|
$container-feature-width: var(
|
|
24
|
-
--#{defaults.$prefix}-container-feature-width,
|
|
29
|
+
--#{root-defaults.$prefix}-container-feature-width,
|
|
25
30
|
calc((#{$container-feature-max-width} - #{$container-breakout-max-width}) / 2)
|
|
26
31
|
);
|
package/scss/mixins/_layer.scss
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// These should be used to define the layers of your components to ensure that
|
|
4
4
|
// they are output in the correct order in the final compiled CSS.
|
|
5
5
|
|
|
6
|
-
@use "../defaults" as
|
|
6
|
+
@use "../defaults" as root-defaults;
|
|
7
7
|
|
|
8
8
|
@mixin layer($layer) {
|
|
9
9
|
@at-root {
|
|
10
|
-
@layer #{
|
|
10
|
+
@layer #{root-defaults.$prefix}.#{$layer} {
|
|
11
11
|
@content;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
|
-
@use "../../variables" as
|
|
3
|
+
@use "../../variables" as root-variables;
|
|
4
4
|
@use "defaults";
|
|
5
|
+
@use "../../defaults" as root-defaults;
|
|
5
6
|
@use "../../functions/theme";
|
|
6
7
|
|
|
7
|
-
$focus-width: var(
|
|
8
|
+
$focus-width: var(
|
|
9
|
+
--#{root-defaults.$prefix}-focus-width,
|
|
10
|
+
#{root-variables.$border-width}
|
|
11
|
+
);
|
|
8
12
|
$focus-outline-color: var(
|
|
9
|
-
--#{defaults.$prefix}-focus-outline-color,
|
|
13
|
+
--#{root-defaults.$prefix}-focus-outline-color,
|
|
10
14
|
#{theme.get(primary, 900)}
|
|
11
15
|
);
|
|
12
16
|
$focus-outline-width: var(
|
|
13
|
-
--#{defaults.$prefix}-focus-outline-width,
|
|
17
|
+
--#{root-defaults.$prefix}-focus-outline-width,
|
|
14
18
|
#{$focus-width}
|
|
15
19
|
);
|
|
16
20
|
$focus-outline-style: var(
|
|
17
|
-
--#{defaults.$prefix}-focus-outline-style,
|
|
21
|
+
--#{root-defaults.$prefix}-focus-outline-style,
|
|
18
22
|
#{defaults.$focus-outline-style}
|
|
19
23
|
);
|
|
20
24
|
$focus-outline-offset: var(
|
|
21
|
-
--#{defaults.$prefix}-focus-outline-offset,
|
|
25
|
+
--#{root-defaults.$prefix}-focus-outline-offset,
|
|
22
26
|
calc(-1 * #{$focus-outline-width})
|
|
23
27
|
);
|
|
24
28
|
$focus-box-shadow-color: var(
|
|
25
|
-
--#{defaults.$prefix}-focus-box-shadow-color,
|
|
29
|
+
--#{root-defaults.$prefix}-focus-box-shadow-color,
|
|
26
30
|
#{theme.get(primary, 100)}
|
|
27
31
|
);
|
|
28
32
|
$focus-box-shadow-style: var(
|
|
29
|
-
--#{defaults.$prefix}-focus-box-shadow-style,
|
|
33
|
+
--#{root-defaults.$prefix}-focus-box-shadow-style,
|
|
30
34
|
#{defaults.$focus-box-shadow-style}
|
|
31
35
|
);
|
|
32
36
|
$focus-box-shadow: var(
|
|
33
|
-
--#{defaults.$prefix}-focus-box-shadow,
|
|
37
|
+
--#{root-defaults.$prefix}-focus-box-shadow,
|
|
34
38
|
#{$focus-width $focus-width} 0 0 #{$focus-box-shadow-style} #{$focus-box-shadow-color},
|
|
35
39
|
0 0 0 #{$focus-width} #{$focus-box-shadow-style} #{$focus-box-shadow-color}
|
|
36
40
|
);
|
package/scss/theme/_index.scss
CHANGED
|
@@ -1,38 +1,4 @@
|
|
|
1
|
-
// Graupl
|
|
1
|
+
// Graupl theme.
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@use "defaults";
|
|
6
|
-
@use "sass:map";
|
|
7
|
-
@use "../functions/theme";
|
|
8
|
-
|
|
9
|
-
@include layer(theme) {
|
|
10
|
-
:root {
|
|
11
|
-
background: $background;
|
|
12
|
-
color: $font-color;
|
|
13
|
-
font-family: $font-family;
|
|
14
|
-
font-size: $font-size;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Set the active theme for dark mode.
|
|
18
|
-
.dark-mode {
|
|
19
|
-
@each $color, $map in $theme-dark {
|
|
20
|
-
@each $shade, $value in $map {
|
|
21
|
-
--#{defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
color-scheme: dark;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Set the active theme for light mode.
|
|
29
|
-
.light-mode {
|
|
30
|
-
@each $color, $map in $theme-light {
|
|
31
|
-
@each $shade, $value in $map {
|
|
32
|
-
--#{defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
color-scheme: light;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
3
|
+
@forward "color";
|
|
4
|
+
@forward "typography";
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
// which can be found in the `variables.scss` file.
|
|
6
6
|
|
|
7
7
|
@use "sass:map";
|
|
8
|
-
@forward "../defaults";
|
|
9
8
|
|
|
10
9
|
// Colours.
|
|
11
10
|
$default-colors: (
|
|
@@ -42,9 +41,9 @@ $default-colors: (
|
|
|
42
41
|
800: hsl(340deg 75% 20%),
|
|
43
42
|
900: hsl(340deg 85% 10%),
|
|
44
43
|
),
|
|
45
|
-
)
|
|
44
|
+
);
|
|
46
45
|
$custom-colors: () !default;
|
|
47
|
-
$colors: map.merge($default-colors, $custom-colors)
|
|
46
|
+
$colors: map.merge($default-colors, $custom-colors);
|
|
48
47
|
|
|
49
48
|
// A map for reversing the shade values of the dark theme.
|
|
50
49
|
$dark-map: (
|
|
@@ -58,16 +57,3 @@ $dark-map: (
|
|
|
58
57
|
800: 200,
|
|
59
58
|
900: 100,
|
|
60
59
|
) !default;
|
|
61
|
-
|
|
62
|
-
// Font properties.
|
|
63
|
-
/* stylelint-disable-next-line scss/dollar-variable-colon-space-after */
|
|
64
|
-
$font-family:
|
|
65
|
-
system-ui,
|
|
66
|
-
-apple-system,
|
|
67
|
-
blinkmacsystemfont,
|
|
68
|
-
"Segoe UI",
|
|
69
|
-
roboto,
|
|
70
|
-
"Helvetica Neue",
|
|
71
|
-
arial,
|
|
72
|
-
sans-serif !default;
|
|
73
|
-
$font-size: clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Color theme styles.
|
|
2
|
+
|
|
3
|
+
@use "variables" as *;
|
|
4
|
+
@use "../../mixins/layer" as *;
|
|
5
|
+
@use "../../defaults" as root-defaults;
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "../../functions/theme";
|
|
8
|
+
|
|
9
|
+
@include layer(theme) {
|
|
10
|
+
:root {
|
|
11
|
+
background: $root-background;
|
|
12
|
+
color: $root-font-color;
|
|
13
|
+
|
|
14
|
+
@each $color, $map in $theme-light {
|
|
15
|
+
@each $shade, $value in $map {
|
|
16
|
+
--#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Set the active theme for dark mode.
|
|
22
|
+
.dark-mode {
|
|
23
|
+
@each $color, $map in $theme-dark {
|
|
24
|
+
@each $shade, $value in $map {
|
|
25
|
+
--#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
color-scheme: dark;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Set the active theme for light mode.
|
|
33
|
+
.light-mode {
|
|
34
|
+
@each $color, $map in $theme-light {
|
|
35
|
+
@each $shade, $value in $map {
|
|
36
|
+
--#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
color-scheme: light;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
3
|
@use "defaults";
|
|
4
|
+
@use "../../defaults" as root-defaults;
|
|
4
5
|
@use "sass:map";
|
|
5
6
|
|
|
6
7
|
// A colour map of base colours and their shades.
|
|
@@ -13,7 +14,10 @@ $colors: ();
|
|
|
13
14
|
|
|
14
15
|
@each $shade, $value in $map {
|
|
15
16
|
// Set the custom prop name and fallback value.
|
|
16
|
-
$color-property: var(
|
|
17
|
+
$color-property: var(
|
|
18
|
+
--#{root-defaults.$prefix}-#{$color}--#{$shade},
|
|
19
|
+
$value
|
|
20
|
+
);
|
|
17
21
|
|
|
18
22
|
// Add the custom prop to the map.
|
|
19
23
|
$color-map: map.merge(
|
|
@@ -52,15 +56,15 @@ $theme-active: ();
|
|
|
52
56
|
|
|
53
57
|
// Set the custom prop names and fallback values.
|
|
54
58
|
$light-property: var(
|
|
55
|
-
--#{defaults.$prefix}-theme-light--#{$color}--#{$shade},
|
|
59
|
+
--#{root-defaults.$prefix}-theme-light--#{$color}--#{$shade},
|
|
56
60
|
$value
|
|
57
61
|
);
|
|
58
62
|
$dark-property: var(
|
|
59
|
-
--#{defaults.$prefix}-theme-dark--#{$color}--#{$shade},
|
|
63
|
+
--#{root-defaults.$prefix}-theme-dark--#{$color}--#{$shade},
|
|
60
64
|
$dark-value
|
|
61
65
|
);
|
|
62
66
|
$active-property: var(
|
|
63
|
-
--#{defaults.$prefix}-theme-active--#{$color}--#{$shade},
|
|
67
|
+
--#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade},
|
|
64
68
|
$light-property
|
|
65
69
|
);
|
|
66
70
|
|
|
@@ -106,16 +110,12 @@ $theme-active: ();
|
|
|
106
110
|
);
|
|
107
111
|
}
|
|
108
112
|
|
|
109
|
-
// Font properties.
|
|
110
|
-
$font-family: var(--#{defaults.$prefix}-font-family, #{defaults.$font-family});
|
|
111
|
-
$font-size: var(--#{defaults.$prefix}-font-size, #{defaults.$font-size});
|
|
112
|
-
|
|
113
113
|
// Colour properties.
|
|
114
|
-
$font-color: var(
|
|
115
|
-
--#{defaults.$prefix}-font-color,
|
|
114
|
+
$root-font-color: var(
|
|
115
|
+
--#{root-defaults.$prefix}-root-font-color,
|
|
116
116
|
#{map.get(map.get($theme-active, primary), 900)}
|
|
117
117
|
);
|
|
118
|
-
$background: var(
|
|
119
|
-
--#{defaults.$prefix}-background,
|
|
118
|
+
$root-background: var(
|
|
119
|
+
--#{root-defaults.$prefix}-root-background,
|
|
120
120
|
#{map.get(map.get($theme-active, primary), 100)}
|
|
121
121
|
);
|