beathers 5.3.6 → 5.4.1

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/.prettierrc.js +8 -0
  2. package/CHANGELOG +176 -154
  3. package/css/beathers-icons.min.css.map +1 -0
  4. package/{dist/css → css}/beathers.min.css +2 -2
  5. package/css/beathers.min.css.map +1 -0
  6. package/data/colors.d.ts.map +1 -0
  7. package/data/font.d.ts.map +1 -0
  8. package/data/index.d.ts.map +1 -0
  9. package/index.d.ts.map +1 -0
  10. package/package.json +27 -26
  11. package/readme.md +263 -256
  12. package/scripts/cli.d.ts.map +1 -0
  13. package/{dist/scripts → scripts}/cli.js +0 -0
  14. package/scripts/commands/build.d.ts.map +1 -0
  15. package/{dist/scripts → scripts}/commands/build.js +16 -4
  16. package/scripts/commands/colors.d.ts.map +1 -0
  17. package/scripts/commands/fonts.d.ts.map +1 -0
  18. package/scripts/commands/help.d.ts.map +1 -0
  19. package/scripts/commands/index.d.ts.map +1 -0
  20. package/scripts/commands/init.d.ts.map +1 -0
  21. package/scripts/commands/list.d.ts.map +1 -0
  22. package/scripts/commands/version.d.ts.map +1 -0
  23. package/scripts/helpers/BuildScssVariables.d.ts.map +1 -0
  24. package/scripts/helpers/BuildScssVariables.js +138 -0
  25. package/scripts/helpers/CallNewVariables.d.ts +2 -0
  26. package/scripts/helpers/CallNewVariables.d.ts.map +1 -0
  27. package/{dist/scripts → scripts}/helpers/CallNewVariables.js +5 -3
  28. package/scripts/helpers/LoadUserConfigs.d.ts.map +1 -0
  29. package/scripts/helpers/Merge.d.ts.map +1 -0
  30. package/scripts/helpers/ReadDefaultValues.d.ts.map +1 -0
  31. package/scripts/helpers/index.d.ts.map +1 -0
  32. package/scripts/types.d.ts.map +1 -0
  33. package/{dist/scss → scss}/_variables.scss +21 -0
  34. package/{dist/scss → scss}/beathers-icons.min.scss +265 -265
  35. package/{dist/scss → scss}/beathers.min.scss +11 -11
  36. package/{dist/scss → scss}/functions/_colors.scss +230 -243
  37. package/{dist/scss → scss}/functions/_mediaQueries.scss +133 -138
  38. package/{dist/scss → scss}/functions/_others.scss +87 -92
  39. package/{dist/scss → scss}/functions/_typographic.scss +129 -134
  40. package/{dist/scss → scss}/functions/_validations.scss +251 -251
  41. package/{dist/scss → scss}/settings/_configs.scss +295 -295
  42. package/{dist/scss → scss}/settings/_defaults.scss +178 -178
  43. package/{dist/scss → scss}/settings/_index.scss +68 -68
  44. package/{dist/scss → scss}/style/_colors.scss +146 -155
  45. package/{dist/scss → scss}/style/_grid.scss +89 -90
  46. package/{dist/scss → scss}/style/_resets.scss +110 -119
  47. package/{dist/scss → scss}/style/_shaping.scss +388 -425
  48. package/{dist/scss → scss}/style/_typographic.scss +319 -347
  49. package/dist/css/beathers-icons.min.css.map +0 -1
  50. package/dist/css/beathers.min.css.map +0 -1
  51. package/dist/scripts/helpers/BuildScssVariables.js +0 -111
  52. package/dist/scripts/helpers/CallNewVariables.d.ts +0 -2
  53. /package/{dist/css → css}/beathers-icons.min.css +0 -0
  54. /package/{dist/data → data}/colors.d.ts +0 -0
  55. /package/{dist/data → data}/colors.js +0 -0
  56. /package/{dist/data → data}/font.d.ts +0 -0
  57. /package/{dist/data → data}/font.js +0 -0
  58. /package/{dist/data → data}/index.d.ts +0 -0
  59. /package/{dist/data → data}/index.js +0 -0
  60. /package/{dist/index.d.ts → index.d.ts} +0 -0
  61. /package/{dist/index.js → index.js} +0 -0
  62. /package/{dist/scripts → scripts}/cli.d.ts +0 -0
  63. /package/{dist/scripts → scripts}/commands/build.d.ts +0 -0
  64. /package/{dist/scripts → scripts}/commands/colors.d.ts +0 -0
  65. /package/{dist/scripts → scripts}/commands/colors.js +0 -0
  66. /package/{dist/scripts → scripts}/commands/fonts.d.ts +0 -0
  67. /package/{dist/scripts → scripts}/commands/fonts.js +0 -0
  68. /package/{dist/scripts → scripts}/commands/help.d.ts +0 -0
  69. /package/{dist/scripts → scripts}/commands/help.js +0 -0
  70. /package/{dist/scripts → scripts}/commands/index.d.ts +0 -0
  71. /package/{dist/scripts → scripts}/commands/index.js +0 -0
  72. /package/{dist/scripts → scripts}/commands/init.d.ts +0 -0
  73. /package/{dist/scripts → scripts}/commands/init.js +0 -0
  74. /package/{dist/scripts → scripts}/commands/list.d.ts +0 -0
  75. /package/{dist/scripts → scripts}/commands/list.js +0 -0
  76. /package/{dist/scripts → scripts}/commands/version.d.ts +0 -0
  77. /package/{dist/scripts → scripts}/commands/version.js +0 -0
  78. /package/{dist/scripts → scripts}/helpers/BuildScssVariables.d.ts +0 -0
  79. /package/{dist/scripts → scripts}/helpers/LoadUserConfigs.d.ts +0 -0
  80. /package/{dist/scripts → scripts}/helpers/LoadUserConfigs.js +0 -0
  81. /package/{dist/scripts → scripts}/helpers/Merge.d.ts +0 -0
  82. /package/{dist/scripts → scripts}/helpers/Merge.js +0 -0
  83. /package/{dist/scripts → scripts}/helpers/ReadDefaultValues.d.ts +0 -0
  84. /package/{dist/scripts → scripts}/helpers/ReadDefaultValues.js +0 -0
  85. /package/{dist/scripts → scripts}/helpers/index.d.ts +0 -0
  86. /package/{dist/scripts → scripts}/helpers/index.js +0 -0
  87. /package/{dist/scripts → scripts}/types.d.ts +0 -0
  88. /package/{dist/scripts → scripts}/types.js +0 -0
