@graupl/graupl 1.0.0-beta.1 → 1.0.0-beta.2

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 (138) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/css/base/button.css +1 -1
  3. package/dist/css/base/button.css.map +1 -1
  4. package/dist/css/base/form.css +1 -1
  5. package/dist/css/base/form.css.map +1 -1
  6. package/dist/css/base/link.css +1 -1
  7. package/dist/css/base/link.css.map +1 -1
  8. package/dist/css/base/table.css +1 -1
  9. package/dist/css/base/table.css.map +1 -1
  10. package/dist/css/base.css +1 -1
  11. package/dist/css/base.css.map +1 -1
  12. package/dist/css/component/accordion.css +1 -1
  13. package/dist/css/component/accordion.css.map +1 -1
  14. package/dist/css/component/alert.css +1 -1
  15. package/dist/css/component/alert.css.map +1 -1
  16. package/dist/css/component/card.css +1 -1
  17. package/dist/css/component/card.css.map +1 -1
  18. package/dist/css/component/carousel.css +1 -1
  19. package/dist/css/component/carousel.css.map +1 -1
  20. package/dist/css/component/input-group.css +1 -1
  21. package/dist/css/component/input-group.css.map +1 -1
  22. package/dist/css/component/list.css +2 -0
  23. package/dist/css/component/list.css.map +1 -0
  24. package/dist/css/component/menu.css +1 -1
  25. package/dist/css/component/menu.css.map +1 -1
  26. package/dist/css/component/navigation.css +1 -1
  27. package/dist/css/component/navigation.css.map +1 -1
  28. package/dist/css/component.css +1 -1
  29. package/dist/css/component.css.map +1 -1
  30. package/dist/css/graupl.css +1 -1
  31. package/dist/css/graupl.css.map +1 -1
  32. package/dist/css/layout/columns.css +1 -1
  33. package/dist/css/layout/columns.css.map +1 -1
  34. package/dist/css/layout/container.css +1 -1
  35. package/dist/css/layout/container.css.map +1 -1
  36. package/dist/css/layout/flex-columns.css +1 -1
  37. package/dist/css/layout/flex-columns.css.map +1 -1
  38. package/dist/css/layout.css +1 -1
  39. package/dist/css/layout.css.map +1 -1
  40. package/dist/css/normalize.css +1 -1
  41. package/dist/css/normalize.css.map +1 -1
  42. package/dist/css/state/focus.css +1 -1
  43. package/dist/css/state/focus.css.map +1 -1
  44. package/dist/css/state.css +1 -1
  45. package/dist/css/state.css.map +1 -1
  46. package/dist/css/theme/color.css +1 -1
  47. package/dist/css/theme/color.css.map +1 -1
  48. package/dist/css/theme/typography.css +1 -1
  49. package/dist/css/theme/typography.css.map +1 -1
  50. package/dist/css/theme.css +1 -1
  51. package/dist/css/theme.css.map +1 -1
  52. package/dist/css/utilities/alignment.css +1 -1
  53. package/dist/css/utilities/alignment.css.map +1 -1
  54. package/dist/css/utilities/border.css +2 -0
  55. package/dist/css/utilities/border.css.map +1 -0
  56. package/dist/css/utilities/color.css +1 -1
  57. package/dist/css/utilities/color.css.map +1 -1
  58. package/dist/css/utilities/display.css +1 -1
  59. package/dist/css/utilities/display.css.map +1 -1
  60. package/dist/css/utilities/flex.css +1 -1
  61. package/dist/css/utilities/flex.css.map +1 -1
  62. package/dist/css/utilities/height.css +1 -1
  63. package/dist/css/utilities/height.css.map +1 -1
  64. package/dist/css/utilities/inset.css +1 -1
  65. package/dist/css/utilities/inset.css.map +1 -1
  66. package/dist/css/utilities/justification.css +1 -1
  67. package/dist/css/utilities/justification.css.map +1 -1
  68. package/dist/css/utilities/list.css +1 -1
  69. package/dist/css/utilities/list.css.map +1 -1
  70. package/dist/css/utilities/order.css +1 -1
  71. package/dist/css/utilities/order.css.map +1 -1
  72. package/dist/css/utilities/postion.css +1 -1
  73. package/dist/css/utilities/postion.css.map +1 -1
  74. package/dist/css/utilities/ratio.css +1 -1
  75. package/dist/css/utilities/ratio.css.map +1 -1
  76. package/dist/css/utilities/spacing.css +1 -1
  77. package/dist/css/utilities/spacing.css.map +1 -1
  78. package/dist/css/utilities/typography.css +1 -1
  79. package/dist/css/utilities/typography.css.map +1 -1
  80. package/dist/css/utilities/visibility.css +1 -1
  81. package/dist/css/utilities/visibility.css.map +1 -1
  82. package/dist/css/utilities/width.css +1 -1
  83. package/dist/css/utilities/width.css.map +1 -1
  84. package/dist/css/utilities.css +1 -1
  85. package/dist/css/utilities.css.map +1 -1
  86. package/index.html +84 -12
  87. package/package.json +1 -1
  88. package/scss/component/list.scss +3 -0
  89. package/scss/utilities/border.scss +3 -0
  90. package/src/scss/_defaults.scss +14 -5
  91. package/src/scss/component/_index.scss +1 -0
  92. package/src/scss/component/input-group/_index.scss +1 -1
  93. package/src/scss/component/list/_defaults.scss +15 -0
  94. package/src/scss/component/list/_index.scss +50 -0
  95. package/src/scss/component/list/_variables.scss +176 -0
  96. package/src/scss/functions/_screen.scss +8 -0
  97. package/src/scss/functions/_utility.scss +28 -0
  98. package/src/scss/mixins/_layer.scss +5 -1
  99. package/src/scss/mixins/_screen.scss +24 -3
  100. package/src/scss/mixins/_state.scss +18 -0
  101. package/src/scss/mixins/_theme.scss +15 -0
  102. package/src/scss/mixins/_utility.scss +119 -17
  103. package/src/scss/theme/color/_index.scss +4 -4
  104. package/src/scss/utilities/_index.scss +1 -0
  105. package/src/scss/utilities/alignment/_defaults.scss +7 -5
  106. package/src/scss/utilities/alignment/_index.scss +117 -24
  107. package/src/scss/utilities/border/_defaults.scss +61 -0
  108. package/src/scss/utilities/border/_index.scss +269 -0
  109. package/src/scss/utilities/border/_variables.scss +6 -0
  110. package/src/scss/utilities/color/_defaults.scss +6 -4
  111. package/src/scss/utilities/color/_index.scss +137 -26
  112. package/src/scss/utilities/display/_defaults.scss +8 -4
  113. package/src/scss/utilities/display/_index.scss +88 -15
  114. package/src/scss/utilities/flex/_defaults.scss +30 -6
  115. package/src/scss/utilities/flex/_index.scss +215 -31
  116. package/src/scss/utilities/height/_defaults.scss +7 -5
  117. package/src/scss/utilities/height/_index.scss +183 -45
  118. package/src/scss/utilities/inset/_defaults.scss +4 -2
  119. package/src/scss/utilities/inset/_index.scss +58 -5
  120. package/src/scss/utilities/justification/_defaults.scss +7 -5
  121. package/src/scss/utilities/justification/_index.scss +117 -24
  122. package/src/scss/utilities/list/_defaults.scss +6 -4
  123. package/src/scss/utilities/list/_index.scss +86 -17
  124. package/src/scss/utilities/order/_defaults.scss +5 -3
  125. package/src/scss/utilities/order/_index.scss +68 -20
  126. package/src/scss/utilities/position/_defaults.scss +5 -3
  127. package/src/scss/utilities/position/_index.scss +55 -10
  128. package/src/scss/utilities/ratio/_defaults.scss +7 -5
  129. package/src/scss/utilities/ratio/_index.scss +49 -10
  130. package/src/scss/utilities/spacing/_defaults.scss +4 -2
  131. package/src/scss/utilities/spacing/_index.scss +225 -12
  132. package/src/scss/utilities/typography/_defaults.scss +21 -5
  133. package/src/scss/utilities/typography/_index.scss +577 -143
  134. package/src/scss/utilities/visibility/_defaults.scss +5 -3
  135. package/src/scss/utilities/visibility/_index.scss +56 -10
  136. package/src/scss/utilities/width/_defaults.scss +7 -5
  137. package/src/scss/utilities/width/_index.scss +183 -45
  138. package/stylelint.config.js +1 -0
@@ -8,215 +8,649 @@
8
8
  @use "../../mixins/layer" as *;
9
9
  @use "../../mixins/screen";
10
10
  @use "../../mixins/utility";
11
+ @use "../../theme/color/variables" as color;
11
12
  @use "../../theme/typography/variables" as typography;
12
13
  @use "defaults";
13
14
  @use "sass:map";
14
15
  @use "variables" as *;
15
16
 
16
17
  @include layer(utilities) {
18
+ $selector-prefix: root-defaults.$utility-selector-prefix;
19
+
17
20
  // For each font size property, create a utility class.
18
21
  @each $size, $value in typography.$font-sizes {
19
- @include utility.create(
20
- ".#{defaults.$text-class-prefix}#{$size}",
21
- font-size,
22
- $value
23
- );
22
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}#{$size}";
23
+
24
+ @include utility.create($selector, font-size, $value);
24
25
  }
25
26
 
26
27
  // Create utility classes for each type of text style in Graupl.
27
28
  // These will apply not only the font size, but also the margin, font weight, and line height.
28
29
  // This will allow for a more consistent and maintainable typography system.
29
- .#{defaults.$text-class-prefix}paragraph {
30
- margin: important.insert(typography.$paragraph-margin);
31
- font-size: important.insert(typography.$paragraph-font-size);
32
- font-weight: important.insert(typography.$paragraph-font-weight);
33
- line-height: important.insert(typography.$paragraph-line-height);
34
- }
30
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}paragraph";
35
31
 
36
- .#{defaults.$text-class-prefix}small {
37
- margin: important.insert(typography.$small-margin);
38
- font-size: important.insert(typography.$small-font-size);
39
- font-weight: important.insert(typography.$small-font-weight);
40
- line-height: important.insert(typography.$small-line-height);
41
- }
32
+ @include utility.create-mapped(
33
+ $selector,
34
+ (
35
+ margin: typography.$paragraph-margin,
36
+ font-size: typography.$paragraph-font-size,
37
+ font-weight: typography.$paragraph-font-weight,
38
+ line-height: typography.$paragraph-line-height,
39
+ )
40
+ );
42
41
 
43
- .#{defaults.$text-class-prefix}h1 {
44
- margin: important.insert(typography.$h1-margin);
45
- font-family: important.insert(typography.$h1-font-family);
46
- font-size: important.insert(typography.$h1-font-size);
47
- font-weight: important.insert(typography.$h1-font-weight);
48
- line-height: important.insert(typography.$h1-line-height);
49
- }
42
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}small";
50
43
 
51
- .#{defaults.$text-class-prefix}h2 {
52
- margin: important.insert(typography.$h2-margin);
53
- font-family: important.insert(typography.$h2-font-family);
54
- font-size: important.insert(typography.$h2-font-size);
55
- font-weight: important.insert(typography.$h2-font-weight);
56
- line-height: important.insert(typography.$h2-line-height);
57
- }
44
+ @include utility.create-mapped(
45
+ $selector,
46
+ (
47
+ margin: typography.$small-margin,
48
+ font-size: typography.$small-font-size,
49
+ font-weight: typography.$small-font-weight,
50
+ line-height: typography.$small-line-height,
51
+ )
52
+ );
58
53
 
59
- .#{defaults.$text-class-prefix}h3 {
60
- margin: important.insert(typography.$h3-margin);
61
- font-family: important.insert(typography.$h3-font-family);
62
- font-size: important.insert(typography.$h3-font-size);
63
- font-weight: important.insert(typography.$h3-font-weight);
64
- line-height: important.insert(typography.$h3-line-height);
65
- }
54
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h1";
66
55
 
67
- .#{defaults.$text-class-prefix}h4 {
68
- margin: important.insert(typography.$h4-margin);
69
- font-family: important.insert(typography.$h4-font-family);
70
- font-size: important.insert(typography.$h4-font-size);
71
- font-weight: important.insert(typography.$h4-font-weight);
72
- line-height: important.insert(typography.$h4-line-height);
73
- }
56
+ @include utility.create-mapped(
57
+ $selector,
58
+ (
59
+ margin: typography.$h1-margin,
60
+ font-family: typography.$h1-font-family,
61
+ font-size: typography.$h1-font-size,
62
+ font-weight: typography.$h1-font-weight,
63
+ line-height: typography.$h1-line-height,
64
+ )
65
+ );
74
66
 
75
- .#{defaults.$text-class-prefix}h5 {
76
- margin: important.insert(typography.$h5-margin);
77
- font-family: important.insert(typography.$h5-font-family);
78
- font-size: important.insert(typography.$h5-font-size);
79
- font-weight: important.insert(typography.$h5-font-weight);
80
- line-height: important.insert(typography.$h5-line-height);
81
- }
67
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h2";
82
68
 
