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,101 +1,103 @@
1
- $corners: (
2
- 'rounded': 0.25rem,
3
- 'circle': 100vw,
4
- 'sharp': 0,
5
- ) !default;
6
-
7
- button {
8
- cursor: pointer;
9
- background: transparent;
10
- border: none;
11
-
12
- &.btn {
13
- position: relative;
14
- isolation: isolate;
15
- appearance: none;
16
- display: flex;
17
- flex-wrap: nowrap;
18
- cursor: pointer;
19
- transition: 250ms ease-in-out;
20
-
21
- &:not([class*='justify-content:']) {
22
- justify-content: center;
23
- }
24
- &:not([class*='align-items:']) {
25
- align-items: center;
26
- }
27
- &:not([class*='text-start'], [class*='text-left'], [class*='text-end'], [class*='text-right']) {
28
- text-align: center;
29
- }
30
- &:not([class*='border:']) {
31
- border-width: 0.15em;
32
- border-style: solid;
33
- }
34
- &:not([class*='bg:']) {
35
- background-color: unset;
36
- }
37
- &:not([class*='radius:']) {
38
- @each $corner, $value in $corners {
39
- &.btn-#{$corner} {
40
- border-radius: $value;
41
- }
42
- }
43
-
44
- &:is(.btn-circle) {
45
- aspect-ratio: 1;
46
- }
47
- }
48
-
49
- &:is([disabled]) {
50
- cursor: not-allowed;
51
- opacity: 0.7;
52
- }
53
-
54
- &::before {
55
- content: '';
56
- position: absolute;
57
- inset: 0;
58
- border-radius: inherit;
59
- pointer-events: none;
60
- z-index: -1;
61
- transition: 250ms ease-in-out;
62
- opacity: 0;
63
- }
64
-
65
- &:is(.loading) .loader-icon {
66
- animation: rotate 4s ease-in-out infinite;
67
-
68
- @keyframes rotate {
69
- 0% {
70
- transform: rotate(0deg);
71
- }
72
- 100% {
73
- transform: rotate(360deg);
74
- }
75
- }
76
- }
77
-
78
- &:is(:focus-visible, :hover) {
79
- transform: translateY(-0.1em);
80
-
81
- &:is(.text-variant) {
82
- text-shadow: 0 0.05em rgba(0, 0, 0, 0.4);
83
- }
84
-
85
- &:not(.text-variant) {
86
- box-shadow: 0 0.15em 0.15em rgba(0, 0, 0, 0.4);
87
-
88
- &::before {
89
- background-color: rgba(0, 0, 0, 0.15);
90
- opacity: 1;
91
- }
92
- }
93
- }
94
- }
95
- }
96
-
97
- :focus,
98
- button:focus {
99
- outline: unset;
100
- box-shadow: unset;
101
- }
1
+ $corners: (
2
+ 'rounded': 0.25rem,
3
+ 'big-rounded': 0.75rem,
4
+ 'circle': 100vw,
5
+ 'sharp': 0,
6
+ 'full': 100vw
7
+ ) !default;
8
+
9
+ button {
10
+ cursor: pointer;
11
+ background: transparent;
12
+ border: none;
13
+
14
+ &.btn {
15
+ position: relative;
16
+ isolation: isolate;
17
+ appearance: none;
18
+ display: inline-flex;
19
+ flex-wrap: nowrap;
20
+ cursor: pointer;
21
+ transition: 250ms ease-in-out;
22
+
23
+ &:not([class*='justify-content:']) {
24
+ justify-content: center;
25
+ }
26
+ &:not([class*='align-items:']) {
27
+ align-items: center;
28
+ }
29
+ &:not([class*='text-start']):not([class*='text-left']):not([class*='text-end']):not([class*='text-right']) {
30
+ text-align: center;
31
+ }
32
+ &:not([class*='border:']) {
33
+ border-width: 0.15em;
34
+ border-style: solid;
35
+ }
36
+ &:not([class*='bg:']) {
37
+ background-color: unset;
38
+ }
39
+ &:not([class*='radius:']) {
40
+ @each $corner, $value in $corners {
41
+ &.btn-#{$corner} {
42
+ border-radius: $value;
43
+ }
44
+ }
45
+
46
+ &:is(.btn-circle) {
47
+ aspect-ratio: 1;
48
+ }
49
+ }
50
+
51
+ &:is([disabled]) {
52
+ cursor: not-allowed;
53
+ opacity: 0.7;
54
+ }
55
+
56
+ &::before {
57
+ content: '';
58
+ position: absolute;
59
+ inset: 0;
60
+ border-radius: inherit;
61
+ pointer-events: none;
62
+ z-index: -1;
63
+ transition: 250ms ease-in-out;
64
+ opacity: 0;
65
+ }
66
+
67
+ &:is(.loading) .loader-icon {
68
+ animation: rotate 4s ease-in-out infinite;
69
+
70
+ @keyframes rotate {
71
+ 0% {
72
+ transform: rotate(0deg);
73
+ }
74
+ 100% {
75
+ transform: rotate(360deg);
76
+ }
77
+ }
78
+ }
79
+
80
+ &:is(:focus-visible, :hover) {
81
+ transform: translateY(-0.1em);
82
+
83
+ &:is(.btn-text) {
84
+ text-shadow: 0 0.05em rgb(0, 0, 0, 0.4);
85
+ }
86
+
87
+ &:not(.btn-text) {
88
+ box-shadow: 0 0.15em 0.15em rgb(0, 0, 0, 0.4);
89
+
90
+ &::before {
91
+ background-color: rgb(0, 0, 0, 0.15);
92
+ opacity: 1;
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+
99
+ :focus,
100
+ button:focus {
101
+ outline: unset;
102
+ box-shadow: unset;
103
+ }
@@ -1,146 +1,156 @@
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(
11
+ sass(vars.$useColors != null): vars.$useColors; else: settings.$useColors
12
+ );
13
+ $colors: if(
14
+ sass(vars.$colors != null): vars.$colors; else: defs.$colors
15
+ );
16
+ $useCurrentColors: if(
17
+ sass(vars.$useCurrentColors != null): vars.$useCurrentColors; else: settings.$useCurrentColors
18
+ );
19
+ $useRootColors: if(
20
+ sass(vars.$useRootColors != null): vars.$useRootColors; else: settings.$useRootColors
21
+ );
22
+
23
+ // Colors System Module
24
+ // --------------------------
25
+ // This file is responsible for generating color utility classes and CSS variables
26
+ // based on the color maps defined in the variables file.
27
+ //
28
+ // Key features:
29
+ // 1. Generates color utility classes from the main colors map
30
+ // 2. Creates currentColor utility classes
31
+ // 3. Sets up CSS variables for all defined colors
32
+ //
33
+ // The color system supports:
34
+ // - Light and dark mode theming
35
+ // - Opacity variations
36
+ // - Pseudo-class variants (:hover, :focus, etc.)
37
+ //
38
+ // @requires ../functions/colors.scss - For color utility functions and mixins
39
+ // @requires ../settings/configs.scss - For configuration variables
40
+ // @requires ../functions/validations.scss - For validation utilities
41
+ // @requires ../variables.scss - For color definitions
42
+
43
+ @if $useColors {
44
+ // Color Utility Classes
45
+ // --------------------
46
+ // Generate color utility classes from the main colors map.
47
+ // Uses the useColorsMap mixin from colors functions to create a comprehensive
48
+ // set of color utilities for all the colors defined in $colors.
49
+ //
50
+ // Generated classes include:
51
+ // - .color-[colorName] - Sets text color
52
+ // - .bg-color-[colorName] - Sets background color
53
+ // - .border-color-[colorName] - Sets border color
54
+ //
55
+ // With light/dark theme variants:
56
+ // - Automatically applies correct color based on .light/.dark context
57
+ // - Supports direct class application with .color-[colorName].light
58
+ //
59
+ // With opacity variants (e.g., :50 for 50% opacity):
60
+ // - .color-[colorName]:50
61
+ // - .bg-color-[colorName]:75
62
+ //
63
+ // With pseudo-class variants:
64
+ // - .color-[colorName]:hover
65
+ // - .bg-color-[colorName]:focus
66
+ @include colors.useColorsMap;
67
+ }
68
+
69
+ @if $useCurrentColors {
70
+ // CurrentColor Utility Classes
71
+ // ----------------------------
72
+ // Creates utility classes for applying the CSS `currentColor` value to various CSS properties
73
+ // as defined in the configs.$colorsPropertiesMap.
74
+ //
75
+ // For each property in the map (color, background-color, border-color, etc.):
76
+ // - Creates a base class (.{property}-current-color)
77
+ // - Creates pseudo-class variants for interaction states
78
+ //
79
+ // Examples:
80
+ // - .current-color { color: currentColor; }
81
+ // - .bg-current-color { background-color: currentColor; }
82
+ // - .border-current-color { border-color: currentColor; }
83
+ // - .current-color\:hover:hover { color: currentColor; }
84
+ // - .bg-current-color\:focus:focus { background-color: currentColor; }
85
+ //
86
+ // Usage:
87
+ // <div class="current-color bg-current-color:hover">
88
+ // This text uses currentColor and background changes to currentColor on hover
89
+ // </div>
90
+ @each $class, $property in configs.$colorsPropertiesMap {
91
+ $mainClass: if(
92
+ sass($class): '#{$class}#{\:}current-color' ; else: 'current-color'
93
+ );
94
+
95
+ .#{$mainClass} {
96
+ #{$property}: currentColor;
97
+
98
+ @each $pseudoClass, $pseudo in configs.$colorsPseudoMap {
99
+ @if $pseudoClass != 'placeholder' or ($pseudoClass == 'placeholder' and $class == null) {
100
+ &#{\:}#{$pseudoClass}#{$pseudo} {
101
+ #{$property}: currentColor;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+
109
+ @if $useRootColors {
110
+ // CSS Color Variables
111
+ // ------------------
112
+ // Generates CSS custom properties (variables) for all colors in the $colors map.
113
+ // These variables can be used throughout the application to ensure color consistency.
114
+ //
115
+ // The implementation:
116
+ // 1. Iterates through each color in the $colors map
117
+ // 2. Validates the color values through val.mapItem and val.hexColor functions
118
+ // 3. Determines if light and dark variants are the same
119
+ // 4. Creates appropriate CSS variables based on variant differences
120
+ //
121
+ // Format:
122
+ // - For colors with light/dark variants: --color-{name}-{variant}: {color-value}
123
+ // - For colors without variants: --color-{name}: {color-value}
124
+ //
125
+ // Examples:
126
+ // --color-main-light: #ffffff
127
+ // --color-main-dark: #1a1d21
128
+ // --color-accent: #3498db (when light and dark variants are the same)
129
+ //
130
+ // Usage:
131
+ // .my-element {
132
+ // background-color: var(--color-main-light);
133
+ // color: var(--color-accent);
134
+ // }
135
+ :root {
136
+ @each $color, $modes in $colors {
137
+ // Validate parameters
138
+ $checkedLight: val.mapItem($modes, 'light', 'light/dark', 'root-colors()');
139
+ $checkedDark: val.mapItem($modes, 'dark', 'light/dark', 'root-colors()');
140
+
141
+ $light: map.get($modes, 'light');
142
+ $dark: map.get($modes, 'dark');
143
+
144
+ // Validate colors
145
+ $checkedLightValue: val.hexColor('#{$color}.light', $light, 'root-colors()');
146
+ $checkedDarkValue: val.hexColor('#{$color}.dark', $dark, 'root-colors()');
147
+
148
+ @if ($light == $dark) {
149
+ --color-#{$color}: #{$checkedLightValue};
150
+ } @else {
151
+ --color-#{$color}-light: #{$checkedLightValue};
152
+ --color-#{$color}-dark: #{$checkedDarkValue};
153
+ }
154
+ }
155
+ }
156
+ }