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.
- package/dist/css/beathers-icons.min.css +1 -0
- package/dist/css/beathers-icons.min.css.map +1 -0
- package/dist/css/beathers.min.css +4 -0
- package/dist/css/beathers.min.css.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/scripts/BuildScssVariables.d.ts +2 -0
- package/dist/scripts/BuildScssVariables.js +111 -0
- package/dist/scripts/BuildTheme.d.ts +1 -0
- package/dist/scripts/BuildTheme.js +99 -0
- package/dist/scripts/CallNewVariables.d.ts +1 -0
- package/dist/scripts/CallNewVariables.js +17 -0
- package/dist/scripts/LoadUserConfigs.d.ts +2 -0
- package/dist/scripts/LoadUserConfigs.js +42 -0
- package/dist/scripts/Merge.d.ts +2 -0
- package/dist/scripts/Merge.js +26 -0
- package/dist/scripts/ReadDefaultValues.d.ts +2 -0
- package/dist/scripts/ReadDefaultValues.js +168 -0
- package/dist/scripts/cli.d.ts +2 -0
- package/dist/scripts/cli.js +14 -0
- package/dist/scripts/types.d.ts +57 -0
- package/dist/scripts/types.js +1 -0
- package/package.json +84 -0
- package/readme.md +235 -0
- package/src/scss/_variables.scss +305 -0
- package/src/scss/beathers-icons.min.scss +265 -0
- package/src/scss/beathers.min.scss +13 -0
- package/src/scss/functions/_colors.scss +232 -0
- package/src/scss/functions/_mediaQueries.scss +128 -0
- package/src/scss/functions/_others.scss +83 -0
- package/src/scss/functions/_typographic.scss +125 -0
- package/src/scss/functions/_validations.scss +256 -0
- package/src/scss/settings/_configs.scss +366 -0
- package/src/scss/settings/_defaults.scss +251 -0
- package/src/scss/settings/_index.scss +68 -0
- package/src/scss/settings/_resets.scss +103 -0
- package/src/scss/style/_colors.scss +139 -0
- package/src/scss/style/_grid.scss +92 -0
- package/src/scss/style/_shaping.scss +372 -0
- package/src/scss/style/_typographic.scss +304 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
@use "./settings/index" as settings;
|
|
2
|
+
|
|
3
|
+
$icons: (
|
|
4
|
+
"cart": "\ea01",
|
|
5
|
+
"share": "\ea02",
|
|
6
|
+
"tag-1": "\ea03",
|
|
7
|
+
"facebook-messenger": "\ea04",
|
|
8
|
+
"arrow-corner-up-left": "\ea05",
|
|
9
|
+
"fastword": "\ea06",
|
|
10
|
+
"tiktok": "\ea07",
|
|
11
|
+
"database": "\ea08",
|
|
12
|
+
"syrian-pound": "\ea09",
|
|
13
|
+
"user-check": "\ea0a",
|
|
14
|
+
"server": "\ea0b",
|
|
15
|
+
"car": "\ea0c",
|
|
16
|
+
"times": "\ea0d",
|
|
17
|
+
"apple-store": "\ea0e",
|
|
18
|
+
"arrow-circle-up": "\ea0f",
|
|
19
|
+
"login": "\ea10",
|
|
20
|
+
"settings": "\ea11",
|
|
21
|
+
"instagram": "\ea12",
|
|
22
|
+
"sun": "\ea13",
|
|
23
|
+
"arrow-corner-left-up": "\ea14",
|
|
24
|
+
"star-Half": "\ea15",
|
|
25
|
+
"img": "\ea16",
|
|
26
|
+
"gender": "\ea17",
|
|
27
|
+
"amazon-payment": "\ea18",
|
|
28
|
+
"pintrest": "\ea19",
|
|
29
|
+
"arrow-droplist-down": "\ea1a",
|
|
30
|
+
"apple-pay": "\ea1b",
|
|
31
|
+
"whatsapp": "\ea1c",
|
|
32
|
+
"arrow-droplist-up": "\ea1d",
|
|
33
|
+
"pause": "\ea1e",
|
|
34
|
+
"arrow-corner-right-up": "\ea1f",
|
|
35
|
+
"save": "\ea20",
|
|
36
|
+
"star": "\ea21",
|
|
37
|
+
"arrow-corner-down-right": "\ea22",
|
|
38
|
+
"moon": "\ea23",
|
|
39
|
+
"arrow-classic-down-left": "\ea24",
|
|
40
|
+
"logout": "\ea25",
|
|
41
|
+
"certificate": "\ea26",
|
|
42
|
+
"repeat": "\ea27",
|
|
43
|
+
"rotate": "\ea28",
|
|
44
|
+
"warning": "\ea29",
|
|
45
|
+
"wallet": "\ea2a",
|
|
46
|
+
"headset": "\ea2b",
|
|
47
|
+
"plus": "\ea2c",
|
|
48
|
+
"double-check": "\ea2d",
|
|
49
|
+
"lock-opened": "\ea2e",
|
|
50
|
+
"arrow-classic-up-left": "\ea2f",
|
|
51
|
+
"chili": "\ea30",
|
|
52
|
+
"github": "\ea31",
|
|
53
|
+
"options": "\ea32",
|
|
54
|
+
"volume-up": "\ea33",
|
|
55
|
+
"flash": "\ea34",
|
|
56
|
+
"usb": "\ea35",
|
|
57
|
+
"shield-on": "\ea36",
|
|
58
|
+
"copy": "\ea37",
|
|
59
|
+
"stop": "\ea38",
|
|
60
|
+
"warehouse": "\ea39",
|
|
61
|
+
"user-delete": "\ea3a",
|
|
62
|
+
"target": "\ea3b",
|
|
63
|
+
"arrow-droplist-right": "\ea3c",
|
|
64
|
+
"arrow-sign-left": "\ea3d",
|
|
65
|
+
"check": "\ea3e",
|
|
66
|
+
"coin": "\ea3f",
|
|
67
|
+
"print": "\ea40",
|
|
68
|
+
"arrow-lite-double-down": "\ea41",
|
|
69
|
+
"card": "\ea42",
|
|
70
|
+
"stackoverflow": "\ea43",
|
|
71
|
+
"face-id": "\ea44",
|
|
72
|
+
"signal": "\ea45",
|
|
73
|
+
"arrow-droplist-left": "\ea46",
|
|
74
|
+
"cart-1": "\ea47",
|
|
75
|
+
"behance": "\ea48",
|
|
76
|
+
"menu-1": "\ea49",
|
|
77
|
+
"user-remove": "\ea4a",
|
|
78
|
+
"tag": "\ea4b",
|
|
79
|
+
"receipt": "\ea4c",
|
|
80
|
+
"check-1": "\ea4d",
|
|
81
|
+
"medal-1": "\ea4e",
|
|
82
|
+
"heart-rate": "\ea4f",
|
|
83
|
+
"coffee-1": "\ea50",
|
|
84
|
+
"halal": "\ea51",
|
|
85
|
+
"search-1": "\ea52",
|
|
86
|
+
"power": "\ea53",
|
|
87
|
+
"edit-1": "\ea54",
|
|
88
|
+
"arrow-classic-right": "\ea55",
|
|
89
|
+
"search": "\ea56",
|
|
90
|
+
"phone": "\ea57",
|
|
91
|
+
"saudi-riyal": "\ea58",
|
|
92
|
+
"time": "\ea59",
|
|
93
|
+
"btc": "\ea5a",
|
|
94
|
+
"play": "\ea5b",
|
|
95
|
+
"eye-closed": "\ea5c",
|
|
96
|
+
"shop": "\ea5d",
|
|
97
|
+
"menu": "\ea5e",
|
|
98
|
+
"facebook": "\ea5f",
|
|
99
|
+
"hackerrank": "\ea60",
|
|
100
|
+
"gift-opened": "\ea61",
|
|
101
|
+
"news": "\ea62",
|
|
102
|
+
"medal": "\ea63",
|
|
103
|
+
"finger-print": "\ea64",
|
|
104
|
+
"Unlink": "\ea65",
|
|
105
|
+
"huawei": "\ea66",
|
|
106
|
+
"arrow-classic-up-right": "\ea67",
|
|
107
|
+
"microsoft": "\ea68",
|
|
108
|
+
"pdf": "\ea69",
|
|
109
|
+
"dislike": "\ea6a",
|
|
110
|
+
"snapchat": "\ea6b",
|
|
111
|
+
"turkish": "\ea6c",
|
|
112
|
+
"bank": "\ea6d",
|
|
113
|
+
"home": "\ea6e",
|
|
114
|
+
"trash": "\ea6f",
|
|
115
|
+
"thermometer": "\ea70",
|
|
116
|
+
"sort-up": "\ea71",
|
|
117
|
+
"coffee-2": "\ea72",
|
|
118
|
+
"scale-down": "\ea73",
|
|
119
|
+
"lang-ar": "\ea74",
|
|
120
|
+
"files": "\ea75",
|
|
121
|
+
"archive": "\ea76",
|
|
122
|
+
"like": "\ea77",
|
|
123
|
+
"arrow-classic-down-right": "\ea78",
|
|
124
|
+
"timer": "\ea79",
|
|
125
|
+
"gold": "\ea7a",
|
|
126
|
+
"eye-opened": "\ea7b",
|
|
127
|
+
"arrow-circle-left": "\ea7c",
|
|
128
|
+
"telegram": "\ea7d",
|
|
129
|
+
"volume": "\ea7e",
|
|
130
|
+
"linkedin": "\ea7f",
|
|
131
|
+
"arrow-corner-down-left": "\ea80",
|
|
132
|
+
"download": "\ea81",
|
|
133
|
+
"inbox": "\ea82",
|
|
134
|
+
"arrow-corner-right-down": "\ea83",
|
|
135
|
+
"pin-2": "\ea84",
|
|
136
|
+
"game-contraller": "\ea85",
|
|
137
|
+
"users": "\ea86",
|
|
138
|
+
"volume-down": "\ea87",
|
|
139
|
+
"user": "\ea88",
|
|
140
|
+
"info": "\ea89",
|
|
141
|
+
"pin-1": "\ea8a",
|
|
142
|
+
"google-play": "\ea8b",
|
|
143
|
+
"arrow-sign-right": "\ea8c",
|
|
144
|
+
"ads": "\ea8d",
|
|
145
|
+
"car-1": "\ea8e",
|
|
146
|
+
"arrow-corner-left-down": "\ea8f",
|
|
147
|
+
"arrow-circle-down": "\ea90",
|
|
148
|
+
"ship": "\ea91",
|
|
149
|
+
"chart-3": "\ea92",
|
|
150
|
+
"dribbble": "\ea93",
|
|
151
|
+
"arrow-lite-double-right": "\ea94",
|
|
152
|
+
"check-2": "\ea95",
|
|
153
|
+
"arrow-classic-down": "\ea96",
|
|
154
|
+
"question": "\ea97",
|
|
155
|
+
"new-tab": "\ea98",
|
|
156
|
+
"cart-2": "\ea99",
|
|
157
|
+
"arrow-corner-up-right": "\ea9a",
|
|
158
|
+
"arrow-classic-left": "\ea9b",
|
|
159
|
+
"octagon": "\ea9c",
|
|
160
|
+
"rupee": "\ea9d",
|
|
161
|
+
"usb-1": "\ea9e",
|
|
162
|
+
"yuan": "\ea9f",
|
|
163
|
+
"cheeze": "\eaa0",
|
|
164
|
+
"arrow-lite-double-up": "\eaa1",
|
|
165
|
+
"dashboard": "\eaa2",
|
|
166
|
+
"android": "\eaa3",
|
|
167
|
+
"mail": "\eaa4",
|
|
168
|
+
"age": "\eaa5",
|
|
169
|
+
"filters": "\eaa6",
|
|
170
|
+
"chart-2": "\eaa7",
|
|
171
|
+
"drop": "\eaa8",
|
|
172
|
+
"gift-closed": "\eaa9",
|
|
173
|
+
"euro": "\eaaa",
|
|
174
|
+
"loading": "\eaab",
|
|
175
|
+
"upload": "\eaac",
|
|
176
|
+
"arrow-sign-up": "\eaad",
|
|
177
|
+
"bell-off": "\eaae",
|
|
178
|
+
"passport": "\eaaf",
|
|
179
|
+
"chart-1": "\eab0",
|
|
180
|
+
"user-add": "\eab1",
|
|
181
|
+
"edit": "\eab2",
|
|
182
|
+
"Chipset": "\eab3",
|
|
183
|
+
"youtube": "\eab4",
|
|
184
|
+
"arrow-lite-left": "\eab5",
|
|
185
|
+
"arrow-sign-down": "\eab6",
|
|
186
|
+
"arrow-classic-up": "\eab7",
|
|
187
|
+
"white-board": "\eab8",
|
|
188
|
+
"grid": "\eab9",
|
|
189
|
+
"pounds": "\eaba",
|
|
190
|
+
"pin": "\eabb",
|
|
191
|
+
"arrow-lite-right": "\eabc",
|
|
192
|
+
"shield-off": "\eabd",
|
|
193
|
+
"arrow-lite-up": "\eabe",
|
|
194
|
+
"scale-up": "\eabf",
|
|
195
|
+
"barcode": "\eac0",
|
|
196
|
+
"plane": "\eac1",
|
|
197
|
+
"quote": "\eac2",
|
|
198
|
+
"ruble": "\eac3",
|
|
199
|
+
"ice-cream": "\eac4",
|
|
200
|
+
"move": "\eac5",
|
|
201
|
+
"times-2": "\eac6",
|
|
202
|
+
"link-1": "\eac7",
|
|
203
|
+
"board": "\eac8",
|
|
204
|
+
"mobile": "\eac9",
|
|
205
|
+
"arrow-circle-right": "\eaca",
|
|
206
|
+
"apple": "\eacb",
|
|
207
|
+
"google": "\eacc",
|
|
208
|
+
"arrow-outside": "\eacd",
|
|
209
|
+
"compare": "\eace",
|
|
210
|
+
"mice": "\eacf",
|
|
211
|
+
"cloud": "\ead0",
|
|
212
|
+
"times-1": "\ead1",
|
|
213
|
+
"calendar": "\ead2",
|
|
214
|
+
"twitter": "\ead3",
|
|
215
|
+
"motorbike": "\ead4",
|
|
216
|
+
"categories": "\ead5",
|
|
217
|
+
"app-gallery": "\ead6",
|
|
218
|
+
"aws": "\ead7",
|
|
219
|
+
"arrow-inside": "\ead8",
|
|
220
|
+
"folder": "\ead9",
|
|
221
|
+
"x": "\eada",
|
|
222
|
+
"camera": "\eadb",
|
|
223
|
+
"minus": "\eadc",
|
|
224
|
+
"link": "\eadd",
|
|
225
|
+
"box": "\eade",
|
|
226
|
+
"color": "\eadf",
|
|
227
|
+
"sort-down": "\eae0",
|
|
228
|
+
"settings-1": "\eae1",
|
|
229
|
+
"google-pay": "\eae2",
|
|
230
|
+
"chart": "\eae3",
|
|
231
|
+
"heart": "\eae4",
|
|
232
|
+
"doller": "\eae5",
|
|
233
|
+
"lock-closed": "\eae6",
|
|
234
|
+
"umbrella": "\eae7",
|
|
235
|
+
"arrow-lite-double-left": "\eae8",
|
|
236
|
+
"gitlab": "\eae9",
|
|
237
|
+
"arrow-lite-down": "\eaea",
|
|
238
|
+
"bell": "\eaeb",
|
|
239
|
+
"git": "\eaec",
|
|
240
|
+
"paypal": "\eaed",
|
|
241
|
+
"coupon": "\eaee",
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
@if (settings.$useIcons) {
|
|
245
|
+
@font-face {
|
|
246
|
+
font-family: "beathers";
|
|
247
|
+
src: url("/fonts/beathers.woff") format("woff");
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.be {
|
|
251
|
+
font-family: "beathers", system-ui !important;
|
|
252
|
+
font-size: 1em;
|
|
253
|
+
width: 1em;
|
|
254
|
+
height: 1em;
|
|
255
|
+
font-style: normal;
|
|
256
|
+
-webkit-font-smoothing: antialiased;
|
|
257
|
+
-moz-osx-font-smoothing: grayscale;
|
|
258
|
+
|
|
259
|
+
@each $name, $glyph in $icons {
|
|
260
|
+
&.be-#{$name}:before {
|
|
261
|
+
content: $glyph;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Beathers v5.2.0 (https://beathers.bhoenixstudio.com/)
|
|
3
|
+
* Copyright 2020-2025 Bhoenix Studio
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@use "./variables";
|
|
7
|
+
|
|
8
|
+
// Style ----- ----- ----- -----
|
|
9
|
+
@use "./settings/resets";
|
|
10
|
+
@use "./style/colors";
|
|
11
|
+
@use "./style/typographic";
|
|
12
|
+
@use "./style/grid";
|
|
13
|
+
@use "./style/shaping";
|
|
@@ -0,0 +1,232 @@
|
|
|
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 "../settings/defaults" as vars;
|
|
9
|
+
@use "../functions/validations" as val;
|
|
10
|
+
|
|
11
|
+
// Color Convertors ----- ----- ----- -----
|
|
12
|
+
//
|
|
13
|
+
// @function hexToRgba
|
|
14
|
+
// --------------------------------------
|
|
15
|
+
// Converts a hex color value to RGBA format
|
|
16
|
+
//
|
|
17
|
+
// @param {Color} $color - The hex color to convert (e.g. '#ffffff' or '#fff')
|
|
18
|
+
// @param {Number} $opacity - Optional opacity value between 0 and 1 (default: 1)
|
|
19
|
+
// @return {Color} - The color in rgba() format
|
|
20
|
+
//
|
|
21
|
+
// @example scss
|
|
22
|
+
// color: hexToRgba('#ffffff');
|
|
23
|
+
// // Returns rgba(255, 255, 255, 1)
|
|
24
|
+
// color: hexToRgba('#ffffff', 0.5);
|
|
25
|
+
// // Returns rgba(255, 255, 255, 0.5)
|
|
26
|
+
// color: hexToRgba('#ffffff80');
|
|
27
|
+
// // Returns rgba(255, 255, 255, 0.5)
|
|
28
|
+
//
|
|
29
|
+
@function hexToRgba($color, $opacity: 1, $debugIn: null) {
|
|
30
|
+
// Validate parameters
|
|
31
|
+
$checkedColor: val.hexColor("color", $color, "hexToRgba().#{$debugIn}");
|
|
32
|
+
$checkedOpacity: val.opacity($opacity, "hexToRgba().#{$debugIn}");
|
|
33
|
+
|
|
34
|
+
@return rgba(
|
|
35
|
+
color.channel($checkedColor, "red", $space: rgb),
|
|
36
|
+
color.channel($checkedColor, "green", $space: rgb),
|
|
37
|
+
color.channel($checkedColor, "blue", $space: rgb),
|
|
38
|
+
$checkedOpacity
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Use Color ----- ----- ----- -----
|
|
43
|
+
//
|
|
44
|
+
// @function useColor
|
|
45
|
+
// --------------------------------------
|
|
46
|
+
// Retrieves a color from any color map with optional variant and opacity
|
|
47
|
+
//
|
|
48
|
+
// @param {String} $color - The color key to retrieve from the map
|
|
49
|
+
// @param {String} $mode - Optional mode, must be 'light' or 'dark' (default: 'light')
|
|
50
|
+
// @param {Number} $opacity - Optional opacity value between 0 and 100 (default: 100)
|
|
51
|
+
// @param {Map} $map - Optional color map to use (defaults to vars.$colors)
|
|
52
|
+
// @return {Color} - The color value, possibly with applied opacity
|
|
53
|
+
// @throws {Error} - If mode is provided but isn't 'light' or 'dark'
|
|
54
|
+
// @throws {Error} - If opacity is provided but isn't a number between 0 and 100
|
|
55
|
+
//
|
|
56
|
+
// @example scss
|
|
57
|
+
// // Using default color map (vars.$colors)
|
|
58
|
+
// color: useColor('primary', 'light', 0.5);
|
|
59
|
+
// // Returns the light variant of primary color with 50% opacity
|
|
60
|
+
//
|
|
61
|
+
// // Using a custom color map
|
|
62
|
+
// color: useColor('secondary', 'dark', null, $customMap);
|
|
63
|
+
// // Returns the dark variant of secondary color from custom map
|
|
64
|
+
//
|
|
65
|
+
@function useColor($color, $mode: "light", $opacity: 100) {
|
|
66
|
+
// Validate parameters
|
|
67
|
+
$checkedMode: val.colorMode($mode, "useColor()");
|
|
68
|
+
$checkedOpacity: val.colorOpacity($opacity, "useColor()");
|
|
69
|
+
|
|
70
|
+
$value: map.get($color, $mode);
|
|
71
|
+
|
|
72
|
+
@if $checkedOpacity {
|
|
73
|
+
@return hexToRgba($value, math.div($opacity, 100), "useColor().#{$value}");
|
|
74
|
+
} @else {
|
|
75
|
+
@return $value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@function useColorWithMap($color, $mode: "light", $opacity: 100, $map: vars.$colors) {
|
|
80
|
+
// Validate parameters
|
|
81
|
+
$checkedMap: val.map($map, "useColorWithMap().map");
|
|
82
|
+
|
|
83
|
+
$colorValue: map.get($checkedMap, $color);
|
|
84
|
+
@return useColor($colorValue, $mode, $opacity);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// @mixin useColorProperty
|
|
88
|
+
// --------------------------------------
|
|
89
|
+
// Applies color properties with theme variant support while handling light/dark themes
|
|
90
|
+
// and creating appropriate CSS selectors for different use cases.
|
|
91
|
+
//
|
|
92
|
+
// @param {String} $colorClass - The CSS class name to apply the color to (e.g., 'color-1', 'bg\:color-1')
|
|
93
|
+
// @param {String|Null} $class - The CSS class prefix (e.g., 'bg', 'border', null for 'color')
|
|
94
|
+
// @param {String} $property - The CSS property to set (e.g., 'color', 'background-color')
|
|
95
|
+
// @param {Map} $color - The color map with light/dark variants
|
|
96
|
+
// @param {Map} $map - The parent color map containing all colors
|
|
97
|
+
// @param {Number} $opacity - Optional opacity value between 0-100 (default: 100)
|
|
98
|
+
// @throws {Error} - If provided parameters fail validation through val.* functions
|
|
99
|
+
//
|
|
100
|
+
// @example scss
|
|
101
|
+
// // Apply primary color as text color with 50% opacity
|
|
102
|
+
// @include useColorProperty("color-1", null, "color", $primaryColor, $colorsMap, 50);
|
|
103
|
+
//
|
|
104
|
+
// // Apply primary color as background with full opacity
|
|
105
|
+
// @include useColorProperty("bg\:color-1", "bg", "background-color", $primaryColor, $colorsMap);
|
|
106
|
+
//
|
|
107
|
+
// Generated Selectors:
|
|
108
|
+
// Each call to this mixin generates three CSS selectors to support different theming approaches:
|
|
109
|
+
//
|
|
110
|
+
// 1. Parent/child relationship: `.light .className`, `.dark .className`
|
|
111
|
+
// For theme inheritance from parent elements
|
|
112
|
+
// Example: <div class="light"><span class="color-1">Themed text</span></div>
|
|
113
|
+
//
|
|
114
|
+
// 2. Modifier class: `.className.light`, `.className.dark`
|
|
115
|
+
// For direct theme application to the element itself
|
|
116
|
+
// Example: <span class="color-1 light">Themed text</span>
|
|
117
|
+
//
|
|
118
|
+
// 3. Prefixed class: `.light\:className`, `.dark\:className`
|
|
119
|
+
// For utility-first CSS approaches
|
|
120
|
+
// Example: <span class="light\:color-1">Themed text</span>
|
|
121
|
+
//
|
|
122
|
+
// Note: When light and dark variants are identical, a single class without theme
|
|
123
|
+
// modifiers is generated to reduce CSS output size.
|
|
124
|
+
@mixin useColorProperty($colorClass, $class, $property, $color, $map, $opacity: 100) {
|
|
125
|
+
// Validate parameters
|
|
126
|
+
$checkedClass: val.colorClass($class, "useColorProperty().class");
|
|
127
|
+
$checkedProperty: val.colorProperty($property, "useColorProperty().property");
|
|
128
|
+
$checkedMap: val.map($map, "useColorProperty().map");
|
|
129
|
+
$checkedOpacity: val.colorOpacity($opacity, "useColorProperty().opacity");
|
|
130
|
+
$checkedLight: val.mapItem($color, "light", "light/dark", "useColorProperty().color");
|
|
131
|
+
$checkedDark: val.mapItem($color, "dark", "light/dark", "useColorProperty().color");
|
|
132
|
+
|
|
133
|
+
$light: map.get($color, "light");
|
|
134
|
+
$dark: map.get($color, "dark");
|
|
135
|
+
|
|
136
|
+
$checkedLightValue: val.hexColor("#{$colorClass}.light", $light, "root-colors()");
|
|
137
|
+
$checkedDarkValue: val.hexColor("#{$colorClass}.dark", $dark, "root-colors()");
|
|
138
|
+
|
|
139
|
+
@if $dark != $light {
|
|
140
|
+
@if (settings.$useColorsLightMode) {
|
|
141
|
+
.light .#{$colorClass},
|
|
142
|
+
.#{$colorClass}.light,
|
|
143
|
+
.light\:#{$colorClass} {
|
|
144
|
+
#{$property}: useColor($color, "light", $opacity);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@if (settings.$useColorsDarkMode) {
|
|
149
|
+
.dark .#{$colorClass},
|
|
150
|
+
.#{$colorClass}.dark,
|
|
151
|
+
.dark\:#{$colorClass} {
|
|
152
|
+
#{$property}: useColor($color, "dark", $opacity);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} @else {
|
|
156
|
+
.#{$colorClass} {
|
|
157
|
+
#{$property}: useColor($color, "light", $opacity);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Use Colors Map ----- ----- ----- -----
|
|
163
|
+
//
|
|
164
|
+
// @mixin useColorsMap
|
|
165
|
+
// --------------------------------------
|
|
166
|
+
// Creates color utility classes using useColor() function for theme variant handling
|
|
167
|
+
// @param {Map} $map - The color map to use (e.g., vars.$colors)
|
|
168
|
+
// @param {Boolean} $withOpacity - Whether to generate opacity variants (default: true)
|
|
169
|
+
// @throws {Error} - If $map is not a valid map
|
|
170
|
+
//
|
|
171
|
+
// @example scss
|
|
172
|
+
// @include useColorsMap($themeColors);
|
|
173
|
+
// // Creates all color classes with theme support
|
|
174
|
+
// // Generated classes include:
|
|
175
|
+
// // .color-[colorName], .bg-color-[colorName], .border-color-[colorName]
|
|
176
|
+
// // With theme variants like .light, .dark
|
|
177
|
+
// // With optional opacity variants like :50, :75
|
|
178
|
+
// // With pseudo-class variants like :hover, :focus
|
|
179
|
+
//
|
|
180
|
+
@mixin useColorsMap($map: vars.$colors, $withOpacity: true) {
|
|
181
|
+
// Validate parameters
|
|
182
|
+
$checkedMap: val.map($map, "useColorsMap()");
|
|
183
|
+
$checkedWithOpacity: val.boolean($withOpacity, "useColorsMap()");
|
|
184
|
+
|
|
185
|
+
@each $color, $modes in $checkedMap {
|
|
186
|
+
@if $color {
|
|
187
|
+
@each $class, $property in configs.$colorsPropertiesMap {
|
|
188
|
+
$mainClass: if($class, "#{$class}#{\:}color-#{$color}", "color-#{$color}");
|
|
189
|
+
|
|
190
|
+
@include useColorProperty($mainClass, $class, $property, $modes, $map);
|
|
191
|
+
|
|
192
|
+
@if $checkedWithOpacity and settings.$useColorsOpacities {
|
|
193
|
+
@each $opacity in configs.$opacities {
|
|
194
|
+
@include useColorProperty(
|
|
195
|
+
"#{$mainClass}#{\:}#{$opacity}",
|
|
196
|
+
$class,
|
|
197
|
+
$property,
|
|
198
|
+
$modes,
|
|
199
|
+
$map,
|
|
200
|
+
$opacity
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@each $pseudoClass, $pseudo in configs.$colorsPseudoMap {
|
|
206
|
+
@if $pseudoClass != "placeholder" or ($pseudoClass == "placeholder" and $class == null) {
|
|
207
|
+
@include useColorProperty(
|
|
208
|
+
"#{$mainClass}#{\:}#{$pseudoClass}#{$pseudo}",
|
|
209
|
+
$class,
|
|
210
|
+
$property,
|
|
211
|
+
$modes,
|
|
212
|
+
$map
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
@if $checkedWithOpacity and settings.$useColorsOpacities {
|
|
216
|
+
@each $opacity in configs.$opacities {
|
|
217
|
+
@include useColorProperty(
|
|
218
|
+
"#{$mainClass}#{\:}#{$opacity}#{\:}#{$pseudoClass}#{$pseudo}",
|
|
219
|
+
$class,
|
|
220
|
+
$property,
|
|
221
|
+
$modes,
|
|
222
|
+
$map,
|
|
223
|
+
$opacity
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "../settings/configs" as configs;
|
|
4
|
+
@use "../settings/index" as settings;
|
|
5
|
+
|
|
6
|
+
// Breakpoint Mixin
|
|
7
|
+
// --------------------------------------
|
|
8
|
+
// Generates a media query based on a breakpoint key and type (min/max).
|
|
9
|
+
// If the key is not found or is null/empty (e.g., for default styles),
|
|
10
|
+
// it applies the content directly without a media query.
|
|
11
|
+
//
|
|
12
|
+
// @param {String} $type - The type of media query (e.g., "min", "max").
|
|
13
|
+
// @param {String | Null} $key - The breakpoint key from `configs.$breakpoints` (e.g., "sm", "md", "lg").
|
|
14
|
+
// If null or an empty string, content is applied directly.
|
|
15
|
+
//
|
|
16
|
+
// @content - Styles to be applied within the media query or directly.
|
|
17
|
+
//
|
|
18
|
+
// @example scss
|
|
19
|
+
// .element {
|
|
20
|
+
// color: blue; // Default
|
|
21
|
+
//
|
|
22
|
+
// @include mQ(min, "md") {
|
|
23
|
+
// color: red; // Applied when (min-width: md-breakpoint-value)
|
|
24
|
+
// }
|
|
25
|
+
//
|
|
26
|
+
// @include mQ(max, "lg") {
|
|
27
|
+
// padding: 20px; // Applied when (max-width: lg-breakpoint-value)
|
|
28
|
+
// }
|
|
29
|
+
//
|
|
30
|
+
// // Example for applying base styles (no media query)
|
|
31
|
+
// @include mQ(min, null) { // or @include mQ(min, "")
|
|
32
|
+
// font-size: 16px; // Applied directly
|
|
33
|
+
// }
|
|
34
|
+
// }
|
|
35
|
+
//
|
|
36
|
+
// @output css - Example output for .element
|
|
37
|
+
// .element {
|
|
38
|
+
// color: blue;
|
|
39
|
+
// font-size: 16px;
|
|
40
|
+
// }
|
|
41
|
+
// @media (min-width: 768px) { // Assuming 'md' is 768px
|
|
42
|
+
// .element {
|
|
43
|
+
// color: red;
|
|
44
|
+
// }
|
|
45
|
+
// }
|
|
46
|
+
// @media (max-width: 1024px) { // Assuming 'lg' is 1024px
|
|
47
|
+
// .element {
|
|
48
|
+
// padding: 20px;
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
51
|
+
//
|
|
52
|
+
@mixin mQ($type, $key) {
|
|
53
|
+
// Retrieve the size value from the breakpoints map using the provided key
|
|
54
|
+
$size: map.get(configs.$breakpoints, $key);
|
|
55
|
+
|
|
56
|
+
@if $size and $size > 0 and settings.$useMediaQueries {
|
|
57
|
+
// Check if a valid size value exists
|
|
58
|
+
// Generate the media query using the provided type and size
|
|
59
|
+
@media (string.unquote("#{$type}-width"): $size) {
|
|
60
|
+
@content; // Content to be included within the media query
|
|
61
|
+
}
|
|
62
|
+
} @else {
|
|
63
|
+
// If no valid size value exists, apply the content without a media query
|
|
64
|
+
@content;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// How to call
|
|
68
|
+
// ex: color: mQ(min or max, xs/md/lg/xl/xxl) // Note: This comment seems to refer to an old way or is a general usage hint.
|
|
69
|
+
|
|
70
|
+
// Multi Sizes Mixin
|
|
71
|
+
// --------------------------------------
|
|
72
|
+
// Iterates through media query sizes defined by the `multiSizes()` function
|
|
73
|
+
// and applies content within the appropriate media query.
|
|
74
|
+
// This mixin is designed to be used with `@content($size, $divider)`,
|
|
75
|
+
// allowing the consuming code to generate responsive utility classes.
|
|
76
|
+
//
|
|
77
|
+
// @content {String} $size - The current breakpoint size key (e.g., "", "sm", "md").
|
|
78
|
+
// @content {String} $divider - The class divider for the current size (e.g., "", ":").
|
|
79
|
+
//
|
|
80
|
+
// @example scss
|
|
81
|
+
// // In another file (e.g., _typographic.scss)
|
|
82
|
+
// @use "mediaQueries" as mQ;
|
|
83
|
+
// @use "configs";
|
|
84
|
+
//
|
|
85
|
+
// @include mQ.multiSizes() using ($size, $divider) {
|
|
86
|
+
// $classPrefix: if($size, "#{$size}#{$divider}", "");
|
|
87
|
+
//
|
|
88
|
+
// .#{$classPrefix}text-left {
|
|
89
|
+
// text-align: left if($size, !important, null);
|
|
90
|
+
// }
|
|
91
|
+
// .#{$classPrefix}text-center {
|
|
92
|
+
// text-align: center if($size, !important, null);
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
//
|
|
96
|
+
// @output css - Example output
|
|
97
|
+
// .text-left {
|
|
98
|
+
// text-align: left;
|
|
99
|
+
// }
|
|
100
|
+
// .text-center {
|
|
101
|
+
// text-align: center;
|
|
102
|
+
// }
|
|
103
|
+
//
|
|
104
|
+
// @media (min-width: 768px) { // Assuming 'md' is 768px
|
|
105
|
+
// .md\\:text-left {
|
|
106
|
+
// text-align: left !important;
|
|
107
|
+
// }
|
|
108
|
+
// .md\\:text-center {
|
|
109
|
+
// text-align: center !important;
|
|
110
|
+
// }
|
|
111
|
+
// }
|
|
112
|
+
//
|
|
113
|
+
@mixin multiSizes() {
|
|
114
|
+
@if settings.$useMediaQueries {
|
|
115
|
+
@each $size, $value in configs.$breakpoints {
|
|
116
|
+
$divider: if($size, #{\:}, "");
|
|
117
|
+
|
|
118
|
+
@include mQ(min, $size) {
|
|
119
|
+
@content ($size, $divider);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} @else {
|
|
123
|
+
$size: null;
|
|
124
|
+
$divider: "";
|
|
125
|
+
|
|
126
|
+
@content ($size, $divider);
|
|
127
|
+
}
|
|
128
|
+
}
|