@graupl/graupl 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (212) hide show
  1. package/.stylelintignore +9 -0
  2. package/CHANGELOG.md +177 -0
  3. package/dist/base/form.css +2 -0
  4. package/dist/base/form.css.map +1 -0
  5. package/dist/base/link.css +2 -0
  6. package/dist/base/link.css.map +1 -0
  7. package/dist/base/table.css +2 -0
  8. package/dist/base/table.css.map +1 -0
  9. package/dist/base.css +2 -0
  10. package/dist/base.css.map +1 -0
  11. package/dist/component/button.css +2 -0
  12. package/dist/component/button.css.map +1 -0
  13. package/dist/component/input-group.css +2 -0
  14. package/dist/component/input-group.css.map +1 -0
  15. package/dist/component/table.css +2 -0
  16. package/dist/component/table.css.map +1 -0
  17. package/dist/component.css +2 -0
  18. package/dist/component.css.map +1 -0
  19. package/dist/graupl.css +1 -284
  20. package/dist/graupl.css.map +1 -1
  21. package/dist/layout/columns.css +2 -0
  22. package/dist/layout/columns.css.map +1 -0
  23. package/dist/layout/container.css +2 -0
  24. package/dist/layout/container.css.map +1 -0
  25. package/dist/layout.css +2 -0
  26. package/dist/layout.css.map +1 -0
  27. package/dist/state/focus.css +2 -0
  28. package/dist/state/focus.css.map +1 -0
  29. package/dist/state.css +2 -0
  30. package/dist/state.css.map +1 -0
  31. package/dist/theme/color.css +2 -0
  32. package/dist/theme/color.css.map +1 -0
  33. package/dist/theme/typography.css +2 -0
  34. package/dist/theme/typography.css.map +1 -0
  35. package/dist/theme.css +2 -0
  36. package/dist/theme.css.map +1 -0
  37. package/dist/utilities/alignment.css +2 -0
  38. package/dist/utilities/alignment.css.map +1 -0
  39. package/dist/utilities/color.css +2 -0
  40. package/dist/utilities/color.css.map +1 -0
  41. package/dist/utilities/display.css +2 -0
  42. package/dist/utilities/display.css.map +1 -0
  43. package/dist/utilities/flex.css +2 -0
  44. package/dist/utilities/flex.css.map +1 -0
  45. package/dist/utilities/inset.css +2 -0
  46. package/dist/utilities/inset.css.map +1 -0
  47. package/dist/utilities/justification.css +2 -0
  48. package/dist/utilities/justification.css.map +1 -0
  49. package/dist/utilities/list.css +2 -0
  50. package/dist/utilities/list.css.map +1 -0
  51. package/dist/utilities/postion.css +2 -0
  52. package/dist/utilities/postion.css.map +1 -0
  53. package/dist/utilities/spacing.css +2 -0
  54. package/dist/utilities/spacing.css.map +1 -0
  55. package/dist/utilities/typography.css +2 -0
  56. package/dist/utilities/typography.css.map +1 -0
  57. package/dist/utilities/visibility.css +2 -0
  58. package/dist/utilities/visibility.css.map +1 -0
  59. package/dist/utilities.css +2 -0
  60. package/dist/utilities.css.map +1 -0
  61. package/docs/.vitepress/config.js +41 -1
  62. package/docs/.vitepress/theme/custom.scss +29 -29
  63. package/docs/compiling-graupl.md +56 -0
  64. package/docs/introduction.md +5 -0
  65. package/index.html +333 -72
  66. package/package.json +16 -4
  67. package/postcss.config.cjs +1 -1
  68. package/scss/base/form.scss +3 -0
  69. package/scss/base/link.scss +3 -0
  70. package/scss/base/table.scss +3 -0
  71. package/scss/base.scss +3 -0
  72. package/scss/component/button.scss +3 -0
  73. package/scss/component/input-group.scss +3 -0
  74. package/scss/component/table.scss +3 -0
  75. package/scss/component.scss +3 -0
  76. package/scss/graupl.scss +1 -5
  77. package/scss/layout/columns.scss +3 -0
  78. package/scss/layout/container.scss +3 -0
  79. package/scss/layout.scss +3 -0
  80. package/scss/state/focus.scss +3 -0
  81. package/scss/state.scss +3 -0
  82. package/scss/theme/color.scss +3 -0
  83. package/scss/theme/typography.scss +3 -0
  84. package/scss/theme.scss +3 -0
  85. package/scss/utilities/alignment.scss +3 -0
  86. package/scss/utilities/color.scss +3 -0
  87. package/scss/utilities/display.scss +3 -0
  88. package/scss/utilities/flex.scss +3 -0
  89. package/scss/utilities/inset.scss +3 -0
  90. package/scss/utilities/justification.scss +3 -0
  91. package/scss/utilities/list.scss +3 -0
  92. package/scss/utilities/postion.scss +3 -0
  93. package/scss/utilities/spacing.scss +3 -0
  94. package/scss/utilities/typography.scss +3 -0
  95. package/scss/utilities/visibility.scss +3 -0
  96. package/scss/utilities.scss +3 -0
  97. package/{scss → src/scss}/_defaults.scss +40 -13
  98. package/src/scss/_index.scss +14 -0
  99. package/src/scss/_init.scss +3 -0
  100. package/{scss → src/scss}/_variables.scss +14 -24
  101. package/{scss → src/scss}/base/_index.scss +1 -0
  102. package/{scss → src/scss}/base/form/_defaults.scss +0 -2
  103. package/{scss → src/scss}/base/form/_index.scss +12 -0
  104. package/src/scss/base/form/_variables.scss +145 -0
  105. package/{scss → src/scss}/base/link/_defaults.scss +0 -2
  106. package/src/scss/base/link/_index.scss +50 -0
  107. package/src/scss/base/link/_variables.scss +36 -0
  108. package/src/scss/base/table/_defaults.scss +8 -0
  109. package/src/scss/base/table/_index.scss +27 -0
  110. package/src/scss/base/table/_variables.scss +65 -0
  111. package/{scss → src/scss}/component/_index.scss +2 -0
  112. package/src/scss/component/button/_defaults.scss +39 -0
  113. package/src/scss/component/button/_index.scss +134 -0
  114. package/src/scss/component/button/_variables.scss +132 -0
  115. package/src/scss/component/input-group/_defaults.scss +23 -0
  116. package/src/scss/component/input-group/_index.scss +45 -0
  117. package/src/scss/component/input-group/_variables.scss +63 -0
  118. package/src/scss/component/table/_defaults.scss +30 -0
  119. package/src/scss/component/table/_index.scss +77 -0
  120. package/src/scss/component/table/_variables.scss +64 -0
  121. package/src/scss/functions/_important.scss +11 -0
  122. package/src/scss/functions/_theme.scss +18 -0
  123. package/{scss → src/scss}/layout/columns/_defaults.scss +1 -4
  124. package/src/scss/layout/columns/_index.scss +36 -0
  125. package/src/scss/layout/columns/_variables.scss +47 -0
  126. package/{scss → src/scss}/layout/container/_defaults.scss +0 -2
  127. package/src/scss/layout/container/_index.scss +36 -0
  128. package/src/scss/layout/container/_variables.scss +47 -0
  129. package/{scss → src/scss}/mixins/_layer.scss +2 -2
  130. package/{scss → src/scss}/mixins/_media-queries.scss +11 -0
  131. package/{scss → src/scss}/state/focus/_defaults.scss +0 -2
  132. package/src/scss/state/focus/_variables.scss +40 -0
  133. package/src/scss/theme/_index.scss +4 -0
  134. package/src/scss/theme/color/_defaults.scss +61 -0
  135. package/src/scss/theme/color/_index.scss +42 -0
  136. package/src/scss/theme/color/_variables.scss +121 -0
  137. package/src/scss/theme/typography/_defaults.scss +52 -0
  138. package/src/scss/theme/typography/_index.scss +111 -0
  139. package/src/scss/theme/typography/_variables.scss +227 -0
  140. package/src/scss/utilities/_index.scss +13 -0
  141. package/src/scss/utilities/alignment/_defaults.scss +57 -0
  142. package/src/scss/utilities/alignment/_index.scss +29 -0
  143. package/src/scss/utilities/alignment/_variables.scss +3 -0
  144. package/src/scss/utilities/color/_defaults.scss +30 -0
  145. package/src/scss/utilities/color/_index.scss +38 -0
  146. package/src/scss/utilities/color/_variables.scss +3 -0
  147. package/src/scss/utilities/display/_defaults.scss +27 -0
  148. package/src/scss/utilities/display/_index.scss +15 -0
  149. package/src/scss/utilities/display/_variables.scss +3 -0
  150. package/src/scss/utilities/flex/_defaults.scss +58 -0
  151. package/src/scss/utilities/flex/_index.scss +36 -0
  152. package/src/scss/utilities/flex/_variables.scss +3 -0
  153. package/src/scss/utilities/inset/_defaults.scss +36 -0
  154. package/src/scss/utilities/inset/_index.scss +19 -0
  155. package/src/scss/utilities/inset/_variables.scss +3 -0
  156. package/src/scss/utilities/justification/_defaults.scss +54 -0
  157. package/src/scss/utilities/justification/_index.scss +29 -0
  158. package/src/scss/utilities/justification/_variables.scss +3 -0
  159. package/src/scss/utilities/list/_defaults.scss +34 -0
  160. package/src/scss/utilities/list/_index.scss +22 -0
  161. package/src/scss/utilities/list/_variables.scss +3 -0
  162. package/src/scss/utilities/position/_defaults.scss +21 -0
  163. package/src/scss/utilities/position/_index.scss +15 -0
  164. package/src/scss/utilities/position/_variables.scss +3 -0
  165. package/src/scss/utilities/spacing/_defaults.scss +44 -0
  166. package/src/scss/utilities/spacing/_index.scss +64 -0
  167. package/src/scss/utilities/spacing/_variables.scss +3 -0
  168. package/src/scss/utilities/typography/_defaults.scss +25 -0
  169. package/src/scss/utilities/typography/_index.scss +95 -0
  170. package/src/scss/utilities/typography/_variables.scss +3 -0
  171. package/src/scss/utilities/visibility/_defaults.scss +20 -0
  172. package/src/scss/utilities/visibility/_index.scss +15 -0
  173. package/src/scss/utilities/visibility/_variables.scss +3 -0
  174. package/stylelint.config.js +2 -0
  175. package/dist/base/form/form.css +0 -78
  176. package/dist/base/form/form.css.map +0 -1
  177. package/dist/base/link/link.css +0 -26
  178. package/dist/base/link/link.css.map +0 -1
  179. package/dist/component/button/button.css +0 -62
  180. package/dist/component/button/button.css.map +0 -1
  181. package/dist/layout/columns/columns.css +0 -41
  182. package/dist/layout/columns/columns.css.map +0 -1
  183. package/dist/layout/container/container.css +0 -38
  184. package/dist/layout/container/container.css.map +0 -1
  185. package/dist/state/focus/focus.css +0 -10
  186. package/dist/state/focus/focus.css.map +0 -1
  187. package/dist/theme/theme.css +0 -42
  188. package/dist/theme/theme.css.map +0 -1
  189. package/scss/base/form/_variables.scss +0 -133
  190. package/scss/base/form/form.scss +0 -3
  191. package/scss/base/link/_index.scss +0 -33
  192. package/scss/base/link/_variables.scss +0 -31
  193. package/scss/base/link/link.scss +0 -3
  194. package/scss/component/button/_defaults.scss +0 -10
  195. package/scss/component/button/_index.scss +0 -75
  196. package/scss/component/button/_variables.scss +0 -102
  197. package/scss/component/button/button.scss +0 -3
  198. package/scss/layout/columns/_index.scss +0 -38
  199. package/scss/layout/columns/_variables.scss +0 -24
  200. package/scss/layout/columns/columns.scss +0 -3
  201. package/scss/layout/container/_index.scss +0 -50
  202. package/scss/layout/container/_variables.scss +0 -26
  203. package/scss/layout/container/container.scss +0 -3
  204. package/scss/state/focus/_variables.scss +0 -36
  205. package/scss/state/focus/focus.scss +0 -3
  206. package/scss/theme/_defaults.scss +0 -56
  207. package/scss/theme/_index.scss +0 -53
  208. package/scss/theme/_variables.scss +0 -297
  209. package/scss/theme/theme.scss +0 -3
  210. /package/{scss → src/scss}/layout/_index.scss +0 -0
  211. /package/{scss → src/scss}/state/_index.scss +0 -0
  212. /package/{scss → src/scss}/state/focus/_index.scss +0 -0
