@graupl/core 1.0.0-beta.17 → 1.0.0-beta.18
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.map +1 -1
- package/dist/css/base/table.css.map +1 -1
- package/dist/css/base.css.map +1 -1
- package/dist/css/component/accordion.css.map +1 -1
- package/dist/css/component/alert.css.map +1 -1
- package/dist/css/component/carousel.css.map +1 -1
- package/dist/css/component.css.map +1 -1
- package/dist/css/graupl.css.map +1 -1
- package/dist/css/layout.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/base/button/_defaults.scss +23 -7
- package/src/scss/base/button/_index.scss +167 -62
- package/src/scss/base/button/_mixins.scss +6 -3
- package/src/scss/base/table/_defaults.scss +17 -6
- package/src/scss/base/table/_index.scss +112 -6
- package/src/scss/component/alert/_defaults.scss +22 -6
- package/src/scss/component/alert/_index.scss +4 -4
- package/src/scss/functions/_theme.scss +54 -1
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
background-color: $alert-background;
|
|
95
95
|
color: $alert-color;
|
|
96
96
|
|
|
97
|
-
@each $color in theme
|
|
97
|
+
@each $color, $map in defaults.$alert-theme-map {
|
|
98
98
|
&#{defaults.$alert-theme-selector-prefix}#{$color} {
|
|
99
|
-
@each $prop, $
|
|
99
|
+
@each $prop, $value in $map {
|
|
100
100
|
--#{root-defaults.$prefix}alert-#{$prop}: #{theme.get(
|
|
101
|
-
$color,
|
|
102
|
-
$shade
|
|
101
|
+
map.get($value, color),
|
|
102
|
+
map.get($value, shade)
|
|
103
103
|
)};
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -5,7 +5,19 @@
|
|
|
5
5
|
@use "sass:map";
|
|
6
6
|
@use "../theme/color/variables" as color;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/// Get a specific color shade in a specific theme.
|
|
9
|
+
///
|
|
10
|
+
/// $color and $shade both have special values for returning specific colours.
|
|
11
|
+
/// "transparent", "none", "inherit", and "initial" will all return their respective
|
|
12
|
+
/// default CSS values.
|
|
13
|
+
///
|
|
14
|
+
/// If a shade cannot be found in a requested colour, it will fall back to the `_default` shade before returning `null`.
|
|
15
|
+
///
|
|
16
|
+
/// @param {string} $color - The color.
|
|
17
|
+
/// @param {string|number} $shade [null] - The shade.
|
|
18
|
+
/// @param {string} $theme [active] - The theme.
|
|
19
|
+
///
|
|
20
|
+
/// @return {string|null} The custom property pointing to the correct colour or null if none is found.
|
|
9
21
|
@function get($color, $shade: null, $theme: active) {
|
|
10
22
|
@if $shade == transparent or $color == transparent {
|
|
11
23
|
@return transparent;
|
|
@@ -34,6 +46,12 @@
|
|
|
34
46
|
@return null;
|
|
35
47
|
}
|
|
36
48
|
|
|
49
|
+
/// Gets a full shade map of a specific color in a specific theme.
|
|
50
|
+
///
|
|
51
|
+
/// @param {string} $color - The color.
|
|
52
|
+
/// @param {string} $theme [active] - The theme.
|
|
53
|
+
///
|
|
54
|
+
/// @return {map|null} The shade map or null if none is found.
|
|
37
55
|
@function get-color($color, $theme: active) {
|
|
38
56
|
@if map.has-key(color.$themes, $theme, $color) {
|
|
39
57
|
@return map.get(map.get(color.$themes, $theme), $color);
|
|
@@ -42,6 +60,11 @@
|
|
|
42
60
|
@return null;
|
|
43
61
|
}
|
|
44
62
|
|
|
63
|
+
/// Gets the names of all colours in a specific theme.
|
|
64
|
+
///
|
|
65
|
+
/// @param {string} $theme [active] - The theme.
|
|
66
|
+
///
|
|
67
|
+
/// @return {map} The map of color names.
|
|
45
68
|
@function get-colors($theme: active) {
|
|
46
69
|
@if map.has-key(color.$themes, $theme) {
|
|
47
70
|
@return map.keys(map.get(color.$themes, $theme));
|
|
@@ -49,3 +72,33 @@
|
|
|
49
72
|
|
|
50
73
|
@return ();
|
|
51
74
|
}
|
|
75
|
+
|
|
76
|
+
/// Generates a map to tie different properties to color/shade values based on all colors in a specific theme.
|
|
77
|
+
@function generate-property-map($mapping, $theme: active) {
|
|
78
|
+
$theme-map: ();
|
|
79
|
+
|
|
80
|
+
@each $color in map.keys(map.get(color.$themes, $theme)) {
|
|
81
|
+
$map: ();
|
|
82
|
+
|
|
83
|
+
@each $prop, $shade in $mapping {
|
|
84
|
+
$map: map.merge(
|
|
85
|
+
$map,
|
|
86
|
+
(
|
|
87
|
+
$prop: (
|
|
88
|
+
color: $color,
|
|
89
|
+
shade: $shade,
|
|
90
|
+
),
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
$theme-map: map.merge(
|
|
96
|
+
$theme-map,
|
|
97
|
+
(
|
|
98
|
+
$color: $map,
|
|
99
|
+
)
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@return $theme-map;
|
|
104
|
+
}
|