@graupl/graupl 1.0.0-alpha.12 → 1.0.0-alpha.13

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 (88) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/base/button.css +1 -1
  3. package/dist/base/button.css.map +1 -1
  4. package/dist/base/form.css +1 -1
  5. package/dist/base/form.css.map +1 -1
  6. package/dist/base/link.css +1 -1
  7. package/dist/base/link.css.map +1 -1
  8. package/dist/base/table.css +1 -1
  9. package/dist/base/table.css.map +1 -1
  10. package/dist/base.css +1 -1
  11. package/dist/base.css.map +1 -1
  12. package/dist/component/card.css +2 -0
  13. package/dist/component/card.css.map +1 -0
  14. package/dist/component/input-group.css +1 -1
  15. package/dist/component/input-group.css.map +1 -1
  16. package/dist/component/menu.css +2 -0
  17. package/dist/component/menu.css.map +1 -0
  18. package/dist/component/navigation.css +2 -0
  19. package/dist/component/navigation.css.map +1 -0
  20. package/dist/component.css +1 -1
  21. package/dist/component.css.map +1 -1
  22. package/dist/graupl.css +1 -1
  23. package/dist/graupl.css.map +1 -1
  24. package/dist/layout/columns.css +1 -1
  25. package/dist/layout/columns.css.map +1 -1
  26. package/dist/layout/flex-columns.css +2 -0
  27. package/dist/layout/flex-columns.css.map +1 -0
  28. package/dist/layout.css +1 -1
  29. package/dist/layout.css.map +1 -1
  30. package/dist/theme/typography.css +1 -1
  31. package/dist/theme/typography.css.map +1 -1
  32. package/dist/theme.css +1 -1
  33. package/dist/theme.css.map +1 -1
  34. package/dist/utilities/order.css +2 -0
  35. package/dist/utilities/order.css.map +1 -0
  36. package/dist/utilities/spacing.css +1 -1
  37. package/dist/utilities/spacing.css.map +1 -1
  38. package/dist/utilities/typography.css +1 -1
  39. package/dist/utilities/typography.css.map +1 -1
  40. package/dist/utilities.css +1 -1
  41. package/dist/utilities.css.map +1 -1
  42. package/eslint.config.js +1 -0
  43. package/index.html +619 -325
  44. package/package.json +1 -1
  45. package/scss/component/card.scss +3 -0
  46. package/scss/component/menu.scss +3 -0
  47. package/scss/component/navigation.scss +3 -0
  48. package/scss/layout/flex-columns.scss +3 -0
  49. package/scss/utilities/order.scss +3 -0
  50. package/src/js/navigation.js +34 -0
  51. package/src/scss/_defaults.scss +15 -1
  52. package/src/scss/base/button/_defaults.scss +8 -3
  53. package/src/scss/base/button/_index.scss +99 -36
  54. package/src/scss/base/button/_variables.scss +43 -11
  55. package/src/scss/base/form/_index.scss +2 -4
  56. package/src/scss/base/form/_variables.scss +8 -0
  57. package/src/scss/base/link/_defaults.scss +37 -6
  58. package/src/scss/base/link/_index.scss +72 -12
  59. package/src/scss/base/link/_variables.scss +175 -18
  60. package/src/scss/base/table/_index.scss +2 -4
  61. package/src/scss/base/table/_variables.scss +8 -0
  62. package/src/scss/component/_index.scss +3 -0
  63. package/src/scss/component/card/_defaults.scss +29 -0
  64. package/src/scss/component/card/_index.scss +143 -0
  65. package/src/scss/component/card/_variables.scss +185 -0
  66. package/src/scss/component/menu/_defaults.scss +65 -0
  67. package/src/scss/component/menu/_index.scss +304 -0
  68. package/src/scss/component/menu/_variables.scss +491 -0
  69. package/src/scss/component/navigation/_defaults.scss +29 -0
  70. package/src/scss/component/navigation/_index.scss +189 -0
  71. package/src/scss/component/navigation/_variables.scss +237 -0
  72. package/src/scss/functions/_theme.scss +16 -0
  73. package/src/scss/layout/_index.scss +1 -0
  74. package/src/scss/layout/columns/_index.scss +22 -0
  75. package/src/scss/layout/flex-columns/_defaults.scss +18 -0
  76. package/src/scss/layout/flex-columns/_index.scss +77 -0
  77. package/src/scss/layout/flex-columns/_variables.scss +26 -0
  78. package/src/scss/mixins/_media-queries.scss +8 -0
  79. package/src/scss/theme/typography/_defaults.scss +1 -1
  80. package/src/scss/theme/typography/_variables.scss +5 -2
  81. package/src/scss/utilities/_index.scss +2 -0
  82. package/src/scss/utilities/order/_defaults.scss +19 -0
  83. package/src/scss/utilities/order/_index.scss +35 -0
  84. package/src/scss/utilities/order/_variables.scss +6 -0
  85. package/src/scss/utilities/ratio/_defaults.scss +24 -0
  86. package/src/scss/utilities/ratio/_index.scss +26 -0
  87. package/src/scss/utilities/ratio/_variables.scss +9 -0
  88. package/src/scss/utilities/spacing/_index.scss +33 -16
@@ -0,0 +1,237 @@
1
+ // @graupl/graupl navigation component variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";
7
+ @use "../../defaults" as root-defaults;
8
+ @use "../../variables" as root-variables;
9
+ @use "../../theme/color/variables" as color;
10
+ @use "../../theme/typography/variables" as typography;
11
+ @use "sass:map";
12
+
13
+ // Navigation colors.
14
+ $navigation-background: var(
15
+ --#{root-defaults.$prefix}-navigation-background,
16
+ #{color.$root-background}
17
+ );
18
+ $navigation-color: var(
19
+ --#{root-defaults.$prefix}-navigation-color,
20
+ #{color.$root-color}
21
+ );
22
+
23
+ // Navigation toggle size.
24
+ $navigation-toggle-min-width: var(
25
+ --#{root-defaults.$prefix}-navigation-toggle-min-width,
26
+ #{root-defaults.$interactive-min-width}
27
+ );
28
+ $navigation-toggle-min-height: var(
29
+ --#{root-defaults.$prefix}-navigation-toggle-min-height,
30
+ #{root-defaults.$interactive-min-height}
31
+ );
32
+
33
+ // Navigation toggle spacing.
34
+ $navigation-toggle-padding-x: var(
35
+ --#{root-defaults.$prefix}-navigation-toggle-padding-x,
36
+ #{map.get(root-variables.$spacers, 5)}
37
+ );
38
+ $navigation-toggle-padding-y: var(
39
+ --#{root-defaults.$prefix}-navigation-toggle-padding-y,
40
+ #{map.get(root-variables.$spacers, 3)}
41
+ );
42
+ $navigation-toggle-padding: var(
43
+ --#{root-defaults.$prefix}-navigation-toggle-padding,
44
+ #{$navigation-toggle-padding-y} #{$navigation-toggle-padding-x}
45
+ );
46
+
47
+ // Navigation toggle colors.
48
+ $navigation-toggle-background: var(
49
+ --#{root-defaults.$prefix}-navigation-toggle-background,
50
+ #{$navigation-background}
51
+ );
52
+ $navigation-toggle-color: var(
53
+ --#{root-defaults.$prefix}-navigation-toggle-color,
54
+ #{$navigation-color}
55
+ );
56
+ $navigation-toggle-hover-background: var(
57
+ --#{root-defaults.$prefix}-navigation-toggle-hover-background,
58
+ #{$navigation-color}
59
+ );
60
+ $navigation-toggle-hover-color: var(
61
+ --#{root-defaults.$prefix}-navigation-toggle-hover-color,
62
+ #{$navigation-background}
63
+ );
64
+
65
+ // Navigation toggle border properties.
66
+ $navigation-toggle-border-width: var(
67
+ --#{root-defaults.$prefix}-navigation-toggle-border-width,
68
+ #{root-variables.$border-width}
69
+ );
70
+ $navigation-toggle-border-style: var(
71
+ --#{root-defaults.$prefix}-navigation-toggle-border-style,
72
+ #{root-variables.$border-style}
73
+ );
74
+ $navigation-toggle-border: var(
75
+ --#{root-defaults.$prefix}-navigation-toggle-border,
76
+ #{$navigation-toggle-border-width} #{$navigation-toggle-border-style}
77
+ );
78
+ $navigation-toggle-border-color: var(
79
+ --#{root-defaults.$prefix}-navigation-toggle-border-color,
80
+ #{$navigation-toggle-color}
81
+ );
82
+ $navigation-toggle-border-radius: var(
83
+ --#{root-defaults.$prefix}-navigation-toggle-border-radius,
84
+ #{root-variables.$border-radius}
85
+ );
86
+
87
+ // Navigation branding properties.
88
+ $navigation-branding-font-size: var(
89
+ --#{root-defaults.$prefix}-navigation-branding-font-size,
90
+ #{map.get(typography.$font-sizes, "lg")}
91
+ );
92
+ $navigation-branding-font-weight: var(
93
+ --#{root-defaults.$prefix}-navigation-branding-font-weight,
94
+ #{typography.$font-weight-bold}
95
+ );
96
+ $navigation-branding-padding-x: var(
97
+ --#{root-defaults.$prefix}-navigation-branding-padding-x,
98
+ #{map.get(root-variables.$spacers, 3)}
99
+ );
100
+ $navigation-branding-padding-y: var(
101
+ --#{root-defaults.$prefix}-navigation-branding-padding-y,
102
+ #{map.get(root-variables.$spacers, 2)}
103
+ );
104
+ $navigation-branding-padding: var(
105
+ --#{root-defaults.$prefix}-navigation-branding-padding,
106
+ #{$navigation-branding-padding-y} #{$navigation-branding-padding-x}
107
+ );
108
+
109
+ // Navigation branding colors.
110
+ $navigation-branding-color: var(
111
+ --#{root-defaults.$prefix}-navigation-branding-color,
112
+ #{$navigation-color}
113
+ );
114
+ $navigation-branding-visited-color: var(
115
+ --#{root-defaults.$prefix}-navigation-branding-visited-color,
116
+ #{$navigation-color}
117
+ );
118
+ $navigation-branding-focus-color: var(
119
+ --#{root-defaults.$prefix}-navigation-branding-focus-color,
120
+ #{$navigation-color}
121
+ );
122
+ $navigation-branding-hover-color: var(
123
+ --#{root-defaults.$prefix}-navigation-branding-hover-color,
124
+ #{$navigation-color}
125
+ );
126
+ $navigation-branding-active-color: var(
127
+ --#{root-defaults.$prefix}-navigation-branding-active-color,
128
+ #{$navigation-color}
129
+ );
130
+ $navigation-branding-disabled-color: var(
131
+ --#{root-defaults.$prefix}-navigation-branding-disabled-color,
132
+ #{$navigation-color}
133
+ );
134
+
135
+ // Navigation branding text decoration properties.
136
+ $navigation-branding-text-decoration: var(
137
+ --#{root-defaults.$prefix}-navigation-branding-text-decoration,
138
+ #{defaults.$navigation-branding-text-decoration}
139
+ );
140
+ $navigation-branding-visited-text-decoration: var(
141
+ --#{root-defaults.$prefix}-navigation-branding-visited-text-decoration,
142
+ #{defaults.$navigation-branding-visited-text-decoration}
143
+ );
144
+ $navigation-branding-focus-text-decoration: var(
145
+ --#{root-defaults.$prefix}-navigation-branding-focus-text-decoration,
146
+ #{defaults.$navigation-branding-focus-text-decoration}
147
+ );
148
+ $navigation-branding-hover-text-decoration: var(
149
+ --#{root-defaults.$prefix}-navigation-branding-hover-text-decoration,
150
+ #{defaults.$navigation-branding-hover-text-decoration}
151
+ );
152
+ $navigation-branding-active-text-decoration: var(
153
+ --#{root-defaults.$prefix}-navigation-branding-active-text-decoration,
154
+ #{defaults.$navigation-branding-active-text-decoration}
155
+ );
156
+ $navigation-branding-disabled-text-decoration: var(
157
+ --#{root-defaults.$prefix}-navigation-branding-disabled-text-decoration,
158
+ #{defaults.$navigation-branding-disabled-text-decoration}
159
+ );
160
+ $navigation-branding-text-decoration-style: var(
161
+ --#{root-defaults.$prefix}-navigation-branding-text-decoration-style,
162
+ #{defaults.$navigation-branding-text-decoration-style}
163
+ );
164
+ $navigation-branding-visited-text-decoration-style: var(
165
+ --#{root-defaults.$prefix}-navigation-branding-visited-text-decoration-style,
166
+ #{defaults.$navigation-branding-visited-text-decoration-style}
167
+ );
168
+ $navigation-branding-focus-text-decoration-style: var(
169
+ --#{root-defaults.$prefix}-navigation-branding-focus-text-decoration-style,
170
+ #{defaults.$navigation-branding-focus-text-decoration-style}
171
+ );
172
+ $navigation-branding-hover-text-decoration-style: var(
173
+ --#{root-defaults.$prefix}-navigation-branding-hover-text-decoration-style,
174
+ #{defaults.$navigation-branding-hover-text-decoration-style}
175
+ );
176
+ $navigation-branding-active-text-decoration-style: var(
177
+ --#{root-defaults.$prefix}-navigation-branding-active-text-decoration-style,
178
+ #{defaults.$navigation-branding-active-text-decoration-style}
179
+ );
180
+ $navigation-branding-disabled-text-decoration-style: var(
181
+ --#{root-defaults.$prefix}-navigation-branding-disabled-text-decoration-style,
182
+ #{defaults.$navigation-branding-disabled-text-decoration-style}
183
+ );
184
+ $navigation-branding-text-decoration-thickness: var(
185
+ --#{root-defaults.$prefix}-navigation-branding-text-decoration-thickness,
186
+ #{root-variables.$border-width}
187
+ );
188
+ $navigation-branding-visited-text-decoration-thickness: var(
189
+ --#{root-defaults.$prefix}-navigation-branding-visited-text-decoration-thickness,
190
+ #{root-variables.$border-width}
191
+ );
192
+ $navigation-branding-focus-text-decoration-thickness: var(
193
+ --#{root-defaults.$prefix}-navigation-branding-focus-text-decoration-thickness,
194
+ #{root-variables.$border-width}
195
+ );
196
+ $navigation-branding-hover-text-decoration-thickness: var(
197
+ --#{root-defaults.$prefix}-navigation-branding-hover-text-decoration-thickness,
198
+ #{root-variables.$border-width}
199
+ );
200
+ $navigation-branding-active-text-decoration-thickness: var(
201
+ --#{root-defaults.$prefix}-navigation-branding-active-text-decoration-thickness,
202
+ #{root-variables.$border-width}
203
+ );
204
+ $navigation-branding-disabled-text-decoration-thickness: var(
205
+ --#{root-defaults.$prefix}-navigation-branding-disabled-text-decoration-thickness,
206
+ #{root-variables.$border-width}
207
+ );
208
+ $navigation-branding-text-decoration-color: var(
209
+ --#{root-defaults.$prefix}-navigation-branding-text-decoration-color,
210
+ #{$navigation-branding-color}
211
+ );
212
+ $navigation-branding-visited-text-decoration-color: var(
213
+ --#{root-defaults.$prefix}-navigation-branding-visited-text-decoration-color,
214
+ #{$navigation-branding-visited-color}
215
+ );
216
+ $navigation-branding-focus-text-decoration-color: var(
217
+ --#{root-defaults.$prefix}-navigation-branding-focus-text-decoration-color,
218
+ #{$navigation-branding-focus-color}
219
+ );
220
+ $navigation-branding-hover-text-decoration-color: var(
221
+ --#{root-defaults.$prefix}-navigation-branding-hover-text-decoration-color,
222
+ #{$navigation-branding-hover-color}
223
+ );
224
+ $navigation-branding-active-text-decoration-color: var(
225
+ --#{root-defaults.$prefix}-navigation-branding-active-text-decoration-color,
226
+ #{$navigation-branding-active-color}
227
+ );
228
+ $navigation-branding-disabled-text-decoration-color: var(
229
+ --#{root-defaults.$prefix}-navigation-branding-disabled-text-decoration-color,
230
+ #{$navigation-branding-disabled-color}
231
+ );
232
+
233
+ // Navigation toggle properties.
234
+ $navigation-toggle-content: var(
235
+ --#{root-defaults.$prefix}-navigation-toggle-content,
236
+ #{defaults.$navigation-toggle-content}
237
+ );
@@ -7,6 +7,22 @@
7
7
 
8
8
  // A function to get the specific theme shades.
9
9
  @function get($color, $shade) {
10
+ @if $shade == transparent or $color == transparent {
11
+ @return transparent;
12
+ }
13
+
14
+ @if $shade == none or $color == none {
15
+ @return none;
16
+ }
17
+
18
+ @if $shade == inherit or $color == inherit {
19
+ @return inherit;
20
+ }
21
+
22
+ @if $shade == initial or $color == initial {
23
+ @return initial;
24
+ }
25
+
10
26
  $color-map: map.get(color.$theme-active, $color);
11
27
  $value: map.get($color-map, $shade);
12
28
 
@@ -2,3 +2,4 @@
2
2
 
3
3
  @forward "container";
4
4
  @forward "columns";
5
+ @forward "flex-columns";
@@ -20,6 +20,14 @@
20
20
  @for $i from defaults.$columns-min-count through defaults.$columns-max-count {
21
21
  #{defaults.$columns-count-selector-prefix}#{$i} {
22
22
  --#{root-defaults.$prefix}-columns-count: #{$i};
23
+
24
+ // For span values bigger than the actual column count, set them to the
25
+ // maximum column count so they don't break the layout.
26
+ @for $j from $i + 1 through defaults.$columns-max-count {
27
+ #{defaults.$columns-span-selector-prefix}#{$j} {
28
+ --#{root-defaults.$prefix}-columns-span: #{$i};
29
+ }
30
+ }
23
31
  }
