beathers 5.4.0 → 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.
@@ -1,146 +1,146 @@
1
- @use 'sass:map';
2
- @use '../variables' as vars;
3
- @use '../settings/defaults' as defs;
4
- @use '../functions/validations' as val;
5
- @use '../settings/configs' as configs;
6
- @use '../functions/colors' as colors;
7
- @use '../settings/index' as settings;
8
-
9
- // Definitions
10
- $useColors: if(vars.$useColors != null, vars.$useColors, settings.$useColors);
11
- $colors: if(vars.$colors != (), vars.$colors, defs.$colors);
12
- $useCurrentColors: if(vars.$useCurrentColors != null, vars.$useCurrentColors, settings.$useCurrentColors);
13
- $useRootColors: if(vars.$useRootColors != null, vars.$useRootColors, settings.$useRootColors);
14
-
15
- // Colors System Module
16
- // --------------------------
17
- // This file is responsible for generating color utility classes and CSS variables
18
- // based on the color maps defined in the variables file.
19
- //
20
- // Key features:
21
- // 1. Generates color utility classes from the main colors map
22
- // 2. Creates currentColor utility classes
23
- // 3. Sets up CSS variables for all defined colors
24
- //
25
- // The color system supports:
26
- // - Light and dark mode theming
27
- // - Opacity variations
28
- // - Pseudo-class variants (:hover, :focus, etc.)
29
- //
30
- // @requires ../functions/colors.scss - For color utility functions and mixins
31
- // @requires ../settings/configs.scss - For configuration variables
32
- // @requires ../functions/validations.scss - For validation utilities
33
- // @requires ../variables.scss - For color definitions
34
-
35
- @if $useColors {
36
- // Color Utility Classes
37
- // --------------------
38
- // Generate color utility classes from the main colors map.
39
- // Uses the useColorsMap mixin from colors functions to create a comprehensive
40
- // set of color utilities for all the colors defined in $colors.
41
- //
42
- // Generated classes include:
43
- // - .color-[colorName] - Sets text color
44
- // - .bg-color-[colorName] - Sets background color
45
- // - .border-color-[colorName] - Sets border color
46
- //
47
- // With light/dark theme variants:
48
- // - Automatically applies correct color based on .light/.dark context
49
- // - Supports direct class application with .color-[colorName].light
50
- //
51
- // With opacity variants (e.g., :50 for 50% opacity):
52
- // - .color-[colorName]:50
53
- // - .bg-color-[colorName]:75
54
- //
55
- // With pseudo-class variants:
56
- // - .color-[colorName]:hover
57
- // - .bg-color-[colorName]:focus
58
- @include colors.useColorsMap;
59
- }
60
-
61
- @if $useCurrentColors {
62
- // CurrentColor Utility Classes
63
- // ----------------------------
64
- // Creates utility classes for applying the CSS `currentColor` value to various CSS properties
65
- // as defined in the configs.$colorsPropertiesMap.
66
- //
67
- // For each property in the map (color, background-color, border-color, etc.):
68
- // - Creates a base class (.{property}-current-color)
69
- // - Creates pseudo-class variants for interaction states
70
- //
71
- // Examples:
72
- // - .current-color { color: currentColor; }
73
- // - .bg-current-color { background-color: currentColor; }
74
- // - .border-current-color { border-color: currentColor; }
75
- // - .current-color\:hover:hover { color: currentColor; }
76
- // - .bg-current-color\:focus:focus { background-color: currentColor; }
77
- //
78
- // Usage:
79
- // <div class="current-color bg-current-color:hover">
80
- // This text uses currentColor and background changes to currentColor on hover
81
- // </div>
82
- @each $class, $property in configs.$colorsPropertiesMap {
83
- $mainClass: if($class, '#{$class}#{\:}current-color', 'current-color');
84
-
85
- .#{$mainClass} {
86
- #{$property}: currentColor;
87
-
88
- @each $pseudoClass, $pseudo in configs.$colorsPseudoMap {
89
- @if $pseudoClass != 'placeholder' or ($pseudoClass == 'placeholder' and $class == null) {
90
- &#{\:}#{$pseudoClass}#{$pseudo} {
91
- #{$property}: currentColor;
92
- }
93
- }
94
- }
95
- }
96
- }
97
- }
98
-
99
- @if $useRootColors {
100
- // CSS Color Variables
101
- // ------------------
102
- // Generates CSS custom properties (variables) for all colors in the $colors map.
103
- // These variables can be used throughout the application to ensure color consistency.
104
- //
105
- // The implementation:
106
- // 1. Iterates through each color in the $colors map
107
- // 2. Validates the color values through val.mapItem and val.hexColor functions
108
- // 3. Determines if light and dark variants are the same
109
- // 4. Creates appropriate CSS variables based on variant differences
110
- //
111
- // Format:
112
- // - For colors with light/dark variants: --color-{name}-{variant}: {color-value}
113
- // - For colors without variants: --color-{name}: {color-value}
114
- //
115
- // Examples:
116
- // --color-main-light: #ffffff
117
- // --color-main-dark: #1a1d21
118
- // --color-accent: #3498db (when light and dark variants are the same)
119
- //
120
- // Usage:
121
- // .my-element {
122
- // background-color: var(--color-main-light);
123
- // color: var(--color-accent);
124
- // }
125
- :root {
126
- @each $color, $modes in $colors {
127
- // Validate parameters
128
- $checkedLight: val.mapItem($modes, 'light', 'light/dark', 'root-colors()');
129
- $checkedDark: val.mapItem($modes, 'dark', 'light/dark', 'root-colors()');
130
-
131
- $light: map.get($modes, 'light');
132
- $dark: map.get($modes, 'dark');
133
-
134
- // Validate colors
135
- $checkedLightValue: val.hexColor('#{$color}.light', $light, 'root-colors()');
136
- $checkedDarkValue: val.hexColor('#{$color}.dark', $dark, 'root-colors()');
137
-
138
- @if ($light == $dark) {
139
- --color-#{$color}: #{$checkedLightValue};
140
- } @else {
141
- --color-#{$color}-light: #{$checkedLightValue};
142
- --color-#{$color}-dark: #{$checkedDarkValue};
143
- }
144
- }
145
- }
146
- }
1
+ @use 'sass:map';
2
+ @use '../variables' as vars;
3
+ @use '../settings/defaults' as defs;
4
+ @use '../functions/validations' as val;
5
+ @use '../settings/configs' as configs;
6
+ @use '../functions/colors' as colors;
7
+ @use '../settings/index' as settings;
8
+
9
+ // Definitions
10
+ $useColors: if(vars.$useColors != null, vars.$useColors, settings.$useColors);
11
+ $colors: if(vars.$colors != (), vars.$colors, defs.$colors);
12
+ $useCurrentColors: if(vars.$useCurrentColors != null, vars.$useCurrentColors, settings.$useCurrentColors);
13
+ $useRootColors: if(vars.$useRootColors != null, vars.$useRootColors, settings.$useRootColors);
14
+
15
+ // Colors System Module
16
+ // --------------------------
17
+ // This file is responsible for generating color utility classes and CSS variables
18
+ // based on the color maps defined in the variables file.
19
+ //
20
+ // Key features:
21
+ // 1. Generates color utility classes from the main colors map
22
+ // 2. Creates currentColor utility classes
23
+ // 3. Sets up CSS variables for all defined colors
24
+ //
25
+ // The color system supports:
26
+ // - Light and dark mode theming
27
+ // - Opacity variations
28
+ // - Pseudo-class variants (:hover, :focus, etc.)
29
+ //
30
+ // @requires ../functions/colors.scss - For color utility functions and mixins
31
+ // @requires ../settings/configs.scss - For configuration variables
32
+ // @requires ../functions/validations.scss - For validation utilities
33
+ // @requires ../variables.scss - For color definitions
34
+
35
+ @if $useColors {
36
+ // Color Utility Classes
37
+ // --------------------
38
+ // Generate color utility classes from the main colors map.
39
+ // Uses the useColorsMap mixin from colors functions to create a comprehensive
40
+ // set of color utilities for all the colors defined in $colors.
41
+ //
42
+ // Generated classes include:
43
+ // - .color-[colorName] - Sets text color
44
+ // - .bg-color-[colorName] - Sets background color
45
+ // - .border-color-[colorName] - Sets border color
46
+ //
47
+ // With light/dark theme variants:
48
+ // - Automatically applies correct color based on .light/.dark context
49
+ // - Supports direct class application with .color-[colorName].light
50
+ //
51
+ // With opacity variants (e.g., :50 for 50% opacity):
52
+ // - .color-[colorName]:50
53
+ // - .bg-color-[colorName]:75
54
+ //
55
+ // With pseudo-class variants:
56
+ // - .color-[colorName]:hover
57
+ // - .bg-color-[colorName]:focus
58
+ @include colors.useColorsMap;
59
+ }
60
+
61
+ @if $useCurrentColors {
62
+ // CurrentColor Utility Classes
63
+ // ----------------------------
64
+ // Creates utility classes for applying the CSS `currentColor` value to various CSS properties
65
+ // as defined in the configs.$colorsPropertiesMap.
66
+ //
67
+ // For each property in the map (color, background-color, border-color, etc.):
68
+ // - Creates a base class (.{property}-current-color)
69
+ // - Creates pseudo-class variants for interaction states
70
+ //
71
+ // Examples:
72
+ // - .current-color { color: currentColor; }
73
+ // - .bg-current-color { background-color: currentColor; }
74
+ // - .border-current-color { border-color: currentColor; }
75
+ // - .current-color\:hover:hover { color: currentColor; }
76
+ // - .bg-current-color\:focus:focus { background-color: currentColor; }
77
+ //
78
+ // Usage:
79
+ // <div class="current-color bg-current-color:hover">
80
+ // This text uses currentColor and background changes to currentColor on hover
81
+ // </div>
82
+ @each $class, $property in configs.$colorsPropertiesMap {
83
+ $mainClass: if($class, '#{$class}#{\:}current-color', 'current-color');
84
+
85
+ .#{$mainClass} {
86
+ #{$property}: currentColor;
87
+
88
+ @each $pseudoClass, $pseudo in configs.$colorsPseudoMap {
89
+ @if $pseudoClass != 'placeholder' or ($pseudoClass == 'placeholder' and $class == null) {
90
+ &#{\:}#{$pseudoClass}#{$pseudo} {
91
+ #{$property}: currentColor;
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+
99
+ @if $useRootColors {
100
+ // CSS Color Variables
101
+ // ------------------
102
+ // Generates CSS custom properties (variables) for all colors in the $colors map.
103
+ // These variables can be used throughout the application to ensure color consistency.
104
+ //
105
+ // The implementation:
106
+ // 1. Iterates through each color in the $colors map
107
+ // 2. Validates the color values through val.mapItem and val.hexColor functions
108
+ // 3. Determines if light and dark variants are the same
109
+ // 4. Creates appropriate CSS variables based on variant differences
110
+ //
111
+ // Format:
112
+ // - For colors with light/dark variants: --color-{name}-{variant}: {color-value}
113
+ // - For colors without variants: --color-{name}: {color-value}
114
+ //
115
+ // Examples:
116
+ // --color-main-light: #ffffff
117
+ // --color-main-dark: #1a1d21
118
+ // --color-accent: #3498db (when light and dark variants are the same)
119
+ //
120
+ // Usage:
121
+ // .my-element {
122
+ // background-color: var(--color-main-light);
123
+ // color: var(--color-accent);
124
+ // }
125
+ :root {
126
+ @each $color, $modes in $colors {
127
+ // Validate parameters
128
+ $checkedLight: val.mapItem($modes, 'light', 'light/dark', 'root-colors()');
129
+ $checkedDark: val.mapItem($modes, 'dark', 'light/dark', 'root-colors()');
130
+
131
+ $light: map.get($modes, 'light');
132
+ $dark: map.get($modes, 'dark');
133
+
134
+ // Validate colors
135
+ $checkedLightValue: val.hexColor('#{$color}.light', $light, 'root-colors()');
136
+ $checkedDarkValue: val.hexColor('#{$color}.dark', $dark, 'root-colors()');
137
+
138
+ @if ($light == $dark) {
139
+ --color-#{$color}: #{$checkedLightValue};
140
+ } @else {
141
+ --color-#{$color}-light: #{$checkedLightValue};
142
+ --color-#{$color}-dark: #{$checkedDarkValue};
143
+ }
144
+ }
145
+ }
146
+ }
@@ -1,89 +1,89 @@
1
- @use '../functions/mediaQueries' as mQ;
2
- @use '../settings/configs' as configs;
3
- @use '../functions/validations' as val;
4
- @use '../settings/index' as settings;
5
- @use '../functions/others' as func;
6
- @use '../variables' as vars;
7
-
8
- // Definitions
9
- $useGrid: if(vars.$useGrid != null, vars.$useGrid, settings.$useGrid);
10
- $useFlex: if(vars.$useFlex != null, vars.$useFlex, settings.$useFlex);
11
-
12
- @if $useGrid {
13
- .grid {
14
- display: grid;
15
-
16
- @include mQ.multiSizes() using ($size, $divider) {
17
- @include func.gridDivision(column, $size, $divider);
18
- @include func.gridDivision(row, $size, $divider);
19
- }
20
- }
21
- }
22
-
23
- @if $useFlex {
24
- .flex {
25
- display: flex;
26
- flex-direction: row;
27
- flex-wrap: wrap;
28
-
29
- @include mQ.multiSizes() using ($size, $divider) {
30
- @each $property, $values in configs.$flexProperties {
31
- // Validate parameters
32
- $checkedProperty: val.listItem((flex-wrap, flex-direction), $property, 'flex.properties');
33
-
34
- @each $value in $values {
35
- // Validate parameters
36
- $checkedProperty: val.listItem(
37
- (wrap, nowrap, row, row-reverse, column, column-reverse),
38
- $value,
39
- 'flex.properties.values'
40
- );
41
-
42
- $mainClass: if($size, #{$size}#{$divider}#{$value}, $value);
43
-
44
- &.#{$mainClass} {
45
- #{$property}: if($size, $value !important, $value);
46
- }
47
- }
48
- }
49
-
50
- &.row,
51
- &.row-reverse {
52
- @include func.flexDivision(width, 'cols', $size, $divider);
53
- @include func.flexDivision(width, 'col', $size, $divider);
54
- }
55
- &.column,
56
- &.column-reverse {
57
- @include func.flexDivision(height, 'rows', $size, $divider);
58
- @include func.flexDivision(height, 'row', $size, $divider);
59
- }
60
- }
61
- }
62
- }
63
-
64
- @if $useFlex or $useGrid {
65
- @include mQ.multiSizes() using ($size, $divider) {
66
- @each $way, $selections in configs.$justify {
67
- @each $selection, $properties in $selections {
68
- @each $property in $properties {
69
- $mainClass: if($size, '#{$size}#{$divider}#{$way}-#{$selection}#{\:}', '#{$way}-#{$selection}#{\:}');
70
-
71
- .#{$mainClass} {
72
- $prefix: if($property == 'around' or $property == 'between' or $property == 'evenly', 'space-', '');
73
- $flexPrefix: if($property == 'start' or $property == 'end', 'flex-', '');
74
- $value: #{$prefix}#{$property};
75
- $flexValue: #{$flexPrefix}#{$value};
76
-
77
- &#{$property} {
78
- &.flex {
79
- #{$way}-#{$selection}: if($size, $flexValue !important, $flexValue);
80
- }
81
-
82
- #{$way}-#{$selection}: if($size, $value !important, $value);
83
- }
84
- }
85
- }
86
- }
87
- }
88
- }
89
- }
1
+ @use '../functions/mediaQueries' as mQ;
2
+ @use '../settings/configs' as configs;
3
+ @use '../functions/validations' as val;
4
+ @use '../settings/index' as settings;
5
+ @use '../functions/others' as func;
6
+ @use '../variables' as vars;
7
+
8
+ // Definitions
9
+ $useGrid: if(vars.$useGrid != null, vars.$useGrid, settings.$useGrid);
10
+ $useFlex: if(vars.$useFlex != null, vars.$useFlex, settings.$useFlex);
11
+
12
+ @if $useGrid {
13
+ .grid {
14
+ display: grid;
15
+
16
+ @include mQ.multiSizes() using ($size, $divider) {
17
+ @include func.gridDivision(column, $size, $divider);
18
+ @include func.gridDivision(row, $size, $divider);
19
+ }
20
+ }
21
+ }
22
+
23
+ @if $useFlex {
24
+ .flex {
25
+ display: flex;
26
+ flex-direction: row;
27
+ flex-wrap: wrap;
28
+
29
+ @include mQ.multiSizes() using ($size, $divider) {
30
+ @each $property, $values in configs.$flexProperties {
31
+ // Validate parameters
32
+ $checkedProperty: val.listItem((flex-wrap, flex-direction), $property, 'flex.properties');
33
+
34
+ @each $value in $values {
35
+ // Validate parameters
36
+ $checkedProperty: val.listItem(
37
+ (wrap, nowrap, row, row-reverse, column, column-reverse),
38
+ $value,
39
+ 'flex.properties.values'
40
+ );
41
+
42
+ $mainClass: if($size, #{$size}#{$divider}#{$value}, $value);
43
+
44
+ &.#{$mainClass} {
45
+ #{$property}: if($size, $value !important, $value);
46
+ }
47
+ }
48
+ }
49
+
50
+ &.row,
51
+ &.row-reverse {
52
+ @include func.flexDivision(width, 'cols', $size, $divider);
53
+ @include func.flexDivision(width, 'col', $size, $divider);
54
+ }
55
+ &.column,
56
+ &.column-reverse {
57
+ @include func.flexDivision(height, 'rows', $size, $divider);
58
+ @include func.flexDivision(height, 'row', $size, $divider);
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ @if $useFlex or $useGrid {
65
+ @include mQ.multiSizes() using ($size, $divider) {
66
+ @each $way, $selections in configs.$justify {
67
+ @each $selection, $properties in $selections {
68
+ @each $property in $properties {
69
+ $mainClass: if($size, '#{$size}#{$divider}#{$way}-#{$selection}#{\:}', '#{$way}-#{$selection}#{\:}');
70
+
71
+ .#{$mainClass} {
72
+ $prefix: if($property == 'around' or $property == 'between' or $property == 'evenly', 'space-', '');
73
+ $flexPrefix: if($property == 'start' or $property == 'end', 'flex-', '');
74
+ $value: #{$prefix}#{$property};
75
+ $flexValue: #{$flexPrefix}#{$value};
76
+
77
+ &#{$property} {
78
+ &.flex {
79
+ #{$way}-#{$selection}: if($size, $flexValue !important, $flexValue);
80
+ }
81
+
82
+ #{$way}-#{$selection}: if($size, $value !important, $value);
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }