beathers 5.7.6 → 5.9.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 (48) hide show
  1. package/.prettierrc.js +10 -8
  2. package/CHANGELOG +305 -274
  3. package/css/beathers.min.css +2 -2
  4. package/css/beathers.min.css.map +1 -1
  5. package/docs/colors.md +250 -250
  6. package/docs/grid-system.md +130 -130
  7. package/docs/shaping.md +272 -272
  8. package/docs/typography.md +124 -124
  9. package/package.json +107 -105
  10. package/readme.md +301 -301
  11. package/scripts/commands/build.js +4 -4
  12. package/scripts/commands/clean.d.ts +2 -0
  13. package/scripts/commands/clean.d.ts.map +1 -0
  14. package/scripts/commands/clean.js +22 -0
  15. package/scripts/commands/fonts.d.ts.map +1 -1
  16. package/scripts/commands/fonts.js +4 -3
  17. package/scripts/commands/index.js +8 -8
  18. package/scripts/commands/init.js +1 -1
  19. package/scripts/commands/version-update.d.ts +2 -0
  20. package/scripts/commands/version-update.d.ts.map +1 -0
  21. package/scripts/commands/version-update.js +122 -0
  22. package/scripts/commands/version.js +1 -1
  23. package/scripts/helpers/BuildScssVariables.d.ts +1 -1
  24. package/scripts/helpers/BuildScssVariables.d.ts.map +1 -1
  25. package/scripts/helpers/BuildScssVariables.js +20 -10
  26. package/scripts/helpers/LoadUserConfigs.js +1 -1
  27. package/scripts/helpers/ReadDefaultValues.js +20 -20
  28. package/scripts/types.d.ts +1 -1
  29. package/scripts/types.d.ts.map +1 -1
  30. package/scss/_variables.scss +19 -19
  31. package/scss/beathers.min.scss +15 -14
  32. package/scss/functions/_colors.scss +242 -230
  33. package/scss/functions/_mediaQueries.scss +140 -136
  34. package/scss/functions/_others.scss +113 -79
  35. package/scss/functions/_typographic.scss +133 -129
  36. package/scss/functions/_validations.scss +293 -251
  37. package/scss/settings/_configs.scss +270 -270
  38. package/scss/settings/_defaults.scss +209 -214
  39. package/scss/settings/_index.scss +90 -90
  40. package/scss/style/_button.scss +103 -101
  41. package/scss/style/_colors.scss +156 -146
  42. package/scss/style/_dialog.scss +147 -146
  43. package/scss/style/_glass.scss +98 -80
  44. package/scss/style/_grid.scss +121 -95
  45. package/scss/style/_loader.scss +74 -62
  46. package/scss/style/_resets.scss +176 -168
  47. package/scss/style/_shaping.scss +561 -439
  48. package/scss/style/_typographic.scss +400 -345
@@ -1,129 +1,133 @@
1
- @use 'sass:string';
2
- @use 'sass:map';
3
- @use '../variables' as vars;
4
- @use '../settings/defaults' as defs;
5
- @use '../functions/validations' as val;
6
- @use '../settings/configs' as configs;
7
-
8
- // Definitions
9
- $fontMainPath: if(vars.$fontMainPath != null, vars.$fontMainPath, defs.$fontMainPath);
10
-
11
- // Font Face Mixin
12
- // --------------------------------------
13
- // Generates an @font-face rule.
14
- //
15
- // @param {String} $title - The base name of the font (e.g., "OpenSans").
16
- // @param {String} $weight - The font weight key (e.g., "regular", "bold").
17
- // @param {String} $format - The font file format (e.g., "woff2").
18
- // @param {String} $style - The font style (e.g., "normal", "italic").
19
- // @param {Number} $index [0] - An index appended to the font-family name if multiple fonts share the same weight name.
20
- // @param {String | Null} $unicode [null] - Optional unicode range for the font.
21
- // @param {Boolean} $isLocal [true] - Whether the font is hosted locally or externally.
22
- // @param {String} $externalUrl [""] - The URL for externally hosted fonts (if $isLocal is false).
23
- //
24
- // @example scss
25
- // @include font("OpenSans", "regular", "woff2", "normal", 0, null, true);
26
- // // Generates:
27
- // // @font-face {
28
- // // font-family: "regular"; // Or "regular-0" if $index is 0 but other fonts exist with same weight
29
- // // font-weight: 400;
30
- // // font-style: normal;
31
- // // font-display: swap;
32
- // // src: local("OpenSans-regular"),
33
- // // url("../fonts/OpenSans-regular.woff2") format("woff2");
34
- // // }
35
- //
36
- // @include font("Roboto", "bold", "ttf", "normal", 1, "U+000-5FF", false, "https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmWUlfBBc4.ttf");
37
- // // Generates:
38
- // // @font-face {
39
- // // font-family: "bold-1";
40
- // // font-weight: 700;
41
- // // font-style: normal;
42
- // // font-display: swap;
43
- // // src: url("https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmWUlfBBc4.ttf");
44
- // // unicode-range: U+000-5FF;
45
- // // }
46
- //
47
- @mixin font($key, $title, $weight, $format, $style, $index: 0, $unicode: null, $isLocal: true, $externalUrl: '') {
48
- // Validate parameters
49
- $checkedIsLocal: val.boolean($isLocal, '#{$title}.font().local');
50
- $checkedTitle: val.string($title, '#{$title}.font().title');
51
- $checkedWeight: val.mapItem(
52
- configs.$fontWeightsValues,
53
- $weight,
54
- configs.$fontWeightsValues,
55
- 'Typographic.fontFace.weights.#{$weight}'
56
- );
57
- $checkedStyle: val.listItem(('normal', 'italic', 'oblique'), $style, '#{$title}.font().weights.#{$style}');
58
- $checkIndex: val.number($index, '#{$title}.font().index');
59
- $checkedFormat: val.string($format, '#{$title}.font().format');
60
-
61
- @if (not($isLocal)) {
62
- $checkedExternalUrl: val.string($externalUrl, 'Typographic.fontFace.externalUrl');
63
- }
64
-
65
- $name: if($index == 0, $title, '#{$key}\:#{$title}');
66
- $weightValue: map.get(configs.$fontWeightsValues, $weight);
67
-
68
- @font-face {
69
- font-family: $name;
70
- font-weight: $weightValue;
71
- font-style: $style;
72
- font-display: swap;
73
-
74
- @if ($isLocal) {
75
- src:
76
- local('#{$title}-#{$weight}'),
77
- url(string.unquote('#{$fontMainPath}#{$title}-#{$weight}.#{$format}')) format('#{$format}');
78
- } @else {
79
- src: url(string.unquote('#{$externalUrl}'));
80
- }
81
-
82
- @if $unicode {
83
- // Validate parameters
84
- $checkedUnicode: val.string($unicode, '#{$title}.font().unicode');
85
-
86
- unicode-range: string.unquote($unicode);
87
- }
88
- }
89
- }
90
-
91
- // Font Shapes Mixin
92
- // --------------------------------------
93
- // Applies text transformation, decoration, or style properties to a class.
94
- //
95
- // @param {String} $class - The CSS class name to apply the style to.
96
- // @param {String} $type - The type of shape property ("transform", "decoration", "styles").
97
- // @param {String} $value - The value for the shape property (e.g., "uppercase", "underline", "italic").
98
- // @param {String | Null} $size [null] - Optional size prefix for responsive classes, determines if `!important` is added.
99
- //
100
- // @example scss
101
- // @include fontShapes("uppercase", "transform", "uppercase");
102
- // // Generates:
103
- // // .uppercase {
104
- // // text-transform: uppercase;
105
- // // }
106
- //
107
- // @include fontShapes("md:underline", "decoration", "underline", "md");
108
- // // Generates:
109
- // // .md\\:underline {
110
- // // text-decoration: underline !important;
111
- // // }
112
- //
113
- @mixin fontShapes($class, $type, $value) {
114
- $shapeList: map.get(configs.$fontShapes, $type);
115
-
116
- // Validate parameters
117
- $checkedType: val.mapItem(configs.$fontShapes, $type, configs.$fontShapes, 'fontShapes().#{$type}');
118
- $checkedValue: val.listItem($shapeList, $value, 'fontShapes().#{$value}');
119
-
120
- .#{$class} {
121
- @if $type == 'transform' {
122
- text-transform: $value;
123
- } @else if $type == 'decoration' {
124
- text-decoration: $value;
125
- } @else if $type == 'styles' {
126
- font-style: $value;
127
- }
128
- }
129
- }
1
+ @use 'sass:string';
2
+ @use 'sass:map';
3
+ @use '../variables' as vars;
4
+ @use '../settings/defaults' as defs;
5
+ @use '../functions/validations' as val;
6
+ @use '../settings/configs' as configs;
7
+
8
+ // Definitions
9
+ $fontMainPath: if(
10
+ sass(vars.$fontMainPath != null): vars.$fontMainPath; else: defs.$fontMainPath
11
+ );
12
+
13
+ // Font Face Mixin
14
+ // --------------------------------------
15
+ // Generates an @font-face rule.
16
+ //
17
+ // @param {String} $title - The base name of the font (e.g., "OpenSans").
18
+ // @param {String} $weight - The font weight key (e.g., "regular", "bold").
19
+ // @param {String} $format - The font file format (e.g., "woff2").
20
+ // @param {String} $style - The font style (e.g., "normal", "italic").
21
+ // @param {Number} $index [0] - An index appended to the font-family name if multiple fonts share the same weight name.
22
+ // @param {String | Null} $unicode [null] - Optional unicode range for the font.
23
+ // @param {Boolean} $isLocal [true] - Whether the font is hosted locally or externally.
24
+ // @param {String} $externalUrl [""] - The URL for externally hosted fonts (if $isLocal is false).
25
+ //
26
+ // @example scss
27
+ // @include font("OpenSans", "regular", "woff2", "normal", 0, null, true);
28
+ // // Generates:
29
+ // // @font-face {
30
+ // // font-family: "regular"; // Or "regular-0" if $index is 0 but other fonts exist with same weight
31
+ // // font-weight: 400;
32
+ // // font-style: normal;
33
+ // // font-display: swap;
34
+ // // src: local("OpenSans-regular"),
35
+ // // url("../fonts/OpenSans-regular.woff2") format("woff2");
36
+ // // }
37
+ //
38
+ // @include font("Roboto", "bold", "ttf", "normal", 1, "U+000-5FF", false, "https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmWUlfBBc4.ttf");
39
+ // // Generates:
40
+ // // @font-face {
41
+ // // font-family: "bold-1";
42
+ // // font-weight: 700;
43
+ // // font-style: normal;
44
+ // // font-display: swap;
45
+ // // src: url("https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmWUlfBBc4.ttf");
46
+ // // unicode-range: U+000-5FF;
47
+ // // }
48
+ //
49
+ @mixin font($key, $title, $weight, $format, $style, $index: 0, $unicode: null, $isLocal: true, $externalUrl: '') {
50
+ // Validate parameters
51
+ $checkedIsLocal: val.boolean($isLocal, '#{$title}.font().local');
52
+ $checkedTitle: val.string($title, '#{$title}.font().title');
53
+ $checkedWeight: val.mapItem(
54
+ configs.$fontWeightsValues,
55
+ $weight,
56
+ configs.$fontWeightsValues,
57
+ 'Typographic.fontFace.weights.#{$weight}'
58
+ );
59
+ $checkedStyle: val.listItem(('normal', 'italic', 'oblique'), $style, '#{$title}.font().weights.#{$style}');
60
+ $checkIndex: val.number($index, '#{$title}.font().index');
61
+ $checkedFormat: val.string($format, '#{$title}.font().format');
62
+
63
+ @if (not($isLocal)) {
64
+ $checkedExternalUrl: val.string($externalUrl, 'Typographic.fontFace.externalUrl');
65
+ }
66
+
67
+ $name: if(
68
+ sass($index == 0): $weight; else: '#{$key}\:#{$weight}'
69
+ );
70
+ $weightValue: map.get(configs.$fontWeightsValues, $weight);
71
+
72
+ @font-face {
73
+ font-family: $name;
74
+ font-weight: $weightValue;
75
+ font-style: $style;
76
+ font-display: swap;
77
+
78
+ @if ($isLocal) {
79
+ src:
80
+ local('#{$title}-#{$weight}'),
81
+ url(string.unquote('#{$fontMainPath}#{$title}-#{$weight}.#{$format}')) format('#{$format}');
82
+ } @else {
83
+ src: url(string.unquote('#{$externalUrl}'));
84
+ }
85
+
86
+ @if $unicode {
87
+ // Validate parameters
88
+ $checkedUnicode: val.string($unicode, '#{$title}.font().unicode');
89
+
90
+ unicode-range: string.unquote($unicode);
91
+ }
92
+ }
93
+ }
94
+
95
+ // Font Shapes Mixin
96
+ // --------------------------------------
97
+ // Applies text transformation, decoration, or style properties to a class.
98
+ //
99
+ // @param {String} $class - The CSS class name to apply the style to.
100
+ // @param {String} $type - The type of shape property ("transform", "decoration", "styles").
101
+ // @param {String} $value - The value for the shape property (e.g., "uppercase", "underline", "italic").
102
+ // @param {String | Null} $size [null] - Optional size prefix for responsive classes, determines if `!important` is added.
103
+ //
104
+ // @example scss
105
+ // @include fontShapes("uppercase", "transform", "uppercase");
106
+ // // Generates:
107
+ // // .uppercase {
108
+ // // text-transform: uppercase;
109
+ // // }
110
+ //
111
+ // @include fontShapes("md:underline", "decoration", "underline", "md");
112
+ // // Generates:
113
+ // // .md\\:underline {
114
+ // // text-decoration: underline !important;
115
+ // // }
116
+ //
117
+ @mixin fontShapes($class, $type, $value) {
118
+ $shapeList: map.get(configs.$fontShapes, $type);
119
+
120
+ // Validate parameters
121
+ $checkedType: val.mapItem(configs.$fontShapes, $type, configs.$fontShapes, 'fontShapes().#{$type}');
122
+ $checkedValue: val.listItem($shapeList, $value, 'fontShapes().#{$value}');
123
+
124
+ .#{$class} {
125
+ @if $type == 'transform' {
126
+ text-transform: $value;
127
+ } @else if $type == 'decoration' {
128
+ text-decoration: $value;
129
+ } @else if $type == 'styles' {
130
+ font-style: $value;
131
+ }
132
+ }
133
+ }