@graupl/graupl 1.0.0-alpha.2 → 1.0.0-alpha.4

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 (48) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/base/form/form.css +1 -85
  3. package/dist/base/form/form.css.map +1 -1
  4. package/dist/base/link/link.css +1 -25
  5. package/dist/base/link/link.css.map +1 -1
  6. package/dist/component/button/button.css +1 -61
  7. package/dist/component/button/button.css.map +1 -1
  8. package/dist/graupl.css +1 -320
  9. package/dist/graupl.css.map +1 -1
  10. package/dist/layout/columns/columns.css +1 -40
  11. package/dist/layout/columns/columns.css.map +1 -1
  12. package/dist/layout/container/container.css +1 -37
  13. package/dist/layout/container/container.css.map +1 -1
  14. package/dist/state/focus/focus.css +1 -9
  15. package/dist/state/focus/focus.css.map +1 -1
  16. package/dist/theme/theme.css +1 -69
  17. package/dist/theme/theme.css.map +1 -1
  18. package/dist/utilities/background/background.css +1 -0
  19. package/dist/utilities/colors/colors.css +2 -0
  20. package/dist/utilities/colors/colors.css.map +1 -0
  21. package/docs/.vitepress/config.js +41 -1
  22. package/docs/.vitepress/theme/custom.scss +29 -29
  23. package/docs/compiling-graupl.md +56 -0
  24. package/docs/introduction.md +5 -0
  25. package/index.html +6 -2
  26. package/package.json +27 -1
  27. package/postcss.config.cjs +1 -1
  28. package/scss/_defaults.scss +3 -0
  29. package/scss/_index.scss +14 -0
  30. package/scss/_init.scss +3 -0
  31. package/scss/base/form/_variables.scss +8 -8
  32. package/scss/base/link/_variables.scss +5 -8
  33. package/scss/component/button/_defaults.scss +2 -0
  34. package/scss/component/button/_index.scss +47 -19
  35. package/scss/component/button/_variables.scss +36 -10
  36. package/scss/functions/_important.scss +11 -0
  37. package/scss/functions/_theme.scss +11 -0
  38. package/scss/graupl.scss +1 -5
  39. package/scss/layout/columns/_index.scss +1 -1
  40. package/scss/state/focus/_variables.scss +3 -3
  41. package/scss/theme/_defaults.scss +48 -31
  42. package/scss/theme/_index.scss +13 -66
  43. package/scss/theme/_variables.scss +102 -452
  44. package/scss/utilities/_index.scss +3 -0
  45. package/scss/utilities/colors/_defaults.scss +7 -0
  46. package/scss/utilities/colors/_index.scss +22 -0
  47. package/scss/utilities/colors/_variables.scss +3 -0
  48. package/scss/utilities/colors/colors.scss +3 -0
@@ -1,9 +1,9 @@
1
1
  // Variables referencing custom properties.
2
2
 
3
3
  @use "../../variables" as base;
4
- @use "../../theme/variables" as theme;
5
4
  @use "defaults";
6
5
  @use "sass:map";
6
+ @use "../../functions/theme";
7
7
 
8
8
  // Button properties.
9
9
  $button-min-width: var(
@@ -34,6 +34,12 @@ $button-transition: var(
34
34
  border-color #{map.get(base.$transition-duration, fast)} #{base.$transition-timing-function},
35
35
  transform #{map.get(base.$transition-duration, fast)} #{base.$transition-timing-function}
36
36
  );
37
+ $button-transition-reduced-motion: var(
38
+ --#{defaults.$prefix}-button-transition-reduced-motion,
39
+ background #{map.get(base.$transition-duration, none)} #{base.$transition-timing-function},
40
+ color #{map.get(base.$transition-duration, none)} #{base.$transition-timing-function},
41
+ border-color #{map.get(base.$transition-duration, none)} #{base.$transition-timing-function}
42
+ );
37
43
 
38
44
  // Transform properties.
39
45
  $button-hover-transform: var(
@@ -44,33 +50,49 @@ $button-active-transform: var(
44
50
  --#{defaults.$prefix}-button-active-transform,
45
51
  #{defaults.$button-active-transform}
46
52
  );
53
+ $button-hover-transform-reduced-motion: var(
54
+ --#{defaults.$prefix}-button-hover-transform-reduced-motion,
55
+ #{defaults.$button-hover-transform-reduced-motion}
56
+ );
57
+ $button-active-transform-reduced-motion: var(
58
+ --#{defaults.$prefix}-button-active-transform-reduced-motion,
59
+ #{defaults.$button-active-transform-reduced-motion}
60
+ );
47
61
 
48
62
  // Background properties.
49
63
  $button-background: var(
50
64
  --#{defaults.$prefix}-button-background,
51
- #{theme.$theme-active--primary--100}
65
+ #{theme.get(primary, 100)}
52
66
  );
53
67
  $button-hover-background: var(
54
68
  --#{defaults.$prefix}-button-hover-background,
55
- #{theme.$theme-active--primary--900}
69
+ #{theme.get(primary, 900)}
56
70
  );
57
71
  $button-active-background: var(
58
72
  --#{defaults.$prefix}-button-active-background,
59
- #{theme.$theme-active--primary--900}
73
+ #{theme.get(primary, 900)}
74
+ );
75
+ $button-disabled-background: var(
76
+ --#{defaults.$prefix}-button-disabled-background,
77
+ #{theme.get(primary, 100)}
60
78
  );
61
79
 
62
80
  // Text properties.
63
81
  $button-color: var(
64
82
  --#{defaults.$prefix}-button-color,
65
- #{theme.$theme-active--primary--900}
83
+ #{theme.get(primary, 900)}
66
84
  );
67
85
  $button-hover-color: var(
68
86
  --#{defaults.$prefix}-button-hover-color,
69
- #{theme.$theme-active--primary--100}
87
+ #{theme.get(primary, 100)}
70
88
  );
71
89
  $button-active-color: var(
72
90
  --#{defaults.$prefix}-button-active-color,
73
- #{theme.$theme-active--primary--100}
91
+ #{theme.get(primary, 100)}
92
+ );
93
+ $button-disabled-color: var(
94
+ --#{defaults.$prefix}-button-disabled-color,
95
+ #{theme.get(primary, 200)}
74
96
  );
75
97
 
76
98
  // Border properties.
@@ -90,13 +112,17 @@ $button-border-radius: var(
90
112
  // Border colour properties.
91
113
  $button-border-color: var(
92
114
  --#{defaults.$prefix}-button-border-color,
93
- #{theme.$theme-active--primary--900}
115
+ #{theme.get(primary, 900)}
94
116
  );
95
117
  $button-hover-border-color: var(
96
118
  --#{defaults.$prefix}-button-hover-border-color,
97
- #{theme.$theme-active--primary--900}
119
+ #{theme.get(primary, 900)}
98
120
  );
99
121
  $button-active-border-color: var(
100
122
  --#{defaults.$prefix}-button-active-border-color,
101
- #{theme.$theme-active--primary--900}
123
+ #{theme.get(primary, 900)}
124
+ );
125
+ $button-disabled-border-color: var(
126
+ --#{defaults.$prefix}-button-disabled-border-color,
127
+ #{theme.get(primary, 200)}
102
128
  );
@@ -0,0 +1,11 @@
1
+ // A function to determine if the !important flag should be added to a property.
2
+
3
+ @use "../defaults";
4
+
5
+ @function insert($value) {
6
+ @if defaults.$use-important {
7
+ @return #{$value !important};
8
+ }
9
+
10
+ @return #{$value};
11
+ }
@@ -0,0 +1,11 @@
1
+ // A function to get the specific theme shades.
2
+
3
+ @use "sass:map";
4
+ @use "../theme/variables" as theme;
5
+
6
+ @function get($color, $shade) {
7
+ $color-map: map.get(theme.$theme-active, $color);
8
+ $value: map.get($color-map, $shade);
9
+
10
+ @return $value;
11
+ }
package/scss/graupl.scss CHANGED
@@ -2,8 +2,4 @@
2
2
  //
3
3
  // Forwards all components for easy development.
4
4
 
5
- @forward "base";
6
- @forward "layout";
7
- @forward "component";
8
- @forward "state";
9
- @forward "theme";
5
+ @forward "index";
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
  @for $i from defaults.$columns-min-count through defaults.$columns-max-count {
23
- .columns-#{$i} {
23
+ .count-#{$i} {
24
24
  --#{defaults.$prefix}-columns-count: #{$i};
25
25
  }
26
26
 
@@ -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.$theme-active--primary--900}
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.$theme-active--primary--100}
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
- $primary: (
12
- 100: hsl(219deg 100% 95%),
13
- 200: hsl(219deg 90% 80%),
14
- 300: hsl(219deg 80% 65%),
15
- 400: hsl(219deg 75% 55%),
16
- 500: hsl(219deg 75% 50%),
17
- 600: hsl(219deg 75% 45%),
18
- 700: hsl(219deg 80% 35%),
19
- 800: hsl(219deg 90% 20%),
20
- 900: hsl(219deg 100% 10%),
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
- $secondary: (
23
- 100: hsl(235deg 40% 95%),
24
- 200: hsl(235deg 30% 80%),
25
- 300: hsl(235deg 20% 65%),
26
- 400: hsl(235deg 15% 55%),
27
- 500: hsl(235deg 15% 50%),
28
- 600: hsl(235deg 15% 45%),
29
- 700: hsl(235deg 20% 35%),
30
- 800: hsl(235deg 30% 20%),
31
- 900: hsl(235deg 40% 10%),
32
- ) !default;
33
- $tertiary: (
34
- 100: hsl(340deg 85% 95%),
35
- 200: hsl(340deg 75% 80%),
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.
@@ -4,87 +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: $theme-active--primary--100;
11
- color: $theme-active--primary--900;
11
+ background: $background;
12
+ color: $font-color;
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
- // Primary colours.
19
- --#{defaults.$prefix}-theme-active--primary--100: #{$theme-dark--primary--100};
20
- --#{defaults.$prefix}-theme-active--primary--200: #{$theme-dark--primary--200};
21
- --#{defaults.$prefix}-theme-active--primary--300: #{$theme-dark--primary--300};
22
- --#{defaults.$prefix}-theme-active--primary--400: #{$theme-dark--primary--400};
23
- --#{defaults.$prefix}-theme-active--primary--500: #{$theme-dark--primary--500};
24
- --#{defaults.$prefix}-theme-active--primary--600: #{$theme-dark--primary--600};
25
- --#{defaults.$prefix}-theme-active--primary--700: #{$theme-dark--primary--700};
26
- --#{defaults.$prefix}-theme-active--primary--800: #{$theme-dark--primary--800};
27
- --#{defaults.$prefix}-theme-active--primary--900: #{$theme-dark--primary--900};
28
-
29
- // Secondary colours.
30
- --#{defaults.$prefix}-theme-active--secondary--100: #{$theme-dark--secondary--100};
31
- --#{defaults.$prefix}-theme-active--secondary--200: #{$theme-dark--secondary--200};
32
- --#{defaults.$prefix}-theme-active--secondary--300: #{$theme-dark--secondary--300};
33
- --#{defaults.$prefix}-theme-active--secondary--400: #{$theme-dark--secondary--400};
34
- --#{defaults.$prefix}-theme-active--secondary--500: #{$theme-dark--secondary--500};
35
- --#{defaults.$prefix}-theme-active--secondary--600: #{$theme-dark--secondary--600};
36
- --#{defaults.$prefix}-theme-active--secondary--700: #{$theme-dark--secondary--700};
37
- --#{defaults.$prefix}-theme-active--secondary--800: #{$theme-dark--secondary--800};
38
- --#{defaults.$prefix}-theme-active--secondary--900: #{$theme-dark--secondary--900};
39
-
40
- // Tertiary colours.
41
- --#{defaults.$prefix}-theme-active--tertiary--100: #{$theme-dark--tertiary--100};
42
- --#{defaults.$prefix}-theme-active--tertiary--200: #{$theme-dark--tertiary--200};
43
- --#{defaults.$prefix}-theme-active--tertiary--300: #{$theme-dark--tertiary--300};
44
- --#{defaults.$prefix}-theme-active--tertiary--400: #{$theme-dark--tertiary--400};
45
- --#{defaults.$prefix}-theme-active--tertiary--500: #{$theme-dark--tertiary--500};
46
- --#{defaults.$prefix}-theme-active--tertiary--600: #{$theme-dark--tertiary--600};
47
- --#{defaults.$prefix}-theme-active--tertiary--700: #{$theme-dark--tertiary--700};
48
- --#{defaults.$prefix}-theme-active--tertiary--800: #{$theme-dark--tertiary--800};
49
- --#{defaults.$prefix}-theme-active--tertiary--900: #{$theme-dark--tertiary--900};
19
+ @each $color, $map in $theme-dark {
20
+ @each $shade, $value in $map {
21
+ --#{defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
22
+ }
23
+ }
50
24
 
51
25
  color-scheme: dark;
52
26
  }
53
27
 
54
28
  // Set the active theme for light mode.
55
29
  .light-mode {
56
- // Primary colours.
57
- --#{defaults.$prefix}-theme-active--primary--100: #{$theme-light--primary--100};
58
- --#{defaults.$prefix}-theme-active--primary--200: #{$theme-light--primary--200};
59
- --#{defaults.$prefix}-theme-active--primary--300: #{$theme-light--primary--300};
60
- --#{defaults.$prefix}-theme-active--primary--400: #{$theme-light--primary--400};
61
- --#{defaults.$prefix}-theme-active--primary--500: #{$theme-light--primary--500};
62
- --#{defaults.$prefix}-theme-active--primary--600: #{$theme-light--primary--600};
63
- --#{defaults.$prefix}-theme-active--primary--700: #{$theme-light--primary--700};
64
- --#{defaults.$prefix}-theme-active--primary--800: #{$theme-light--primary--800};
65
- --#{defaults.$prefix}-theme-active--primary--900: #{$theme-light--primary--900};
66
-
67
- // Secondary colours.
68
- --#{defaults.$prefix}-theme-active--secondary--100: #{$theme-light--secondary--100};
69
- --#{defaults.$prefix}-theme-active--secondary--200: #{$theme-light--secondary--200};
70
- --#{defaults.$prefix}-theme-active--secondary--300: #{$theme-light--secondary--300};
71
- --#{defaults.$prefix}-theme-active--secondary--400: #{$theme-light--secondary--400};
72
- --#{defaults.$prefix}-theme-active--secondary--500: #{$theme-light--secondary--500};
73
- --#{defaults.$prefix}-theme-active--secondary--600: #{$theme-light--secondary--600};
74
- --#{defaults.$prefix}-theme-active--secondary--700: #{$theme-light--secondary--700};
75
- --#{defaults.$prefix}-theme-active--secondary--800: #{$theme-light--secondary--800};
76
- --#{defaults.$prefix}-theme-active--secondary--900: #{$theme-light--secondary--900};
77
-
78
- // Tertiary colours.
79
- --#{defaults.$prefix}-theme-active--tertiary--100: #{$theme-light--tertiary--100};
80
- --#{defaults.$prefix}-theme-active--tertiary--200: #{$theme-light--tertiary--200};
81
- --#{defaults.$prefix}-theme-active--tertiary--300: #{$theme-light--tertiary--300};
82
- --#{defaults.$prefix}-theme-active--tertiary--400: #{$theme-light--tertiary--400};
83
- --#{defaults.$prefix}-theme-active--tertiary--500: #{$theme-light--tertiary--500};
84
- --#{defaults.$prefix}-theme-active--tertiary--600: #{$theme-light--tertiary--600};
85
- --#{defaults.$prefix}-theme-active--tertiary--700: #{$theme-light--tertiary--700};
86
- --#{defaults.$prefix}-theme-active--tertiary--800: #{$theme-light--tertiary--800};
87
- --#{defaults.$prefix}-theme-active--tertiary--900: #{$theme-light--tertiary--900};
30
+ @each $color, $map in $theme-light {
31
+ @each $shade, $value in $map {
32
+ --#{defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
33
+ }
34
+ }
88
35
 
89
36
  color-scheme: light;
90
37
  }