83
- .#{defaults.$text-class-prefix}h6 {
84
- margin: important.insert(typography.$h6-margin);
85
- font-family: important.insert(typography.$h6-font-family);
86
- font-size: important.insert(typography.$h6-font-size);
87
- font-weight: important.insert(typography.$h6-font-weight);
88
- line-height: important.insert(typography.$h6-line-height);
89
- }
69
+ @include utility.create-mapped(
70
+ $selector,
71
+ (
72
+ margin: typography.$h2-margin,
73
+ font-family: typography.$h2-font-family,
74
+ font-size: typography.$h2-font-size,
75
+ font-weight: typography.$h2-font-weight,
76
+ line-height: typography.$h2-line-height,
77
+ )
78
+ );
79
+
80
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h3";
81
+
82
+ @include utility.create-mapped(
83
+ $selector,
84
+ (
85
+ margin: typography.$h3-margin,
86
+ font-family: typography.$h3-font-family,
87
+ font-size: typography.$h3-font-size,
88
+ font-weight: typography.$h3-font-weight,
89
+ line-height: typography.$h3-line-height,
90
+ )
91
+ );
92
+
93
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h4";
94
+
95
+ @include utility.create-mapped(
96
+ $selector,
97
+ (
98
+ margin: typography.$h4-margin,
99
+ font-family: typography.$h4-font-family,
100
+ font-size: typography.$h4-font-size,
101
+ font-weight: typography.$h4-font-weight,
102
+ line-height: typography.$h4-line-height,
103
+ )
104
+ );
105
+
106
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h5";
107
+
108
+ @include utility.create-mapped(
109
+ $selector,
110
+ (
111
+ margin: typography.$h5-margin,
112
+ font-family: typography.$h5-font-family,
113
+ font-size: typography.$h5-font-size,
114
+ font-weight: typography.$h5-font-weight,
115
+ line-height: typography.$h5-line-height,
116
+ )
117
+ );
118
+
119
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h6";
120
+
121
+ @include utility.create-mapped(
122
+ $selector,
123
+ (
124
+ margin: typography.$h6-margin,
125
+ font-family: typography.$h6-font-family,
126
+ font-size: typography.$h6-font-size,
127
+ font-weight: typography.$h6-font-weight,
128
+ line-height: typography.$h6-line-height,
129
+ )
130
+ );
90
131
 
91
132
  // For each font weight property, create a utility class.
92
- @each $size, $value in typography.$font-weights {
93
- @include utility.create(
94
- ".#{defaults.$font-weight-class-prefix}#{$size}",
95
- font-weight,
96
- $value
97
- );
133
+ @each $weight, $value in typography.$font-weights {
134
+ $selector: "#{$selector-prefix}#{defaults.$font-weight-selector-prefix}#{$weight}";
135
+
136
+ @include utility.create($selector, font-weight, $value);
98
137
  }
99
138
 
100
139
  // For each font style property, create a utility class.
101
- @each $size, $value in defaults.$font-style-properties {
102
- @include utility.create(
103
- ".#{defaults.$font-style-class-prefix}#{$size}",
104
- font-style,
105
- $value
106
- );
140
+ @each $style, $value in defaults.$font-style-properties {
141
+ $selector: "#{$selector-prefix}#{defaults.$font-style-selector-prefix}#{$style}";
142
+
143
+ @include utility.create($selector, font-style, $value);
144
+ }
145
+
146
+ // For each text transform property, create a utility class.
147
+ @each $transform, $value in defaults.$text-transform-properties {
148
+ $selector: "#{$selector-prefix}#{defaults.$text-transform-selector-prefix}#{$transform}";
149
+
150
+ @include utility.create($selector, text-transform, $value);
107
151
  }
108
152
 
109
- // Generate responsive utilities.
110
- @if defaults.$responsive and root-defaults.$responsive-utilities {
111
- @each $screen-size in map.keys(root-defaults.$screen-sizes) {
153
+ // Generate screen-aware utilities.
154
+ @if defaults.$screen-aware and root-defaults.$screen-aware-utilities {
155
+ @each $screen-name in map.keys(root-defaults.$screen-sizes) {
156
+ $selector-prefix: "#{root-defaults.$utility-selector-prefix}#{$screen-name}#{root-defaults.$utility-screen-aware-separator}";
157
+
112
158
  // For each font size property, create a utility class.
113
159
  @each $size, $value in typography.$font-sizes {
160
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}#{$size}";
161
+
114
162
  @include utility.create(
115
- ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}#{$size}",
163
+ $selector,
116
164
  font-size,
117
165
  $value,
118
- $screen-size
166
+ $screen: $screen-name
119
167
  );
120
168
  }
121
169
 
122
170
  // Create utility classes for each type of text style in Graupl.
123
171
  // These will apply not only the font size, but also the margin, font weight, and line height.
124
172
  // This will allow for a more consistent and maintainable typography system.
125
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}paragraph {
126
- @include screen.up($screen-size) {
127
- margin: important.insert(typography.$paragraph-margin);
128
- font-size: important.insert(typography.$paragraph-font-size);
129
- font-weight: important.insert(typography.$paragraph-font-weight);
130
- line-height: important.insert(typography.$paragraph-line-height);
131
- }
173
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}paragraph";
174
+
175
+ @include utility.create-mapped(
176
+ $selector,
177
+ (
178
+ margin: typography.$paragraph-margin,
179
+ font-size: typography.$paragraph-font-size,
180
+ font-weight: typography.$paragraph-font-weight,
181
+ line-height: typography.$paragraph-line-height,
182
+ ),
183
+ $screen: $screen-name
184
+ );
185
+
186
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}small";
187
+
188
+ @include utility.create-mapped(
189
+ $selector,
190
+ (
191
+ margin: typography.$small-margin,
192
+ font-size: typography.$small-font-size,
193
+ font-weight: typography.$small-font-weight,
194
+ line-height: typography.$small-line-height,
195
+ ),
196
+ $screen: $screen-name
197
+ );
198
+
199
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h1";
200
+
201
+ @include utility.create-mapped(
202
+ $selector,
203
+ (
204
+ margin: typography.$h1-margin,
205
+ font-family: typography.$h1-font-family,
206
+ font-size: typography.$h1-font-size,
207
+ font-weight: typography.$h1-font-weight,
208
+ line-height: typography.$h1-line-height,
209
+ ),
210
+ $screen: $screen-name
211
+ );
212
+
213
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h2";
214
+
215
+ @include utility.create-mapped(
216
+ $selector,
217
+ (
218
+ margin: typography.$h2-margin,
219
+ font-family: typography.$h2-font-family,
220
+ font-size: typography.$h2-font-size,
221
+ font-weight: typography.$h2-font-weight,
222
+ line-height: typography.$h2-line-height,
223
+ ),
224
+ $screen: $screen-name
225
+ );
226
+
227
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h3";
228
+
229
+ @include utility.create-mapped(
230
+ $selector,
231
+ (
232
+ margin: typography.$h3-margin,
233
+ font-family: typography.$h3-font-family,
234
+ font-size: typography.$h3-font-size,
235
+ font-weight: typography.$h3-font-weight,
236
+ line-height: typography.$h3-line-height,
237
+ ),
238
+ $screen: $screen-name
239
+ );
240
+
241
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h4";
242
+
243
+ @include utility.create-mapped(
244
+ $selector,
245
+ (
246
+ margin: typography.$h4-margin,
247
+ font-family: typography.$h4-font-family,
248
+ font-size: typography.$h4-font-size,
249
+ font-weight: typography.$h4-font-weight,
250
+ line-height: typography.$h4-line-height,
251
+ ),
252
+ $screen: $screen-name
253
+ );
254
+
255
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h5";
256
+
257
+ @include utility.create-mapped(
258
+ $selector,
259
+ (
260
+ margin: typography.$h5-margin,
261
+ font-family: typography.$h5-font-family,
262
+ font-size: typography.$h5-font-size,
263
+ font-weight: typography.$h5-font-weight,
264
+ line-height: typography.$h5-line-height,
265
+ ),
266
+ $screen: $screen-name
267
+ );
268
+
269
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h6";
270
+
271
+ @include utility.create-mapped(
272
+ $selector,
273
+ (
274
+ margin: typography.$h6-margin,
275
+ font-family: typography.$h6-font-family,
276
+ font-size: typography.$h6-font-size,
277
+ font-weight: typography.$h6-font-weight,
278
+ line-height: typography.$h6-line-height,
279
+ ),
280
+ $screen: $screen-name
281
+ );
282
+
283
+ // For each font weight property, create a utility class.
284
+ @each $weight, $value in typography.$font-weights {
285
+ $selector: "#{$selector-prefix}#{defaults.$font-weight-selector-prefix}#{$weight}";
286
+
287
+ @include utility.create(
288
+ $selector,
289
+ font-weight,
290
+ $value,
291
+ $screen: $screen-name
292
+ );
132
293
  }
133
294
 
134
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}small {
135
- @include screen.up($screen-size) {
136
- margin: important.insert(typography.$small-margin);
137
- font-size: important.insert(typography.$small-font-size);
138
- font-weight: important.insert(typography.$small-font-weight);
139
- line-height: important.insert(typography.$small-line-height);
140
- }
295
+ // For each font style property, create a utility class.
296
+ @each $style, $value in defaults.$font-style-properties {
297
+ $selector: "#{$selector-prefix}#{defaults.$font-style-selector-prefix}#{$style}";
298
+
299
+ @include utility.create(
300
+ $selector,
301
+ font-style,
302
+ $value,
303
+ $screen: $screen-name
304
+ );
141
305
  }
142
306
 
143
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}h1 {
144
- @include screen.up($screen-size) {
145
- margin: important.insert(typography.$h1-margin);
146
- font-family: important.insert(typography.$h1-font-family);
147
- font-size: important.insert(typography.$h1-font-size);
148
- font-weight: important.insert(typography.$h1-font-weight);
149
- line-height: important.insert(typography.$h1-line-height);
150
- }
307
+ // For each text transform property, create a utility class.
308
+ @each $transform, $value in defaults.$text-transform-properties {
309
+ $selector: "#{$selector-prefix}#{defaults.$text-transform-selector-prefix}#{$transform}";
310
+
311
+ @include utility.create(
312
+ $selector,
313
+ text-transform,
314
+ $value,
315
+ $screen: $screen-name
316
+ );
151
317
  }
318
+ }
319
+ }
152
320
 