@@ -0,0 +1,47 @@
1
+ // Variables referencing custom properties.
2
+
3
+ @use "defaults";
4
+ @use "../../variables" as root-variables;
5
+ @use "../../defaults" as root-defaults;
6
+ @use "sass:map";
7
+
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
+ );
16
+ $columns-count: var(
17
+ --#{root-defaults.$prefix}-columns-count,
18
+ #{defaults.$columns-count}
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. */
26
+ $columns-min-width: var(
27
+ --#{root-defaults.$prefix}-columns-min-width,
28
+ calc(
29
+ (
30
+ #{root-variables.$content-max-width} - #{$columns-column-gap} *
31
+ (#{$columns-count} - 1)
32
+ ) / #{$columns-count}
33
+ )
34
+ );
35
+ /* stylelint-enable scss/operator-no-newline-after */
36
+ $columns-max-width: var(
37
+ --#{root-defaults.$prefix}-columns-max-width,
38
+ #{defaults.$columns-max-width}
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
+ );
44
+ $columns-span: var(
45
+ --#{root-defaults.$prefix}-columns-span,
46
+ #{defaults.$columns-span}
47
+ );
@@ -4,7 +4,5 @@
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
  $container-breakout-width: 15ch !default;
10
8
  $container-feature-width: 20ch !default;
@@ -0,0 +1,36 @@
1
+ // Graupl Container layout.
2
+
3
+ @use "variables" as *;
4
+ @use "../../mixins/layer" as *;
5
+
6
+ @include layer(layout) {
7
+ .container,
8
+ .container > .full-width {
9
+ display: grid;
10
+ grid-template-columns:
11
+ [full-width-start] $container-full-width-section-width
12
+ [feature-start] $container-feature-section-width
13
+ [breakout-start] $container-breakout-section-width
14
+ [content-start] $container-content-section-width
15
+ [content-end]
16
+ $container-breakout-section-width [breakout-end]
17
+ $container-feature-section-width [feature-end]
18
+ $container-full-width-section-width [full-width-end];
19
+
20
+ > :not(.breakout, .full-width, .feature) {
21
+ grid-column: content;
22
+ }
23
+
24
+ .breakout {
25
+ grid-column: breakout;
26
+ }
27
+
28
+ .feature {
29
+ grid-column: feature;
30
+ }
31
+
32
+ .full-width {
33
+ grid-column: full-width;
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,47 @@
1
+ // Variables referencing custom properties.
2
+
3
+ @use "defaults";
4
+ @use "../../variables" as root-variables;
5
+ @use "../../defaults" as root-defaults;
6
+ @use "sass:map";
7
+
8
+ $container-gap: var(
9
+ --#{root-defaults.$prefix}-container-gap,
10
+ #{map.get(root-variables.$spacers, 5)}
11
+ );
12
+ $container-content-max-width: var(
13
+ --#{root-defaults.$prefix}-container-content-max-width,
14
+ #{root-variables.$content-max-width}
15
+ );
16
+ $container-breakout-max-width: var(
17
+ --#{root-defaults.$prefix}-container-breakout-max-width,
18
+ calc(#{$container-content-max-width} + #{defaults.$container-breakout-width})
19
+ );
20
+ $container-breakout-width: var(
21
+ --#{root-defaults.$prefix}-container-breakout-width,
22
+ calc((#{$container-breakout-max-width} - #{$container-content-max-width}) / 2)
23
+ );
24
+ $container-feature-max-width: var(
25
+ --#{root-defaults.$prefix}-container-feature-max-width,
26
+ calc(#{$container-breakout-max-width} + #{defaults.$container-feature-width})
27
+ );
28
+ $container-feature-width: var(
29
+ --#{root-defaults.$prefix}-container-feature-width,
30
+ calc((#{$container-feature-max-width} - #{$container-breakout-max-width}) / 2)
31
+ );
32
+ $container-content-section-width: var(
33
+ --#{root-defaults.$prefix}-container-content-section-width,
34
+ min(#{$container-content-max-width}, calc(100% - #{$container-gap} * 2))
35
+ );
36
+ $container-full-width-section-width: var(
37
+ --#{root-defaults.$prefix}-container-full-width-section-width,
38
+ minmax(#{$container-gap}, 1fr)
39
+ );
40
+ $container-breakout-section-width: var(
41
+ --#{root-defaults.$prefix}-container-breakout-section-width,
42
+ minmax(0, #{$container-breakout-width})
43
+ );
44
+ $container-feature-section-width: var(
45
+ --#{root-defaults.$prefix}-container-feature-section-width,
46
+ minmax(0, #{$container-feature-width})
47
+ );
@@ -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 base;
6
+ @use "../defaults" as root-defaults;
7
7
 
8
8
  @mixin layer($layer) {
9
9
  @at-root {
10
- @layer #{base.$prefix}.#{$layer} {
10
+ @layer #{root-defaults.$prefix}.#{$layer} {
11
11
  @content;
12
12
  }
13
13
  }
@@ -1,5 +1,8 @@
1
1
  // Media query mixins.
2
2
 
3
+ @use "../defaults" as root-defaults;
4
+ @use "sass:map";
5
+
3
6
  // A media query for targetting users who have not requested reduced motion.
4
7
  @mixin animation-on {
5
8
  @media (prefers-reduced-motion: no-preference) {
@@ -13,3 +16,11 @@
13
16
  @content;
14
17
  }
15
18
  }
19
+
20
+ @mixin screen($size) {
21
+ $screen-size: map.get(root-defaults.$screen-sizes, $size);
22
+
23
+ @media screen and #{$screen-size} {
24
+ @content;
25
+ }
26
+ }
@@ -4,7 +4,5 @@
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
  $focus-outline-style: dotted !default;
10
8
  $focus-box-shadow-style: inset !default;
@@ -0,0 +1,40 @@
1
+ // Variables referencing custom properties.
2
+
3
+ @use "../../variables" as root-variables;
4
+ @use "defaults";
5
+ @use "../../defaults" as root-defaults;
6
+ @use "../../functions/theme";
7
+
8
+ $focus-width: var(
9
+ --#{root-defaults.$prefix}-focus-width,
10
+ #{root-variables.$border-width}
11
+ );
12
+ $focus-outline-color: var(
13
+ --#{root-defaults.$prefix}-focus-outline-color,
14
+ #{theme.get(primary, 900)}
15
+ );
16
+ $focus-outline-width: var(
17
+ --#{root-defaults.$prefix}-focus-outline-width,
18
+ #{$focus-width}
19
+ );
20
+ $focus-outline-style: var(
21
+ --#{root-defaults.$prefix}-focus-outline-style,
22
+ #{defaults.$focus-outline-style}
23
+ );
24
+ $focus-outline-offset: var(
25
+ --#{root-defaults.$prefix}-focus-outline-offset,
26
+ calc(-1 * #{$focus-outline-width})
27
+ );
28
+ $focus-box-shadow-color: var(
29
+ --#{root-defaults.$prefix}-focus-box-shadow-color,
30
+ #{theme.get(primary, 100)}
31
+ );
32
+ $focus-box-shadow-style: var(
33
+ --#{root-defaults.$prefix}-focus-box-shadow-style,
34
+ #{defaults.$focus-box-shadow-style}
35
+ );
36
+ $focus-box-shadow: var(
37
+ --#{root-defaults.$prefix}-focus-box-shadow,
38
+ #{$focus-width $focus-width} 0 0 #{$focus-box-shadow-style} #{$focus-box-shadow-color},
39
+ 0 0 0 #{$focus-width} #{$focus-box-shadow-style} #{$focus-box-shadow-color}
40
+ );
@@ -0,0 +1,4 @@
1
+ // Graupl theme.
2
+
3
+ @forward "color";
4
+ @forward "typography";
@@ -0,0 +1,61 @@
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
+ @use "sass:map";
8
+
9
+ // Colours.
10
+ $default-colors: (
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%),
21
+ ),
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
+ ),
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%),
43
+ ),
44
+ );
45
+ $custom-colors: () !default;
46
+ $colors: map.merge($default-colors, $custom-colors);
47
+
48
+ // A map for reversing the shade values of the dark theme.
49
+ $base-dark-map: (
50
+ 100: 900,
51
+ 200: 800,
52
+ 300: 700,
53
+ 400: 600,
54
+ 500: 500,
55
+ 600: 400,
56
+ 700: 300,
57
+ 800: 200,
58
+ 900: 100,
59
+ );
60
+ $custom-dark-map: () !default;
61
+ $dark-map: map.merge($base-dark-map, $custom-dark-map);
@@ -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-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
+ }
@@ -0,0 +1,121 @@
1
+ // Variables referencing custom properties.
2
+
3
+ @use "defaults";
4
+ @use "../../defaults" as root-defaults;
5
+ @use "sass:map";
6
+
7
+ // A colour map of base colours and their shades.
8
+ $colors: ();
9
+
10
+ // Create a map for each colour.
11
+ @each $color, $map in defaults.$colors {
12
+ // A map for the current colour.
13
+ $color-map: ();
14
+
15
+ @each $shade, $value in $map {
16
+ // Set the custom prop name and fallback value.
17
+ $color-property: var(
18
+ --#{root-defaults.$prefix}-#{$color}--#{$shade},
19
+ $value
20
+ );
21
+
22
+ // Add the custom prop to the map.
23
+ $color-map: map.merge(
24
+ $color-map,
25
+ (
26
+ $shade: $color-property,
27
+ )
28
+ );
29
+ }
30
+
31
+ // Merge the colour map with the existing colours.
32
+ $colors: map.merge(
33
+ $colors,
34
+ (
35
+ $color: $color-map,
36
+ )
37
+ );
38
+ }
39
+
40
+ // Theme properties.
41
+ $theme-light: ();
42
+ $theme-dark: ();
43
+ $theme-active: ();
44
+
45
+ // Create a map for each colour theme.
46
+ @each $color, $map in $colors {
47
+ // Maps for the current colour theme variants.
48
+ $light-map: ();
49
+ $dark-map: ();
50
+ $active-map: ();
51
+
52
+ @each $shade, $value in $map {
53
+ // Get the dark shade and value.
54
+ $dark-shade: map.get(defaults.$dark-map, $shade);
55
+ $dark-value: map.get($map, $dark-shade);
56
+
57
+ // Set the custom prop names and fallback values.
58
+ $light-property: var(
59
+ --#{root-defaults.$prefix}-theme-light--#{$color}--#{$shade},
60
+ $value
61
+ );
62
+ $dark-property: var(
63
+ --#{root-defaults.$prefix}-theme-dark--#{$color}--#{$shade},
64
+ $dark-value
65
+ );
66
+ $active-property: var(
67
+ --#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade},
68
+ $light-property
69
+ );
70
+
71
+ // Add the custom props to the maps.
72
+ $light-map: map.merge(
73
+ $light-map,
74
+ (
75
+ $shade: $light-property,
76
+ )
77
+ );
78
+ $dark-map: map.merge(
79
+ $dark-map,
80
+ (
81
+ $shade: $dark-property,
82
+ )
83
+ );
84
+ $active-map: map.merge(
85
+ $active-map,
86
+ (
87
+ $shade: $active-property,
88
+ )
89
+ );
90
+ }
91
+
92
+ // Merge the theme maps with the existing themes.
93
+ $theme-light: map.merge(
94
+ $theme-light,
95
+ (
96
+ $color: $light-map,
97
+ )
98
+ );
99
+ $theme-dark: map.merge(
100
+ $theme-dark,
101
+ (
102
+ $color: $dark-map,
103
+ )
104
+ );
105
+ $theme-active: map.merge(
106
+ $theme-active,
107
+ (
108
+ $color: $active-map,
109
+ )
110
+ );
111
+ }
112
+
113
+ // Colour properties.
114
+ $root-color: var(
115
+ --#{root-defaults.$prefix}-root-color,
116
+ #{map.get(map.get($theme-active, primary), 900)}
117
+ );
118
+ $root-background: var(
119
+ --#{root-defaults.$prefix}-root-background,
120
+ #{map.get(map.get($theme-active, primary), 100)}
121
+ );
@@ -0,0 +1,52 @@
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
+ @use "sass:map";
8
+
9
+ // font properties.
10
+ $font-size: 1rem !default;
11
+ $root-font-size: clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem) !default;
12
+ $line-height: 1.2em !default;
13
+
14
+ // Multipliers for font sizes.
15
+ // This uses a minor third scale.
16
+ // 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
17
+ $base-font-size-multipliers: (
18
+ xs: 0.694,
19
+ sm: 0.833,
20
+ base: 1,
21
+ lg: 1.2,
22
+ xl: 1.44,
23
+ 2xl: 1.728,
24
+ 3xl: 2.074,
25
+ 4xl: 2.488,
26
+ 5xl: 2.986,
27
+ );
28
+ $custom-font-size-multipliers: () !default;
29
+ $font-size-multipliers: map.merge(
30
+ $base-font-size-multipliers,
31
+ $custom-font-size-multipliers
32
+ );
33
+
34
+ // Weights.
35
+ $base-font-weights: (
36
+ light: 300,
37
+ normal: 400,
38
+ bold: 700,
39
+ );
40
+ $custom-font-weights: () !default;
41
+ $font-weights: map.merge($base-font-weights, $custom-font-weights);
42
+
43
+ /* stylelint-disable-next-line scss/dollar-variable-colon-space-after */
44
+ $root-font-family:
45
+ system-ui,
46
+ -apple-system,
47
+ blinkmacsystemfont,
48
+ "Segoe UI",
49
+ roboto,
50
+ "Helvetica Neue",
51
+ arial,
52
+ sans-serif !default;
@@ -0,0 +1,111 @@
1
+ // Typography theme styles.
2
+
3
+ @use "variables" as *;
4
+ @use "../../mixins/layer" as *;
5
+ @use "sass:map";
6
+
7
+ @include layer(base) {
8
+ p {
9
+ margin: $paragraph-margin;
10
+ }
11
+
12
+ small {
13
+ margin: $small-margin;
14
+ }
15
+
16
+ h1 {
17
+ margin: $h1-margin;
18
+ }
19
+
20
+ h2 {
21
+ margin: $h2-margin;
22
+ }
23
+
24
+ h3 {
25
+ margin: $h3-margin;
26
+ }
27
+
28
+ h4 {
29
+ margin: $h4-margin;
30
+ }
31
+
32
+ h5 {
33
+ margin: $h5-margin;
34
+ }
35
+
36
+ h6 {
37
+ margin: $h6-margin;
38
+ }
39
+ }
40
+
41
+ @include layer(theme) {
42
+ :root {
43
+ font-family: $root-font-family;
44
+ font-size: $root-font-size;
45
+ }
46
+
47
+ b,
48
+ strong {
49
+ font-weight: $font-weight-bold;
50
+ }
51
+
52
+ body {
53
+ font-size: $body-font-size;
54
+ font-weight: $body-font-weight;
55
+ line-height: $body-line-height;
56
+ }
57
+
58
+ p {
59
+ font-size: $paragraph-font-size;
60
+ font-weight: $paragraph-font-weight;
61
+ line-height: $paragraph-line-height;
62
+ }
63
+
64
+ small {
65
+ font-size: $small-font-size;
66
+ font-weight: $small-font-weight;
67
+ line-height: $small-line-height;
68
+ }
69
+
70
+ h1 {
71
+ font-family: $h1-font-family;
72
+ font-size: $h1-font-size;
73
+ font-weight: $h1-font-weight;
74
+ line-height: $h1-line-height;
75
+ }
76
+
77
+ h2 {
78
+ font-family: $h2-font-family;
79
+ font-size: $h2-font-size;
80
+ font-weight: $h2-font-weight;
81
+ line-height: $h2-line-height;
82
+ }
83
+
84
+ h3 {
85
+ font-family: $h3-font-family;
86
+ font-size: $h3-font-size;
87
+ font-weight: $h3-font-weight;
88
+ line-height: $h3-line-height;
89
+ }
90
+
91
+ h4 {
92
+ font-family: $h4-font-family;
93
+ font-size: $h4-font-size;
94
+ font-weight: $h4-font-weight;
95
+ line-height: $h4-line-height;
96
+ }
97
+
98
+ h5 {
99
+ font-family: $h5-font-family;
100
+ font-size: $h5-font-size;
101
+ font-weight: $h5-font-weight;
102
+ line-height: $h5-line-height;
103
+ }
104
+
105
+ h6 {
106
+ font-family: $h6-font-family;
107
+ font-size: $h6-font-size;
108
+ font-weight: $h6-font-weight;
109
+ line-height: $h6-line-height;
110
+ }
111
+ }