@@ -1,347 +1,319 @@
1
- @use 'sass:meta';
2
- @use 'sass:string';
3
- @use 'sass:map';
4
- @use 'sass:list';
5
- @use '../variables' as vars;
6
- @use '../functions/validations' as val;
7
- @use '../functions/typographic' as typo;
8
- @use '../settings/configs' as configs;
9
- @use '../functions/mediaQueries' as mQ;
10
- @use '../settings/index' as settings;
11
- @use '../settings/defaults' as defs;
12
-
13
- // Definitions
14
- $useFontFamilies: if(
15
- meta.variable-exists('vars.$useFontFamilies') and vars.$useFontFamilies,
16
- vars.$useFontFamilies,
17
- settings.$useFontFamilies
18
- );
19
- $fonts: if(meta.variable-exists('vars.$fonts') and vars.$fonts, vars.$fonts, defs.$fonts);
20
- $fontWeights: if(meta.variable-exists('vars.$fontWeights') and vars.$fontWeights, vars.$fontWeights, defs.$fontWeights);
21
- $fontStyles: if(meta.variable-exists('vars.$fontStyles') and vars.$fontStyles, vars.$fontStyles, defs.$fontStyles);
22
- $fontFormat: if(meta.variable-exists('vars.$fontFormat') and vars.$fontFormat, vars.$fontFormat, defs.$fontFormat);
23
- $defaultFontFamilies: if(
24
- meta.variable-exists('vars.$defaultFontFamilies') and vars.$defaultFontFamilies,
25
- vars.$defaultFontFamilies,
26
- defs.$defaultFontFamilies
27
- );
28
- $useFontSizes: if(
29
- meta.variable-exists('vars.$useFontSizes') and vars.$useFontSizes,
30
- vars.$useFontSizes,
31
- settings.$useFontSizes
32
- );
33
- $fontSizes: if(meta.variable-exists('vars.$fontSizes') and vars.$fontSizes, vars.$fontSizes, defs.$fontSizes);
34
- $useFontShapes: if(
35
- meta.variable-exists('vars.$useFontShapes') and vars.$useFontShapes,
36
- vars.$useFontShapes,
37
- settings.$useFontShapes
38
- );
39
- $useTextAligns: if(
40
- meta.variable-exists('vars.$useTextAligns') and vars.$useTextAligns,
41
- vars.$useTextAligns,
42
- settings.$useTextAligns
43
- );
44
- $useTextTruncate: if(
45
- meta.variable-exists('vars.$useTextTruncate') and vars.$useTextTruncate,
46
- vars.$useTextTruncate,
47
- settings.$useTextTruncate
48
- );
49
- $textTruncate: if(
50
- meta.variable-exists('vars.$textTruncate') and vars.$textTruncate,
51
- vars.$textTruncate,
52
- defs.$textTruncate
53
- );
54
-
55
- // Typographic Utilities
56
- // --------------------------------------
57
- // This file generates various typographic utility classes and @font-face rules
58
- // based on the settings and variables defined in the project.
59
- // Each section can be enabled or disabled via the `$use...` variables.
60
-
61
- // Font Families & @font-face ----- ----- ----- -----
62
- //
63
- // @description
64
- // Generates @font-face rules based on the `vars.$fonts` map and
65
- // corresponding utility classes for applying font families, weights, and styles.
66
- // The generation of these rules and classes is controlled by the
67
- // `$useFontFamilies` boolean variable.
68
- //
69
- // @see $useFontFamilies
70
- // @see vars.$fonts
71
- // @see vars.$fontWeights
72
- // @see vars.$fontStyles
73
- // @see configs.$fontWeightsValues (for mapping weight names to numerical values)
74
- // @see $defaultFontFamilies (for fallback fonts)
75
- // @see typo.font (mixin used for @font-face generation)
76
- // @see mQ.multiSizes (mixin used for responsive class generation)
77
- //
78
- // @generatedClasses
79
- // - @font-face rules for each font variant.
80
- // - Font family/weight classes:
81
- // - e.g., `.regular`, `.bold`, `.italic`
82
- // - e.g., `.fontName-0`, `.fontName-1` (if multiple fonts with same weight names, indexed by $fI)
83
- // - Responsive font family/weight classes (if `mQ.multiSizes` is configured):
84
- // - e.g., `md:regular`, `lg:bold`
85
- // - Font style classes (applied as modifiers):
86
- // - e.g., `.regular.italic`
87
- //
88
- // @example scss - Configuration in vars.$fonts (simplified)
89
- // vars.$fonts: (
90
- // sans: (
91
- // weights: (regular, bold),
92
- // styles: (normal, italic),
93
- // variants: (
94
- // latin: (title: "OpenSans") // `title` here is used for font-family in @font-face
95
- // )
96
- // )
97
- // );
98
- //
99
- // @example css - Generated CSS (simplified, assuming $fI is 0 for the first font)
100
- // @font-face { font-family: "OpenSans-0"; src: local("OpenSans Regular"); font-weight: 400; font-style: normal; }
101
- // .regular { font-family: "OpenSans-0", "Fallback Font"; font-weight: 400; }
102
- // .regular.italic { font-style: italic; }
103
- // .bold { font-family: "OpenSans-0", "Fallback Font"; font-weight: 700; }
104
- // // ... responsive versions if applicable ...
105
- //
106
-
107
- @if $useFontFamilies {
108
- // Font families ----- -----
109
- $fI: 0;
110
- @each $fontKey, $font in $fonts {
111
- // Validate parameters
112
- $checkedFontKey: val.string($fontKey, 'Typographic.fonts.title');
113
- $checkedFont: val.map($font, 'Typographic.fonts');
114
-
115
- $weights: map.get($font, 'weights');
116
- $weights: if($weights != null, map.get($font, 'weights'), $fontWeights);
117
- $styles: map.get($font, 'styles');
118
- $styles: if($styles != null, map.get($font, 'styles'), $fontStyles);
119
- $variants: map.get($font, 'variants');
120
-
121
- // Validate parameters
122
- $checkedWeights: val.list($weights, 'Typographic.fontFace.weights');
123
- $checkedStyles: val.list($styles, 'Typographic.fontFace.styles');
124
- $checkedVariants: val.map($variants, 'Typographic.fontFace.variants');
125
-
126
- @each $weight in $weights {
127
- @each $style in $styles {
128
- @each $lang, $fontFace in $variants {
129
- $title: map.get($fontFace, 'title');
130
- $unicode: if(map.has-key($fontFace, 'unicode'), map.get($fontFace, 'unicode'), null);
131
- $format: if(map.has-key($fontFace, 'format'), map.get($fontFace, 'format'), $fontFormat);
132
- $isLocal: if(map.has-key($fontFace, 'local'), map.get($fontFace, 'isLocal'), true);
133
- $externalUrl: if(map.has-key($fontFace, 'url'), map.get($fontFace, 'url'), null);
134
-
135
- // Validate parameters
136
- $checkedIsLocal: val.boolean($isLocal, 'Typographic.fontFace.local');
137
- $checkedTitle: val.string($title, 'Typographic.fontFace.title');
138
- $checkedFormat: val.string($format, 'Typographic.fontFace.format');
139
- @if $unicode {
140
- $checkedUnicode: val.string($unicode, 'Typographic.fontFace.unicode');
141
- }
142
-
143
- @include typo.font($title, $weight, $format, $style, $fI, $unicode, $isLocal, $externalUrl);
144
- }
145
- }
146
- }
147
-
148
- @include mQ.multiSizes() using ($size, $divider) {
149
- @each $weight in $weights {
150
- @each $style in $styles {
151
- // Font weights
152
- // Validate parameters
153
- $styleClass: if($fI == 0, $weight, '#{$weight}-#{$fI}');
154
- $weightValue: map.get(configs.$fontWeightsValues, $weight);
155
-
156
- $mainClass: if($size, #{$size}#{$divider}#{$styleClass}, $styleClass);
157
-
158
- .#{$mainClass} {
159
- font-family:
160
- '#{$styleClass}',
161
- $defaultFontFamilies if($size, !important, null);
162
- font-weight: if($size, $weightValue !important, $weightValue);
163
- @if meta.type-of($styles) == 'list' and list.length($styles) > 0 {
164
- &.#{$style} {
165
- font-style: $style;
166
- }
167
- }
168
- }
169
- }
170
- }
171
- }
172
-
173
- $fI: $fI + 1;
174
- }
175
- }
176
-
177
- // Font Sizes ----- ----- ----- -----
178
- //
179
- // @description
180
- // Generates utility classes for applying predefined font sizes.
181
- // The generation of these classes is controlled by the
182
- // `$useFontSizes` boolean variable.
183
- // Font sizes are defined in `$fontSizes`.
184
- // Responsive variants are generated using the `mQ.multiSizes` mixin.
185
- //
186
- // @see $useFontSizes
187
- // @see $fontSizes
188
- // @see mQ.multiSizes
189
- //
190
- // @generatedClasses
191
- // - Font size classes:
192
- // - e.g., `.text-sm`, `.text-base`, `.text-lg` (based on keys in `$fontSizes`)
193
- // - Responsive font size classes:
194
- // - e.g., `md:text-sm`, `lg:text-base`
195
- //
196
- // @example scss - Configuration in $fontSizes
197
- // $fontSizes: (
198
- // sm: 0.875rem,
199
- // base: 1rem
200
- // );
201
- //
202
- // @example css - Generated CSS (simplified)
203
- // .text-sm { font-size: 0.875rem; }
204
- // .text-base { font-size: 1rem; }
205
- // // ... responsive versions if applicable ...
206
- //
207
- @if $useFontSizes {
208
- @include mQ.multiSizes() using ($size, $divider) {
209
- @each $fontSize, $value in $fontSizes {
210
- $mainClass: if($size, #{$size}#{$divider}#{$fontSize}, $fontSize);
211
-
212
- .#{$mainClass} {
213
- font-size: $value if($size, !important, null);
214
- }
215
- }
216
- }
217
- }
218
-
219
- // Font Shapes (Text Transformation) ----- ----- ----- -----
220
- //
221
- // @description
222
- // Generates utility classes for text transformations (e.g., uppercase, lowercase)
223
- // and other font-related shape properties like `font-variant`.
224
- // The generation of these classes is controlled by the
225
- // `$useFontShapes` boolean variable.
226
- // Shapes are defined in `configs.$fontShapes` and applied using the `typo.fontShapes` mixin.
227
- // Responsive variants are generated using the `mQ.multiSizes` mixin.
228
- //
229
- // @see $useFontShapes
230
- // @see configs.$fontShapes
231
- // @see typo.fontShapes
232
- // @see mQ.multiSizes
233
- //
234
- // @generatedClasses
235
- // - Text transformation/shape classes:
236
- // - e.g., `.uppercase`, `.lowercase`, `.small-caps` (based on `configs.$fontShapes`)
237
- // - Responsive text transformation/shape classes:
238
- // - e.g., `md:uppercase`, `lg:small-caps`
239
- //
240
- // @example scss - Configuration in configs.$fontShapes
241
- // configs.$fontShapes: (
242
- // text-transform: (uppercase, lowercase, capitalize),
243
- // font-variant: (small-caps)
244
- // );
245
- //
246
- // @example css - Generated CSS (simplified)
247
- // .uppercase { text-transform: uppercase; }
248
- // .small-caps { font-variant: small-caps; }
249
- // // ... responsive versions if applicable ...
250
- //
251
- @if $useFontShapes {
252
- @include mQ.multiSizes() using ($size, $divider) {
253
- @each $type, $values in configs.$fontShapes {
254
- @each $value in $values {
255
- @include typo.fontShapes(if($size, '#{$size}#{$divider}#{$value}', $value), $type, $value);
256
- }
257
- }
258
- }
259
- }
260
-
261
- // Text Alignment ----- ----- ----- -----
262
- //
263
- // @description
264
- // Generates utility classes for text alignment (e.g., left, center, right).
265
- // The generation of these classes is controlled by the
266
- // `$useTextAligns` boolean variable.
267
- // Alignments are defined in `configs.$aligns`.
268
- // Responsive variants are generated using the `mQ.multiSizes` mixin.
269
- //
270
- // @see $useTextAligns
271
- // @see configs.$aligns
272
- // @see mQ.multiSizes
273
- //
274
- // @generatedClasses
275
- // - Text alignment classes:
276
- // - e.g., `.text-left`, `.text-center`, `.text-right`
277
- // - Responsive text alignment classes:
278
- // - e.g., `md:text-left`, `lg:text-center`
279
- //
280
- // @example scss - Configuration in configs.$aligns
281
- // configs.$aligns: (left, center, right, justify);
282
- //
283
- // @example css - Generated CSS (simplified)
284
- // .text-left { text-align: left; }
285
- // // ... responsive versions if applicable ...
286
- //
287
- @if $useTextAligns {
288
- @include mQ.multiSizes() using ($size, $divider) {
289
- @each $dir in configs.$aligns {
290
- // Validate parameters
291
- $checkedDir: val.listItem(configs.$aligns, $dir, 'Typographic.fonts.aligns');
292
-
293
- $mainClass: if($size, '#{$size}#{$divider}text-#{$dir}', 'text-#{$dir}');
294
- .#{$mainClass} {
295
- text-align: if($size, $dir !important, $dir);
296
- }
297
- }
298
- }
299
- }
300
-
301
- // Text Truncation ----- ----- ----- -----
302
- //
303
- // @description
304
- // Generates utility classes for multi-line text truncation (ellipsis).
305
- // The generation of these classes is controlled by the
306
- // `$useTextTruncate` boolean variable.
307
- // The maximum number of lines is controlled by `$textTruncate`.
308
- // Responsive variants are generated using the `mQ.multiSizes` mixin.
309
- //
310
- // @see $useTextTruncate
311
- // @see $textTruncate
312
- // @see mQ.multiSizes
313
- //
314
- // @generatedClasses
315
- // - Text truncation classes:
316
- // - e.g., `.text-lines:1`, `.text-lines:2`, ... up to `$textTruncate`
317
- // - Responsive text truncation classes:
318
- // - e.g., `md:text-lines:1`, `lg:text-lines:2`
319
- //
320
- // @example scss - Configuration in $textTruncate
321
- // $textTruncate: 3;
322
- //
323
- // @example css - Generated CSS (simplified for .text-lines:2)
324
- // .text-lines\:2 { /* Note: CSS escapes the colon */
325
- // display: -webkit-box;
326
- // -webkit-line-clamp: 2;
327
- // line-clamp: 2;
328
- // -webkit-box-orient: vertical;
329
- // overflow: hidden;
330
- // }
331
- // // ... responsive versions if applicable ...
332
- //
333
- @if $useTextTruncate {
334
- @include mQ.multiSizes() using ($size, $divider) {
335
- @each $i in $textTruncate {
336
- $mainClass: if($size, '#{$size}#{$divider}text-lines#{\:}#{$i}', 'text-lines#{\:}#{$i}');
337
-
338
- .#{$mainClass} {
339
- display: -webkit-box;
340
- -webkit-line-clamp: #{$i};
341
- line-clamp: #{$i};
342
- -webkit-box-orient: vertical;
343
- overflow: hidden;
344
- }
345
- }
346
- }
347
- }
1
+ @use 'sass:meta';
2
+ @use 'sass:string';
3
+ @use 'sass:map';
4
+ @use 'sass:list';
5
+ @use '../variables' as vars;
6
+ @use '../functions/validations' as val;
7
+ @use '../functions/typographic' as typo;
8
+ @use '../settings/configs' as configs;
9
+ @use '../functions/mediaQueries' as mQ;
10
+ @use '../settings/index' as settings;
11
+ @use '../settings/defaults' as defs;
12
+
13
+ // Definitions
14
+ $useFontFamilies: if(vars.$useFontFamilies != null, vars.$useFontFamilies, settings.$useFontFamilies);
15
+ $fonts: if(vars.$fonts != (), vars.$fonts, defs.$fonts);
16
+ $fontWeights: if(vars.$fontWeights != (), vars.$fontWeights, defs.$fontWeights);
17
+ $fontStyles: if(vars.$fontStyles != (), vars.$fontStyles, defs.$fontStyles);
18
+ $fontFormat: if(vars.$fontFormat != (), vars.$fontFormat, defs.$fontFormat);
19
+ $defaultFontFamilies: if(vars.$defaultFontFamilies != null, vars.$defaultFontFamilies, defs.$defaultFontFamilies);
20
+ $useFontSizes: if(vars.$useFontSizes != null, vars.$useFontSizes, settings.$useFontSizes);
21
+ $fontSizes: if(vars.$fontSizes != (), vars.$fontSizes, defs.$fontSizes);
22
+ $useFontShapes: if(vars.$useFontShapes != null, vars.$useFontShapes, settings.$useFontShapes);
23
+ $useTextAligns: if(vars.$useTextAligns != null, vars.$useTextAligns, settings.$useTextAligns);
24
+ $useTextTruncate: if(vars.$useTextTruncate != null, vars.$useTextTruncate, settings.$useTextTruncate);
25
+ $textTruncate: if(vars.$textTruncate != (), vars.$textTruncate, defs.$textTruncate);
26
+
27
+ // Typographic Utilities
28
+ // --------------------------------------
29
+ // This file generates various typographic utility classes and @font-face rules
30
+ // based on the settings and variables defined in the project.
31
+ // Each section can be enabled or disabled via the `$use...` variables.
32
+
33
+ // Font Families & @font-face ----- ----- ----- -----
34
+ //
35
+ // @description
36
+ // Generates @font-face rules based on the `vars.$fonts` map and
37
+ // corresponding utility classes for applying font families, weights, and styles.
38
+ // The generation of these rules and classes is controlled by the
39
+ // `$useFontFamilies` boolean variable.
40
+ //
41
+ // @see $useFontFamilies
42
+ // @see vars.$fonts
43
+ // @see vars.$fontWeights
44
+ // @see vars.$fontStyles
45
+ // @see configs.$fontWeightsValues (for mapping weight names to numerical values)
46
+ // @see $defaultFontFamilies (for fallback fonts)
47
+ // @see typo.font (mixin used for @font-face generation)
48
+ // @see mQ.multiSizes (mixin used for responsive class generation)
49
+ //
50
+ // @generatedClasses
51
+ // - @font-face rules for each font variant.
52
+ // - Font family/weight classes:
53
+ // - e.g., `.regular`, `.bold`, `.italic`
54
+ // - e.g., `.fontName-0`, `.fontName-1` (if multiple fonts with same weight names, indexed by $fI)
55
+ // - Responsive font family/weight classes (if `mQ.multiSizes` is configured):
56
+ // - e.g., `md:regular`, `lg:bold`
57
+ // - Font style classes (applied as modifiers):
58
+ // - e.g., `.regular.italic`
59
+ //
60
+ // @example scss - Configuration in vars.$fonts (simplified)
61
+ // vars.$fonts: (
62
+ // sans: (
63
+ // weights: (regular, bold),
64
+ // styles: (normal, italic),
65
+ // variants: (
66
+ // latin: (title: "OpenSans") // `title` here is used for font-family in @font-face
67
+ // )
68
+ // )
69
+ // );
70
+ //
71
+ // @example css - Generated CSS (simplified, assuming $fI is 0 for the first font)
72
+ // @font-face { font-family: "OpenSans-0"; src: local("OpenSans Regular"); font-weight: 400; font-style: normal; }
73
+ // .regular { font-family: "OpenSans-0", "Fallback Font"; font-weight: 400; }
74
+ // .regular.italic { font-style: italic; }
75
+ // .bold { font-family: "OpenSans-0", "Fallback Font"; font-weight: 700; }
76
+ // // ... responsive versions if applicable ...
77
+ //
78
+
79
+ @if $useFontFamilies {
80
+ // Font families ----- -----
81
+ $fI: 0;
82
+ @each $fontKey, $font in $fonts {
83
+ // Validate parameters
84
+ $checkedFontKey: val.string($fontKey, 'Typographic.fonts.title');
85
+ $checkedFont: val.map($font, 'Typographic.fonts');
86
+
87
+ $weights: map.get($font, 'weights');
88
+ $weights: if($weights != null, map.get($font, 'weights'), $fontWeights);
89
+ $styles: map.get($font, 'styles');
90
+ $styles: if($styles != null, map.get($font, 'styles'), $fontStyles);
91
+ $variants: map.get($font, 'variants');
92
+
93
+ // Validate parameters
94
+ $checkedWeights: val.list($weights, 'Typographic.fontFace.weights');
95
+ $checkedStyles: val.list($styles, 'Typographic.fontFace.styles');
96
+ $checkedVariants: val.map($variants, 'Typographic.fontFace.variants');
97
+
98
+ @each $weight in $weights {
99
+ @each $style in $styles {
100
+ @each $lang, $fontFace in $variants {
101
+ $title: map.get($fontFace, 'title');
102
+ $unicode: if(map.has-key($fontFace, 'unicode'), map.get($fontFace, 'unicode'), null);
103
+ $format: if(map.has-key($fontFace, 'format'), map.get($fontFace, 'format'), $fontFormat);
104
+ $isLocal: if(map.has-key($fontFace, 'local'), map.get($fontFace, 'isLocal'), true);
105
+ $externalUrl: if(map.has-key($fontFace, 'url'), map.get($fontFace, 'url'), null);
106
+
107
+ // Validate parameters
108
+ $checkedIsLocal: val.boolean($isLocal, 'Typographic.fontFace.local');
109
+ $checkedTitle: val.string($title, 'Typographic.fontFace.title');
110
+ $checkedFormat: val.string($format, 'Typographic.fontFace.format');
111
+ @if $unicode {
112
+ $checkedUnicode: val.string($unicode, 'Typographic.fontFace.unicode');
113
+ }
114
+
115
+ @include typo.font($title, $weight, $format, $style, $fI, $unicode, $isLocal, $externalUrl);
116
+ }
117
+ }
118
+ }
119
+
120
+ @include mQ.multiSizes() using ($size, $divider) {
121
+ @each $weight in $weights {
122
+ @each $style in $styles {
123
+ // Font weights
124
+ // Validate parameters
125
+ $styleClass: if($fI == 0, $weight, '#{$weight}-#{$fI}');
126
+ $weightValue: map.get(configs.$fontWeightsValues, $weight);
127
+
128
+ $mainClass: if($size, #{$size}#{$divider}#{$styleClass}, $styleClass);
129
+
130
+ .#{$mainClass} {
131
+ font-family:
132
+ '#{$styleClass}',
133
+ $defaultFontFamilies if($size, !important, null);
134
+ font-weight: if($size, $weightValue !important, $weightValue);
135
+ @if meta.type-of($styles) == 'list' and list.length($styles) > 0 {
136
+ &.#{$style} {
137
+ font-style: $style;
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
144
+
145
+ $fI: $fI + 1;
146
+ }
147
+ }
148
+
149
+ // Font Sizes ----- ----- ----- -----
150
+ //
151
+ // @description
152
+ // Generates utility classes for applying predefined font sizes.
153
+ // The generation of these classes is controlled by the
154
+ // `$useFontSizes` boolean variable.
155
+ // Font sizes are defined in `$fontSizes`.
156
+ // Responsive variants are generated using the `mQ.multiSizes` mixin.
157
+ //
158
+ // @see $useFontSizes
159
+ // @see $fontSizes
160
+ // @see mQ.multiSizes
161
+ //
162
+ // @generatedClasses
163
+ // - Font size classes:
164
+ // - e.g., `.text-sm`, `.text-base`, `.text-lg` (based on keys in `$fontSizes`)
165
+ // - Responsive font size classes:
166
+ // - e.g., `md:text-sm`, `lg:text-base`
167
+ //
168
+ // @example scss - Configuration in $fontSizes
169
+ // $fontSizes: (
170
+ // sm: 0.875rem,
171
+ // base: 1rem
172
+ // );
173
+ //
174
+ // @example css - Generated CSS (simplified)
175
+ // .text-sm { font-size: 0.875rem; }
176
+ // .text-base { font-size: 1rem; }
177
+ // // ... responsive versions if applicable ...
178
+ //
179
+ @if $useFontSizes {
180
+ @include mQ.multiSizes() using ($size, $divider) {
181
+ @each $fontSize, $value in $fontSizes {
182
+ $mainClass: if($size, #{$size}#{$divider}#{$fontSize}, $fontSize);
183
+
184
+ .#{$mainClass} {
185
+ font-size: $value if($size, !important, null);
186
+ }
187
+ }
188
+ }
189
+ }
190
+
191
+ // Font Shapes (Text Transformation) ----- ----- ----- -----
192
+ //
193
+ // @description
194
+ // Generates utility classes for text transformations (e.g., uppercase, lowercase)
195
+ // and other font-related shape properties like `font-variant`.
196
+ // The generation of these classes is controlled by the
197
+ // `$useFontShapes` boolean variable.
198
+ // Shapes are defined in `configs.$fontShapes` and applied using the `typo.fontShapes` mixin.
199
+ // Responsive variants are generated using the `mQ.multiSizes` mixin.
200
+ //
201
+ // @see $useFontShapes
202
+ // @see configs.$fontShapes
203
+ // @see typo.fontShapes
204
+ // @see mQ.multiSizes
205
+ //
206
+ // @generatedClasses
207
+ // - Text transformation/shape classes:
208
+ // - e.g., `.uppercase`, `.lowercase`, `.small-caps` (based on `configs.$fontShapes`)
209
+ // - Responsive text transformation/shape classes:
210
+ // - e.g., `md:uppercase`, `lg:small-caps`
211
+ //
212
+ // @example scss - Configuration in configs.$fontShapes
213
+ // configs.$fontShapes: (
214
+ // text-transform: (uppercase, lowercase, capitalize),
215
+ // font-variant: (small-caps)
216
+ // );
217
+ //
218
+ // @example css - Generated CSS (simplified)
219
+ // .uppercase { text-transform: uppercase; }
220
+ // .small-caps { font-variant: small-caps; }
221
+ // // ... responsive versions if applicable ...
222
+ //
223
+ @if $useFontShapes {
224
+ @include mQ.multiSizes() using ($size, $divider) {
225
+ @each $type, $values in configs.$fontShapes {
226
+ @each $value in $values {
227
+ @include typo.fontShapes(if($size, '#{$size}#{$divider}#{$value}', $value), $type, $value);
228
+ }
229
+ }
230
+ }
231
+ }
232
+
233
+ // Text Alignment ----- ----- ----- -----
234
+ //
235
+ // @description
236
+ // Generates utility classes for text alignment (e.g., left, center, right).
237
+ // The generation of these classes is controlled by the
238
+ // `$useTextAligns` boolean variable.
239
+ // Alignments are defined in `configs.$aligns`.
240
+ // Responsive variants are generated using the `mQ.multiSizes` mixin.
241
+ //
242
+ // @see $useTextAligns
243
+ // @see configs.$aligns
244
+ // @see mQ.multiSizes
245
+ //
246
+ // @generatedClasses
247
+ // - Text alignment classes:
248
+ // - e.g., `.text-left`, `.text-center`, `.text-right`
249
+ // - Responsive text alignment classes:
250
+ // - e.g., `md:text-left`, `lg:text-center`
251
+ //
252
+ // @example scss - Configuration in configs.$aligns
253
+ // configs.$aligns: (left, center, right, justify);
254
+ //
255
+ // @example css - Generated CSS (simplified)
256
+ // .text-left { text-align: left; }
257
+ // // ... responsive versions if applicable ...
258
+ //
259
+ @if $useTextAligns {
260
+ @include mQ.multiSizes() using ($size, $divider) {
261
+ @each $dir in configs.$aligns {
262
+ // Validate parameters
263
+ $checkedDir: val.listItem(configs.$aligns, $dir, 'Typographic.fonts.aligns');
264
+
265
+ $mainClass: if($size, '#{$size}#{$divider}text-#{$dir}', 'text-#{$dir}');
266
+ .#{$mainClass} {
267
+ text-align: if($size, $dir !important, $dir);
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ // Text Truncation ----- ----- ----- -----
274
+ //
275
+ // @description
276
+ // Generates utility classes for multi-line text truncation (ellipsis).
277
+ // The generation of these classes is controlled by the
278
+ // `$useTextTruncate` boolean variable.
279
+ // The maximum number of lines is controlled by `$textTruncate`.
280
+ // Responsive variants are generated using the `mQ.multiSizes` mixin.
281
+ //
282
+ // @see $useTextTruncate
283
+ // @see $textTruncate
284
+ // @see mQ.multiSizes
285
+ //
286
+ // @generatedClasses
287
+ // - Text truncation classes:
288
+ // - e.g., `.text-lines:1`, `.text-lines:2`, ... up to `$textTruncate`
289
+ // - Responsive text truncation classes:
290
+ // - e.g., `md:text-lines:1`, `lg:text-lines:2`
291
+ //
292
+ // @example scss - Configuration in $textTruncate
293
+ // $textTruncate: 3;
294
+ //
295
+ // @example css - Generated CSS (simplified for .text-lines:2)
296
+ // .text-lines\:2 { /* Note: CSS escapes the colon */
297
+ // display: -webkit-box;
298
+ // -webkit-line-clamp: 2;
299
+ // line-clamp: 2;
300
+ // -webkit-box-orient: vertical;
301
+ // overflow: hidden;
302
+ // }
303
+ // // ... responsive versions if applicable ...
304
+ //
305
+ @if $useTextTruncate {
306
+ @include mQ.multiSizes() using ($size, $divider) {
307
+ @each $i in $textTruncate {
308
+ $mainClass: if($size, '#{$size}#{$divider}text-lines#{\:}#{$i}', 'text-lines#{\:}#{$i}');
309
+
310
+ .#{$mainClass} {
311
+ display: -webkit-box;
312
+ -webkit-line-clamp: #{$i};
313
+ line-clamp: #{$i};
314
+ -webkit-box-orient: vertical;
315
+ overflow: hidden;
316
+ }
317
+ }
318
+ }
319
+ }