24
32
 
25
33
  #{defaults.$columns-span-selector-prefix}#{$i} {
@@ -31,6 +39,20 @@
31
39
  @include screen(xs) {
32
40
  #{defaults.$columns-selector} {
33
41
  --#{root-defaults.$prefix}-columns-min-width: #{defaults.$columns-max-width};
42
+
43
+ > * {
44
+ --#{root-defaults.$prefix}-columns-span: 1;
45
+ }
46
+
47
+ // All spans should be set to 1 to avoid adding columns.
48
+ @for $i
49
+ from defaults.$columns-min-count
50
+ through defaults.$columns-max-count
51
+ {
52
+ #{defaults.$columns-span-selector-prefix}#{$i} {
53
+ --#{root-defaults.$prefix}-columns-span: 1;
54
+ }
55
+ }
34
56
  }
35
57
  }
36
58
  }
@@ -0,0 +1,18 @@
1
+ // @graupl/graupl flex columns layout default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ // Flex columns selectors.
10
+ $flex-columns-selector: ".flex-columns" !default;
11
+ $flex-columns-column-selector-prefix: ".col-" !default;
12
+ $flex-columns-fill-selector: ".fill" !default;
13
+
14
+ // Flex columns properties.
15
+ $flex-columns-min-count: 1 !default;
16
+ $flex-columns-max-count: 12 !default;
17
+ $flex-columns-size: auto !default;
18
+ $flex-columns-max-width: unset !default;
@@ -0,0 +1,77 @@
1
+ // @gruapl/graupl flex columns layout styles.
2
+
3
+ @use "variables" as *;
4
+ @use "defaults";
5
+ @use "../../defaults" as root-defaults;
6
+ @use "../../mixins/layer" as *;
7
+ @use "../../mixins/media-queries" as *;
8
+
9
+ @include layer(layout) {
10
+ // Flex columns.
11
+ #{defaults.$flex-columns-selector} {
12
+ display: flex;
13
+ flex-wrap: wrap;
14
+ gap: $flex-columns-row-gap $flex-columns-column-gap;
15
+
16
+ > * {
17
+ flex: 1 1 $flex-columns-size;
18
+ max-width: $flex-columns-max-width;
19
+ }
20
+
21
+ #{defaults.$flex-columns-fill-selector} {
22
+ --#{root-defaults.$prefix}-flex-columns-max-width: unset;
23
+ }
24
+ }
25
+
26
+ @for $i
27
+ from defaults.$flex-columns-min-count
28
+ through defaults.$flex-columns-max-count
29
+ {
30
+ #{defaults.$flex-columns-column-selector-prefix}#{$i} {
31
+ /* stylelint-disable scss/operator-no-newline-after -- Prettier wants to format it this way. */
32
+ --#{root-defaults.$prefix}-flex-columns-size: calc(
33
+ (100% / #{defaults.$flex-columns-max-count} * #{$i}) -
34
+ #{$flex-columns-column-gap}
35
+ );
36
+ --#{root-defaults.$prefix}-flex-columns-max-width: calc(
37
+ 100% / #{defaults.$flex-columns-max-count} * #{$i}
38
+ );
39
+ /* stylelint-enable scss/operator-no-newline-after */
40
+ }
41
+
42
+ @include screen(xs) {
43
+ #{defaults.$flex-columns-column-selector-prefix}#{$i} {
44
+ --#{root-defaults.$prefix}-flex-columns-size: 100%;
45
+ --#{root-defaults.$prefix}-flex-columns-max-width: auto;
46
+ }
47
+ }
48
+ }
49
+
50
+ @each $screen, $query in root-defaults.$screen-sizes {
51
+ @for $i
52
+ from defaults.$flex-columns-min-count
53
+ through defaults.$flex-columns-max-count
54
+ {
55
+ // For the screen-specific sizes, we can't use custom properties.
56
+ // It appears that custom properties that are already set, cannot be overwritten
57
+ // inside of a media query.
58
+ //
59
+ // If you do something like `.col-6 .col-lg-3`, the custom properties will only ever
60
+ // be set to the `.col-6` value.
61
+ @include screen($screen) {
62
+ #{defaults.$flex-columns-column-selector-prefix}#{$screen}-#{$i} {
63
+ --#{root-defaults.$prefix}-flex-columns-size: calc(
64
+ (100% / #{defaults.$flex-columns-max-count} * #{$i}) - #{$flex-columns-column-gap}
65
+ );
66
+ --#{root-defaults.$prefix}-flex-columns-max-width: calc(
67
+ 100% / #{defaults.$flex-columns-max-count} * #{$i}
68
+ );
69
+
70
+ &#{defaults.$flex-columns-fill-selector} {
71
+ --#{root-defaults.$prefix}-flex-columns-max-width: unset;
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,26 @@
1
+ // @graupl/graupl flex columns layout variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";
7
+ @use "../../defaults" as root-defaults;
8
+ @use "../columns/variables" as columns-variables;
9
+
10
+ // Flex columns properties.
11
+ $flex-columns-row-gap: var(
12
+ --#{root-defaults.$prefix}-flex-columns-row-gap,
13
+ #{columns-variables.$columns-row-gap}
14
+ );
15
+ $flex-columns-column-gap: var(
16
+ --#{root-defaults.$prefix}-flex-columns-column-gap,
17
+ #{columns-variables.$columns-column-gap}
18
+ );
19
+ $flex-columns-size: var(
20
+ --#{root-defaults.$prefix}-flex-columns-size,
21
+ #{defaults.$flex-columns-size}
22
+ );
23
+ $flex-columns-max-width: var(
24
+ --#{root-defaults.$prefix}-flex-columns-max-width,
25
+ #{defaults.$flex-columns-max-width}
26
+ );
@@ -25,3 +25,11 @@
25
25
  @content;
26
26
  }
27
27
  }
28
+
29
+ @mixin screen-trigger($size) {
30
+ $screen-size-trigger: map.get(root-defaults.$screen-size-triggers, $size);
31
+
32
+ @media screen and #{$screen-size-trigger} {
33
+ @content;
34
+ }
35
+ }
@@ -9,7 +9,7 @@
9
9
  @use "sass:map";
10
10
 
11
11
  // font properties.
12
- $font-size: 1rem !default;
12
+ $font-size-base: 1rem !default;
13
13
  $root-font-size: clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem) !default;
14
14
  $line-height: 1.2em !default;
15
15
 
@@ -9,7 +9,10 @@
9
9
  @use "sass:map";
10
10
 
11
11
  // Font properties.
12
- $font-size: var(--#{root-defaults.$prefix}-font-base, #{defaults.$font-size});
12
+ $font-size-base: var(
13
+ --#{root-defaults.$prefix}-font-size-base,
14
+ #{defaults.$font-size-base}
15
+ );
13
16
  $line-height: var(
14
17
  --#{root-defaults.$prefix}-line-height,
15
18
  #{defaults.$line-height}
@@ -21,7 +24,7 @@ $font-sizes: ();
21
24
  @each $key, $value in defaults.$font-size-multipliers {
22
25
  $size: var(
23
26
  --#{root-defaults.$prefix}-font-#{$key},
24
- calc(#{$value} * #{$font-size})
27
+ calc(#{$value} * #{$font-size-base})
25
28
  );
26
29
  $font-sizes: map.set($font-sizes, $key, $size);
27
30
  }
@@ -7,7 +7,9 @@
7
7
  @forward "inset";
8
8
  @forward "justification";
9
9
  @forward "list";
10
+ @forward "order";
10
11
  @forward "position";
12
+ @forward "ratio";
11
13
  @forward "spacing";
12
14
  @forward "typography";
13
15
  @forward "visibility";
@@ -0,0 +1,19 @@
1
+ // @graupl/graupl order utilities default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ @use "sass:map";
10
+
11
+ // Order properties.
12
+ $order-class-prefix: "order-" !default;
13
+ $base-order-properties: (
14
+ "none": 0,
15
+ "first": -9999,
16
+ "last": 9999,
17
+ );
18
+ $custom-order-properties: () !default;
19
+ $order-properties: map.merge($base-order-properties, $custom-order-properties);
@@ -0,0 +1,35 @@
1
+ // @gruapl/graupl order utilities styles.
2
+
3
+ @use "variables" as *;
4
+ @use "defaults" as defaults;
5
+ @use "../../layout/columns/defaults" as columns-defaults;
6
+ @use "../../layout/flex-columns/defaults" as flex-columns-defaults;
7
+ @use "../../mixins/layer" as *;
8
+ @use "../../functions/important";
9
+
10
+ @include layer(utilities) {
11
+ @each $order-property, $order-value in $order-properties {
12
+ .#{$order-class-prefix}#{$order-property} {
13
+ order: $order-value;
14
+ }
15
+ }
16
+
17
+ $order-max-count: 0;
18
+
19
+ /* stylelint-disable scss/operator-no-newline-after -- Prettier wants to format it this way. */
20
+ @if (
21
+ columns-defaults.$columns-max-count >
22
+ flex-columns-defaults.$flex-columns-max-count
23
+ ) {
24
+ $order-max-count: columns-defaults.$columns-max-count;
25
+ } @else {
26
+ $order-max-count: flex-columns-defaults.$flex-columns-max-count;
27
+ }
28
+ /* stylelint-enable scss/operator-no-newline-after */
29
+
30
+ @for $i from 1 through $order-max-count {
31
+ .#{$order-class-prefix}#{$i} {
32
+ order: $i;
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/graupl order utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @forward "defaults";
@@ -0,0 +1,24 @@
1
+ // @graupl/graupl ratio utilities default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ @use "sass:map";
10
+
11
+ // Ratio utilities.
12
+ $ratio-selector: ".ratio" !default;
13
+ $ratio-variant-selector-prefix: "." !default;
14
+ $base-ratios: (
15
+ "one-by-one": 100%,
16
+ "two-by-one": 50%,
17
+ "four-by-three": 75%,
18
+ "four-by-one": 25%,
19
+ "sixteen-by-nine": calc(9 / 16 * 100%),
20
+ "three-by-two": calc(2 / 3 * 100%),
21
+ "eight-by-five": calc(5 / 8 * 100%),
22
+ );
23
+ $custom-ratios: () !default;
24
+ $ratios: map.merge($base-ratios, $custom-ratios);
@@ -0,0 +1,26 @@
1
+ // @gruapl/graupl ratio utilities styles.
2
+
3
+ @use "variables" as *;
4
+ @use "defaults" as defaults;
5
+ @use "../../defaults" as root-defaults;
6
+ @use "../../mixins/layer" as *;
7
+ @use "../../functions/important";
8
+
9
+ @include layer(utilities) {
10
+ #{defaults.$ratio-selector} {
11
+ position: relative;
12
+ width: 100%;
13
+
14
+ &::before {
15
+ content: "";
16
+ display: block;
17
+ padding-top: $ratio;
18
+ }
19
+ }
20
+
21
+ @each $ratio-selector, $value in defaults.$ratios {
22
+ #{defaults.$ratio-variant-selector-prefix}#{$ratio-selector} {
23
+ --#{root-defaults.$prefix}-ratio: #{$value};
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,9 @@
1
+ // @graupl/graupl ratio utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";
7
+ @use "../../defaults" as root-defaults;
8
+
9
+ $ratio: var(--#{root-defaults.$prefix}-ratio);