153
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}h2 {
154
- @include screen.up($screen-size) {
155
- margin: important.insert(typography.$h2-margin);
156
- font-family: important.insert(typography.$h2-font-family);
157
- font-size: important.insert(typography.$h2-font-size);
158
- font-weight: important.insert(typography.$h2-font-weight);
159
- line-height: important.insert(typography.$h2-line-height);
321
+ // Generate theme-aware utilities.
322
+ @if defaults.$theme-aware and root-defaults.$theme-aware-utilities {
323
+ @each $theme-name, $colors in color.$themes {
324
+ @if $theme-name != active {
325
+ $selector-prefix: "#{root-defaults.$utility-selector-prefix}#{$theme-name}#{root-defaults.$utility-theme-aware-separator}";
326
+
327
+ // For each font size property, create a utility class.
328
+ @each $size, $value in typography.$font-sizes {
329
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}#{$size}";
330
+
331
+ @include utility.create(
332
+ $selector,
333
+ font-size,
334
+ $value,
335
+ $theme: $theme-name
336
+ );
160
337
  }
161
- }
162
338
 
163
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}h3 {
164
- @include screen.up($screen-size) {
165
- margin: important.insert(typography.$h3-margin);
166
- font-family: important.insert(typography.$h3-font-family);
167
- font-size: important.insert(typography.$h3-font-size);
168
- font-weight: important.insert(typography.$h3-font-weight);
169
- line-height: important.insert(typography.$h3-line-height);
339
+ // Create utility classes for each type of text style in Graupl.
340
+ // These will apply not only the font size, but also the margin, font weight, and line height.
341
+ // This will allow for a more consistent and maintainable typography system.
342
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}paragraph";
343
+
344
+ @include utility.create-mapped(
345
+ $selector,
346
+ (
347
+ margin: typography.$paragraph-margin,
348
+ font-size: typography.$paragraph-font-size,
349
+ font-weight: typography.$paragraph-font-weight,
350
+ line-height: typography.$paragraph-line-height,
351
+ ),
352
+ $theme: $theme-name
353
+ );
354
+
355
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}small";
356
+
357
+ @include utility.create-mapped(
358
+ $selector,
359
+ (
360
+ margin: typography.$small-margin,
361
+ font-size: typography.$small-font-size,
362
+ font-weight: typography.$small-font-weight,
363
+ line-height: typography.$small-line-height,
364
+ ),
365
+ $theme: $theme-name
366
+ );
367
+
368
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h1";
369
+
370
+ @include utility.create-mapped(
371
+ $selector,
372
+ (
373
+ margin: typography.$h1-margin,
374
+ font-family: typography.$h1-font-family,
375
+ font-size: typography.$h1-font-size,
376
+ font-weight: typography.$h1-font-weight,
377
+ line-height: typography.$h1-line-height,
378
+ ),
379
+ $theme: $theme-name
380
+ );
381
+
382
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h2";
383
+
384
+ @include utility.create-mapped(
385
+ $selector,
386
+ (
387
+ margin: typography.$h2-margin,
388
+ font-family: typography.$h2-font-family,
389
+ font-size: typography.$h2-font-size,
390
+ font-weight: typography.$h2-font-weight,
391
+ line-height: typography.$h2-line-height,
392
+ ),
393
+ $theme: $theme-name
394
+ );
395
+
396
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h3";
397
+
398
+ @include utility.create-mapped(
399
+ $selector,
400
+ (
401
+ margin: typography.$h3-margin,
402
+ font-family: typography.$h3-font-family,
403
+ font-size: typography.$h3-font-size,
404
+ font-weight: typography.$h3-font-weight,
405
+ line-height: typography.$h3-line-height,
406
+ ),
407
+ $theme: $theme-name
408
+ );
409
+
410
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h4";
411
+
412
+ @include utility.create-mapped(
413
+ $selector,
414
+ (
415
+ margin: typography.$h4-margin,
416
+ font-family: typography.$h4-font-family,
417
+ font-size: typography.$h4-font-size,
418
+ font-weight: typography.$h4-font-weight,
419
+ line-height: typography.$h4-line-height,
420
+ ),
421
+ $theme: $theme-name
422
+ );
423
+
424
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h5";
425
+
426
+ @include utility.create-mapped(
427
+ $selector,
428
+ (
429
+ margin: typography.$h5-margin,
430
+ font-family: typography.$h5-font-family,
431
+ font-size: typography.$h5-font-size,
432
+ font-weight: typography.$h5-font-weight,
433
+ line-height: typography.$h5-line-height,
434
+ ),
435
+ $theme: $theme-name
436
+ );
437
+
438
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h6";
439
+
440
+ @include utility.create-mapped(
441
+ $selector,
442
+ (
443
+ margin: typography.$h6-margin,
444
+ font-family: typography.$h6-font-family,
445
+ font-size: typography.$h6-font-size,
446
+ font-weight: typography.$h6-font-weight,
447
+ line-height: typography.$h6-line-height,
448
+ ),
449
+ $theme: $theme-name
450
+ );
451
+
452
+ // For each font weight property, create a utility class.
453
+ @each $weight, $value in typography.$font-weights {
454
+ $selector: "#{$selector-prefix}#{defaults.$font-weight-selector-prefix}#{$weight}";
455
+
456
+ @include utility.create(
457
+ $selector,
458
+ font-weight,
459
+ $value,
460
+ $theme: $theme-name
461
+ );
170
462
  }
171
- }
172
463
 
173
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}h4 {
174
- @include screen.up($screen-size) {
175
- margin: important.insert(typography.$h4-margin);
176
- font-family: important.insert(typography.$h4-font-family);
177
- font-size: important.insert(typography.$h4-font-size);
178
- font-weight: important.insert(typography.$h4-font-weight);
179
- line-height: important.insert(typography.$h4-line-height);
464
+ // For each font style property, create a utility class.
465
+ @each $style, $value in defaults.$font-style-properties {
466
+ $selector: "#{$selector-prefix}#{defaults.$font-style-selector-prefix}#{$style}";
467
+
468
+ @include utility.create(
469
+ $selector,
470
+ font-style,
471
+ $value,
472
+ $theme: $theme-name
473
+ );
180
474
  }
181
- }
182
475
 
183
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}h5 {
184
- @include screen.up($screen-size) {
185
- margin: important.insert(typography.$h5-margin);
186
- font-family: important.insert(typography.$h5-font-family);
187
- font-size: important.insert(typography.$h5-font-size);
188
- font-weight: important.insert(typography.$h5-font-weight);
189
- line-height: important.insert(typography.$h5-line-height);
476
+ // For each text transform property, create a utility class.
477
+ @each $transform, $value in defaults.$text-transform-properties {
478
+ $selector: "#{$selector-prefix}#{defaults.$text-transform-selector-prefix}#{$transform}";
479
+
480
+ @include utility.create(
481
+ $selector,
482
+ text-transform,
483
+ $value,
484
+ $theme: $theme-name
485
+ );
190
486
  }
191
487
  }
488
+ }
489
+ }
192
490
 
