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,243 +1,230 @@
1
- @use 'sass:meta';
2
- @use 'sass:color';
3
- @use 'sass:math';
4
- @use 'sass:list';
5
- @use 'sass:map';
6
- @use '../settings/configs' as configs;
7
- @use '../settings/index' as settings;
8
- @use '../variables' as vars;
9
- @use '../settings/defaults' as defs;
10
- @use '../functions/validations' as val;
11
-
12
- // Definitions
13
- $colors: if(meta.variable-exists('vars.$colors') and vars.$colors, vars.$colors, defs.$colors);
14
- $opacities: if(meta.variable-exists('vars.$opacities') and vars.$opacities, vars.$opacities, defs.$opacities);
15
- $useColorsLightMode: if(
16
- meta.variable-exists('vars.$useColorsLightMode') and vars.$useColorsLightMode,
17
- vars.$useColorsLightMode,
18
- settings.$useColorsLightMode
19
- );
20
- $useColorsDarkMode: if(
21
- meta.variable-exists('vars.$useColorsDarkMode') and vars.$useColorsDarkMode,
22
- vars.$useColorsDarkMode,
23
- settings.$useColorsDarkMode
24
- );
25
- $useColorsOpacities: if(
26
- meta.variable-exists('vars.$useColorsOpacities') and vars.$useColorsOpacities,
27
- vars.$useColorsOpacities,
28
- settings.$useColorsOpacities
29
- );
30
-
31
- // Color Convertors ----- ----- ----- -----
32
- //
33
- // @function hexToRgba
34
- // --------------------------------------
35
- // Converts a hex color value to RGBA format
36
- //
37
- // @param {Color} $color - The hex color to convert (e.g. '#ffffff' or '#fff')
38
- // @param {Number} $opacity - Optional opacity value between 0 and 1 (default: 1)
39
- // @return {Color} - The color in rgba() format
40
- //
41
- // @example scss
42
- // color: hexToRgba('#ffffff');
43
- // // Returns rgba(255, 255, 255, 1)
44
- // color: hexToRgba('#ffffff', 0.5);
45
- // // Returns rgba(255, 255, 255, 0.5)
46
- // color: hexToRgba('#ffffff80');
47
- // // Returns rgba(255, 255, 255, 0.5)
48
- //
49
- @function hexToRgba($color, $opacity: 1, $debugIn: null) {
50
- // Validate parameters
51
- $checkedColor: val.hexColor('color', $color, 'hexToRgba().#{$debugIn}');
52
- $checkedOpacity: val.opacity($opacity, 'hexToRgba().#{$debugIn}');
53
-
54
- @return rgba(
55
- color.channel($checkedColor, 'red', $space: rgb),
56
- color.channel($checkedColor, 'green', $space: rgb),
57
- color.channel($checkedColor, 'blue', $space: rgb),
58
- $checkedOpacity
59
- );
60
- }
61
-
62
- // Use Color ----- ----- ----- -----
63
- //
64
- // @function useColor
65
- // --------------------------------------
66
- // Retrieves a color from any color map with optional variant and opacity
67
- //
68
- // @param {String} $color - The color key to retrieve from the map
69
- // @param {String} $mode - Optional mode, must be 'light' or 'dark' (default: 'light')
70
- // @param {Number} $opacity - Optional opacity value between 0 and 100 (default: 100)
71
- // @param {Map} $map - Optional color map to use (defaults to $colors)
72
- // @return {Color} - The color value, possibly with applied opacity
73
- // @throws {Error} - If mode is provided but isn't 'light' or 'dark'
74
- // @throws {Error} - If opacity is provided but isn't a number between 0 and 100
75
- //
76
- // @example scss
77
- // // Using default color map ($colors)
78
- // color: useColor('primary', 'light', 0.5);
79
- // // Returns the light variant of primary color with 50% opacity
80
- //
81
- // // Using a custom color map
82
- // color: useColor('secondary', 'dark', null, $customMap);
83
- // // Returns the dark variant of secondary color from custom map
84
- //
85
- @function useColor($color, $mode: 'light', $opacity: 100) {
86
- // Validate parameters
87
- $checkedMode: val.colorMode($mode, 'useColor()');
88
- $checkedOpacity: val.colorOpacity($opacity, 'useColor()');
89
-
90
- @if $color {
91
- $value: map.get($color, $mode);
92
-
93
- @if $checkedOpacity {
94
- @return hexToRgba($value, math.div($opacity, 100), 'useColor().#{$value}');
95
- } @else {
96
- @return $value;
97
- }
98
- } @else {
99
- @return null;
100
- }
101
- }
102
-
103
- @function useColorWithMap($color, $mode: 'light', $opacity: 100, $map: $colors) {
104
- // Validate parameters
105
- $checkedMap: val.map($map, 'useColorWithMap().map');
106
-
107
- $colorValue: map.get($checkedMap, $color);
108
- @return useColor($colorValue, $mode, $opacity);
109
- }
110
-
111
- // @mixin useColorProperty
112
- // --------------------------------------
113
- // Applies color properties with theme variant support while handling light/dark themes
114
- // and creating appropriate CSS selectors for different use cases.
115
- //
116
- // @param {String} $colorClass - The CSS class name to apply the color to (e.g., 'color-1', 'bg\:color-1')
117
- // @param {String|Null} $class - The CSS class prefix (e.g., 'bg', 'border', null for 'color')
118
- // @param {String} $property - The CSS property to set (e.g., 'color', 'background-color')
119
- // @param {Map} $color - The color map with light/dark variants
120
- // @param {Map} $map - The parent color map containing all colors
121
- // @param {Number} $opacity - Optional opacity value between 0-100 (default: 100)
122
- // @throws {Error} - If provided parameters fail validation through val.* functions
123
- //
124
- // @example scss
125
- // // Apply primary color as text color with 50% opacity
126
- // @include useColorProperty("color-1", null, "color", $primaryColor, $colorsMap, 50);
127
- //
128
- // // Apply primary color as background with full opacity
129
- // @include useColorProperty("bg\:color-1", "bg", "background-color", $primaryColor, $colorsMap);
130
- //
131
- // Generated Selectors:
132
- // Each call to this mixin generates three CSS selectors to support different theming approaches:
133
- //
134
- // 1. Parent/child relationship: `.light .className`, `.dark .className`
135
- // For theme inheritance from parent elements
136
- // Example: <div class="light"><span class="color-1">Themed text</span></div>
137
- //
138
- // 2. Modifier class: `.className.light`, `.className.dark`
139
- // For direct theme application to the element itself
140
- // Example: <span class="color-1 light">Themed text</span>
141
- //
142
- // 3. Prefixed class: `.light\:className`, `.dark\:className`
143
- // For utility-first CSS approaches
144
- // Example: <span class="light\:color-1">Themed text</span>
145
- //
146
- // Note: When light and dark variants are identical, a single class without theme
147
- // modifiers is generated to reduce CSS output size.
148
- @mixin useColorProperty($colorClass, $class, $property, $color, $map, $opacity: 100) {
149
- // Validate parameters
150
- $checkedClass: val.colorClass($class, 'useColorProperty().class');
151
- $checkedProperty: val.colorProperty($property, 'useColorProperty().property');
152
- $checkedMap: val.map($map, 'useColorProperty().map');
153
- $checkedOpacity: val.colorOpacity($opacity, 'useColorProperty().opacity');
154
- $checkedLight: val.mapItem($color, 'light', 'light/dark', 'useColorProperty().color');
155
- $checkedDark: val.mapItem($color, 'dark', 'light/dark', 'useColorProperty().color');
156
-
157
- $light: map.get($color, 'light');
158
- $dark: map.get($color, 'dark');
159
-
160
- $checkedLightValue: val.hexColor('#{$colorClass}.light', $light, 'root-colors()');
161
- $checkedDarkValue: val.hexColor('#{$colorClass}.dark', $dark, 'root-colors()');
162
-
163
- @if $light and $dark and $dark != $light {
164
- @if ($useColorsLightMode) {
165
- .light .#{$colorClass},
166
- .#{$colorClass}.light,
167
- .light\:#{$colorClass} {
168
- #{$property}: useColor($color, 'light', $opacity);
169
- }
170
- }
171
-
172
- @if ($useColorsDarkMode) {
173
- .dark .#{$colorClass},
174
- .#{$colorClass}.dark,
175
- .dark\:#{$colorClass} {
176
- #{$property}: useColor($color, 'dark', $opacity);
177
- }
178
- }
179
- } @else {
180
- .#{$colorClass} {
181
- #{$property}: useColor($color, if($light, 'light', 'dark'), $opacity);
182
- }
183
- }
184
- }
185
-
186
- // Use Colors Map ----- ----- ----- -----
187
- //
188
- // @mixin useColorsMap
189
- // --------------------------------------
190
- // Creates color utility classes using useColor() function for theme variant handling
191
- // @param {Map} $map - The color map to use (e.g., $colors)
192
- // @param {Boolean} $withOpacity - Whether to generate opacity variants (default: true)
193
- // @throws {Error} - If $map is not a valid map
194
- //
195
- // @example scss
196
- // @include useColorsMap($themeColors);
197
- // // Creates all color classes with theme support
198
- // // Generated classes include:
199
- // // .color-[colorName], .bg-color-[colorName], .border-color-[colorName]
200
- // // With theme variants like .light, .dark
201
- // // With optional opacity variants like :50, :75
202
- // // With pseudo-class variants like :hover, :focus
203
- //
204
- @mixin useColorsMap($map: $colors, $withOpacity: true) {
205
- // Validate parameters
206
- $checkedMap: val.map($map, 'useColorsMap()');
207
- $checkedWithOpacity: val.boolean($withOpacity, 'useColorsMap()');
208
-
209
- @each $color, $modes in $checkedMap {
210
- @if $color {
211
- @each $class, $property in configs.$colorsPropertiesMap {
212
- $mainClass: if($class, '#{$class}#{\:}color-#{$color}', 'color-#{$color}');
213
-
214
- @include useColorProperty($mainClass, $class, $property, $modes, $map);
215
-
216
- @if $checkedWithOpacity and $useColorsOpacities {
217
- @each $opacity in $opacities {
218
- @include useColorProperty('#{$mainClass}#{\:}#{$opacity}', $class, $property, $modes, $map, $opacity);
219
- }
220
- }
221
-
222
- @each $pseudoClass, $pseudo in configs.$colorsPseudoMap {
223
- @if $pseudoClass != 'placeholder' or ($pseudoClass == 'placeholder' and $class == null) {
224
- @include useColorProperty('#{$mainClass}#{\:}#{$pseudoClass}#{$pseudo}', $class, $property, $modes, $map);
225
-
226
- @if $checkedWithOpacity and $useColorsOpacities {
227
- @each $opacity in $opacities {
228
- @include useColorProperty(
229
- '#{$mainClass}#{\:}#{$opacity}#{\:}#{$pseudoClass}#{$pseudo}',
230
- $class,
231
- $property,
232
- $modes,
233
- $map,
234
- $opacity
235
- );
236
- }
237
- }
238
- }
239
- }
240
- }
241
- }
242
- }
243
- }
1
+ @use 'sass:color';
2
+ @use 'sass:math';
3
+ @use 'sass:list';
4
+ @use 'sass:map';
5
+ @use '../settings/configs' as configs;
6
+ @use '../settings/index' as settings;
7
+ @use '../variables' as vars;
8
+ @use '../settings/defaults' as defs;
9
+ @use '../functions/validations' as val;
10
+
11
+ // Definitions
12
+ $colors: if(vars.$colors != (), vars.$colors, defs.$colors);
13
+ $opacities: if(vars.$opacities != (), vars.$opacities, defs.$opacities);
14
+ $useColorsLightMode: if(vars.$useColorsLightMode != null, vars.$useColorsLightMode, settings.$useColorsLightMode);
15
+ $useColorsDarkMode: if(vars.$useColorsDarkMode != null, vars.$useColorsDarkMode, settings.$useColorsDarkMode);
16
+ $useColorsOpacities: if(vars.$useColorsOpacities != null, vars.$useColorsOpacities, settings.$useColorsOpacities);
17
+
18
+ // Color Convertors ----- ----- ----- -----
19
+ //
20
+ // @function hexToRgba
21
+ // --------------------------------------
22
+ // Converts a hex color value to RGBA format
23
+ //
24
+ // @param {Color} $color - The hex color to convert (e.g. '#ffffff' or '#fff')
25
+ // @param {Number} $opacity - Optional opacity value between 0 and 1 (default: 1)
26
+ // @return {Color} - The color in rgba() format
27
+ //
28
+ // @example scss
29
+ // color: hexToRgba('#ffffff');
30
+ // // Returns rgba(255, 255, 255, 1)
31
+ // color: hexToRgba('#ffffff', 0.5);
32
+ // // Returns rgba(255, 255, 255, 0.5)
33
+ // color: hexToRgba('#ffffff80');
34
+ // // Returns rgba(255, 255, 255, 0.5)
35
+ //
36
+ @function hexToRgba($color, $opacity: 1, $debugIn: null) {
37
+ // Validate parameters
38
+ $checkedColor: val.hexColor('color', $color, 'hexToRgba().#{$debugIn}');
39
+ $checkedOpacity: val.opacity($opacity, 'hexToRgba().#{$debugIn}');
40
+
41
+ @return rgba(
42
+ color.channel($checkedColor, 'red', $space: rgb),
43
+ color.channel($checkedColor, 'green', $space: rgb),
44
+ color.channel($checkedColor, 'blue', $space: rgb),
45
+ $checkedOpacity
46
+ );
47
+ }
48
+
49
+ // Use Color ----- ----- ----- -----
50
+ //
51
+ // @function useColor
52
+ // --------------------------------------
53
+ // Retrieves a color from any color map with optional variant and opacity
54
+ //
55
+ // @param {String} $color - The color key to retrieve from the map
56
+ // @param {String} $mode - Optional mode, must be 'light' or 'dark' (default: 'light')
57
+ // @param {Number} $opacity - Optional opacity value between 0 and 100 (default: 100)
58
+ // @param {Map} $map - Optional color map to use (defaults to $colors)
59
+ // @return {Color} - The color value, possibly with applied opacity
60
+ // @throws {Error} - If mode is provided but isn't 'light' or 'dark'
61
+ // @throws {Error} - If opacity is provided but isn't a number between 0 and 100
62
+ //
63
+ // @example scss
64
+ // // Using default color map ($colors)
65
+ // color: useColor('primary', 'light', 0.5);
66
+ // // Returns the light variant of primary color with 50% opacity
67
+ //
68
+ // // Using a custom color map
69
+ // color: useColor('secondary', 'dark', null, $customMap);
70
+ // // Returns the dark variant of secondary color from custom map
71
+ //
72
+ @function useColor($color, $mode: 'light', $opacity: 100) {
73
+ // Validate parameters
74
+ $checkedMode: val.colorMode($mode, 'useColor()');
75
+ $checkedOpacity: val.colorOpacity($opacity, 'useColor()');
76
+
77
+ @if $color {
78
+ $value: map.get($color, $mode);
79
+
80
+ @if $checkedOpacity {
81
+ @return hexToRgba($value, math.div($opacity, 100), 'useColor().#{$value}');
82
+ } @else {
83
+ @return $value;
84
+ }
85
+ } @else {
86
+ @return null;
87
+ }
88
+ }
89
+
90
+ @function useColorWithMap($color, $mode: 'light', $opacity: 100, $map: $colors) {
91
+ // Validate parameters
92
+ $checkedMap: val.map($map, 'useColorWithMap().map');
93
+
94
+ $colorValue: map.get($checkedMap, $color);
95
+ @return useColor($colorValue, $mode, $opacity);
96
+ }
97
+
98
+ // @mixin useColorProperty
99
+ // --------------------------------------
100
+ // Applies color properties with theme variant support while handling light/dark themes
101
+ // and creating appropriate CSS selectors for different use cases.
102
+ //
103
+ // @param {String} $colorClass - The CSS class name to apply the color to (e.g., 'color-1', 'bg\:color-1')
104
+ // @param {String|Null} $class - The CSS class prefix (e.g., 'bg', 'border', null for 'color')
105
+ // @param {String} $property - The CSS property to set (e.g., 'color', 'background-color')
106
+ // @param {Map} $color - The color map with light/dark variants
107
+ // @param {Map} $map - The parent color map containing all colors
108
+ // @param {Number} $opacity - Optional opacity value between 0-100 (default: 100)
109
+ // @throws {Error} - If provided parameters fail validation through val.* functions
110
+ //
111
+ // @example scss
112
+ // // Apply primary color as text color with 50% opacity
113
+ // @include useColorProperty("color-1", null, "color", $primaryColor, $colorsMap, 50);
114
+ //
115
+ // // Apply primary color as background with full opacity
116
+ // @include useColorProperty("bg\:color-1", "bg", "background-color", $primaryColor, $colorsMap);
117
+ //
118
+ // Generated Selectors:
119
+ // Each call to this mixin generates three CSS selectors to support different theming approaches:
120
+ //
121
+ // 1. Parent/child relationship: `.light .className`, `.dark .className`
122
+ // For theme inheritance from parent elements
123
+ // Example: <div class="light"><span class="color-1">Themed text</span></div>
124
+ //
125
+ // 2. Modifier class: `.className.light`, `.className.dark`
126
+ // For direct theme application to the element itself
127
+ // Example: <span class="color-1 light">Themed text</span>
128
+ //
129
+ // 3. Prefixed class: `.light\:className`, `.dark\:className`
130
+ // For utility-first CSS approaches
131
+ // Example: <span class="light\:color-1">Themed text</span>
132
+ //
133
+ // Note: When light and dark variants are identical, a single class without theme
134
+ // modifiers is generated to reduce CSS output size.
135
+ @mixin useColorProperty($colorClass, $class, $property, $color, $map, $opacity: 100) {
136
+ // Validate parameters
137
+ $checkedClass: val.colorClass($class, 'useColorProperty().class');
138
+ $checkedProperty: val.colorProperty($property, 'useColorProperty().property');
139
+ $checkedMap: val.map($map, 'useColorProperty().map');
140
+ $checkedOpacity: val.colorOpacity($opacity, 'useColorProperty().opacity');
141
+ $checkedLight: val.mapItem($color, 'light', 'light/dark', 'useColorProperty().color');
142
+ $checkedDark: val.mapItem($color, 'dark', 'light/dark', 'useColorProperty().color');
143
+
144
+ $light: map.get($color, 'light');
145
+ $dark: map.get($color, 'dark');
146
+
147
+ $checkedLightValue: val.hexColor('#{$colorClass}.light', $light, 'root-colors()');
148
+ $checkedDarkValue: val.hexColor('#{$colorClass}.dark', $dark, 'root-colors()');
149
+
150
+ @if $light and $dark and $dark != $light {
151
+ @if ($useColorsLightMode) {
152
+ .light .#{$colorClass},
153
+ .#{$colorClass}.light,
154
+ .light\:#{$colorClass} {
155
+ #{$property}: useColor($color, 'light', $opacity);
156
+ }
157
+ }
158
+
159
+ @if ($useColorsDarkMode) {
160
+ .dark .#{$colorClass},
161
+ .#{$colorClass}.dark,
162
+ .dark\:#{$colorClass} {
163
+ #{$property}: useColor($color, 'dark', $opacity);
164
+ }
165
+ }
166
+ } @else {
167
+ .#{$colorClass} {
168
+ #{$property}: useColor($color, if($light, 'light', 'dark'), $opacity);
169
+ }
170
+ }
171
+ }
172
+
173
+ // Use Colors Map ----- ----- ----- -----
174
+ //
175
+ // @mixin useColorsMap
176
+ // --------------------------------------
177
+ // Creates color utility classes using useColor() function for theme variant handling
178
+ // @param {Map} $map - The color map to use (e.g., $colors)
179
+ // @param {Boolean} $withOpacity - Whether to generate opacity variants (default: true)
180
+ // @throws {Error} - If $map is not a valid map
181
+ //
182
+ // @example scss
183
+ // @include useColorsMap($themeColors);
184
+ // // Creates all color classes with theme support
185
+ // // Generated classes include:
186
+ // // .color-[colorName], .bg-color-[colorName], .border-color-[colorName]
187
+ // // With theme variants like .light, .dark
188
+ // // With optional opacity variants like :50, :75
189
+ // // With pseudo-class variants like :hover, :focus
190
+ //
191
+ @mixin useColorsMap($map: $colors, $withOpacity: true) {
192
+ // Validate parameters
193
+ $checkedMap: val.map($map, 'useColorsMap()');
194
+ $checkedWithOpacity: val.boolean($withOpacity, 'useColorsMap()');
195
+
196
+ @each $color, $modes in $checkedMap {
197
+ @if $color {
198
+ @each $class, $property in configs.$colorsPropertiesMap {
199
+ $mainClass: if($class, '#{$class}#{\:}color-#{$color}', 'color-#{$color}');
200
+
201
+ @include useColorProperty($mainClass, $class, $property, $modes, $map);
202
+
203
+ @if $checkedWithOpacity and $useColorsOpacities {
204
+ @each $opacity in $opacities {
205
+ @include useColorProperty('#{$mainClass}#{\:}#{$opacity}', $class, $property, $modes, $map, $opacity);
206
+ }
207
+ }
208
+
209
+ @each $pseudoClass, $pseudo in configs.$colorsPseudoMap {
210
+ @if $pseudoClass != 'placeholder' or ($pseudoClass == 'placeholder' and $class == null) {
211
+ @include useColorProperty('#{$mainClass}#{\:}#{$pseudoClass}#{$pseudo}', $class, $property, $modes, $map);
212
+
213
+ @if $checkedWithOpacity and $useColorsOpacities {
214
+ @each $opacity in $opacities {
215
+ @include useColorProperty(
216
+ '#{$mainClass}#{\:}#{$opacity}#{\:}#{$pseudoClass}#{$pseudo}',
217
+ $class,
218
+ $property,
219
+ $modes,
220
+ $map,
221
+ $opacity
222
+ );
223
+ }
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ }