beathers 5.0.0

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