193
- .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}h6 {
194
- @include screen.up($screen-size) {
195
- margin: important.insert(typography.$h6-margin);
196
- font-family: important.insert(typography.$h6-font-family);
197
- font-size: important.insert(typography.$h6-font-size);
198
- font-weight: important.insert(typography.$h6-font-weight);
199
- line-height: important.insert(typography.$h6-line-height);
200
- }
491
+ // Generate state-aware utilities.
492
+ @if defaults.$state-aware and root-defaults.$state-aware-utilities {
493
+ @each $state-name, $value in root-defaults.$state-selectors {
494
+ $selector-prefix: "#{root-defaults.$utility-selector-prefix}#{$state-name}#{root-defaults.$utility-state-aware-separator}";
495
+
496
+ // For each font size property, create a utility class.
497
+ @each $size, $value in typography.$font-sizes {
498
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}#{$size}";
499
+
500
+ @include utility.create(
501
+ $selector,
502
+ font-size,
503
+ $value,
504
+ $state: $state-name
505
+ );
201
506
  }
202
507
 
508
+ // Create utility classes for each type of text style in Graupl.
509
+ // These will apply not only the font size, but also the margin, font weight, and line height.
510
+ // This will allow for a more consistent and maintainable typography system.
511
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}paragraph";
512
+
513
+ @include utility.create-mapped(
514
+ $selector,
515
+ (
516
+ margin: typography.$paragraph-margin,
517
+ font-size: typography.$paragraph-font-size,
518
+ font-weight: typography.$paragraph-font-weight,
519
+ line-height: typography.$paragraph-line-height,
520
+ ),
521
+ $state: $state-name
522
+ );
523
+
524
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}small";
525
+
526
+ @include utility.create-mapped(
527
+ $selector,
528
+ (
529
+ margin: typography.$small-margin,
530
+ font-size: typography.$small-font-size,
531
+ font-weight: typography.$small-font-weight,
532
+ line-height: typography.$small-line-height,
533
+ ),
534
+ $state: $state-name
535
+ );
536
+
537
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h1";
538
+
539
+ @include utility.create-mapped(
540
+ $selector,
541
+ (
542
+ margin: typography.$h1-margin,
543
+ font-family: typography.$h1-font-family,
544
+ font-size: typography.$h1-font-size,
545
+ font-weight: typography.$h1-font-weight,
546
+ line-height: typography.$h1-line-height,
547
+ ),
548
+ $state: $state-name
549
+ );
550
+
551
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h2";
552
+
553
+ @include utility.create-mapped(
554
+ $selector,
555
+ (
556
+ margin: typography.$h2-margin,
557
+ font-family: typography.$h2-font-family,
558
+ font-size: typography.$h2-font-size,
559
+ font-weight: typography.$h2-font-weight,
560
+ line-height: typography.$h2-line-height,
561
+ ),
562
+ $state: $state-name
563
+ );
564
+
565
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h3";
566
+
567
+ @include utility.create-mapped(
568
+ $selector,
569
+ (
570
+ margin: typography.$h3-margin,
571
+ font-family: typography.$h3-font-family,
572
+ font-size: typography.$h3-font-size,
573
+ font-weight: typography.$h3-font-weight,
574
+ line-height: typography.$h3-line-height,
575
+ ),
576
+ $state: $state-name
577
+ );
578
+
579
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h4";
580
+
581
+ @include utility.create-mapped(
582
+ $selector,
583
+ (
584
+ margin: typography.$h4-margin,
585
+ font-family: typography.$h4-font-family,
586
+ font-size: typography.$h4-font-size,
587
+ font-weight: typography.$h4-font-weight,
588
+ line-height: typography.$h4-line-height,
589
+ ),
590
+ $state: $state-name
591
+ );
592
+
593
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h5";
594
+
595
+ @include utility.create-mapped(
596
+ $selector,
597
+ (
598
+ margin: typography.$h5-margin,
599
+ font-family: typography.$h5-font-family,
600
+ font-size: typography.$h5-font-size,
601
+ font-weight: typography.$h5-font-weight,
602
+ line-height: typography.$h5-line-height,
603
+ ),
604
+ $state: $state-name
605
+ );
606
+
607
+ $selector: "#{$selector-prefix}#{defaults.$text-selector-prefix}h6";
608
+
609
+ @include utility.create-mapped(
610
+ $selector,
611
+ (
612
+ margin: typography.$h6-margin,
613
+ font-family: typography.$h6-font-family,
614
+ font-size: typography.$h6-font-size,
615
+ font-weight: typography.$h6-font-weight,
616
+ line-height: typography.$h6-line-height,
617
+ ),
618
+ $state: $state-name
619
+ );
620
+
203
621
  // For each font weight property, create a utility class.
204
- @each $size, $value in typography.$font-weights {
622
+ @each $weight, $value in typography.$font-weights {
623
+ $selector: "#{$selector-prefix}#{defaults.$font-weight-selector-prefix}#{$weight}";
624
+
205
625
  @include utility.create(
206
- ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$font-weight-class-prefix}#{$size}",
626
+ $selector,
207
627
  font-weight,
208
628
  $value,
209
- $screen-size
629
+ $state: $state-name
210
630
  );
211
631
  }
212
632
 
213
633
  // For each font style property, create a utility class.
214
- @each $size, $value in defaults.$font-style-properties {
634
+ @each $style, $value in defaults.$font-style-properties {
635
+ $selector: "#{$selector-prefix}#{defaults.$font-style-selector-prefix}#{$style}";
636
+
215
637
  @include utility.create(
216
- ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$font-style-class-prefix}#{$size}",
638
+ $selector,
217
639
  font-style,
218
640
  $value,
219
- $screen-size
641
+ $state: $state-name
642
+ );
643
+ }
644
+
645
+ // For each text transform property, create a utility class.
646
+ @each $transform, $value in defaults.$text-transform-properties {
647
+ $selector: "#{$selector-prefix}#{defaults.$text-transform-selector-prefix}#{$transform}";
648
+
649
+ @include utility.create(
650
+ $selector,
651
+ text-transform,
652
+ $value,
653
+ $state: $state-name
220
654
  );
221
655
  }
222
656
  }