@nuvoui/core 1.4.2 → 1.4.4
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/README.md +76 -61
- package/dist/nuvoui.css +7 -7
- package/dist/nuvoui.css.map +1 -1
- package/dist/nuvoui.min.css.map +1 -1
- package/package.json +1 -1
- package/src/styles/config/_colors.scss +10 -0
- package/src/styles/config/_shadows.scss +42 -1
- package/src/styles/functions/_colors.scss +10 -0
- package/src/styles/utilities/_position.scss +18 -7
- package/src/styles/utilities/_shadows.scss +7 -45
- package/src/styles/utilities/_spacing.scss +1 -3
- package/src/styles/utilities/_typography.scss +2 -2
package/package.json
CHANGED
|
@@ -39,6 +39,16 @@ $color-names-with-basic: list.join($color-names, map.keys($basic-colors));
|
|
|
39
39
|
// A default color for color generation function `get-color` to return a a default value on using wrong value
|
|
40
40
|
$default-color: currentcolor !default;
|
|
41
41
|
|
|
42
|
+
// CSS Named Colors Map
|
|
43
|
+
// Purpose: This map contains 159+ CSS named colors for internal use only.
|
|
44
|
+
// These colors are NOT generated as utility classes to prevent CSS bloat.
|
|
45
|
+
// Used by:
|
|
46
|
+
// - Color validation functions (to check if a string is a valid color)
|
|
47
|
+
// - SCSS mixins that accept color names (e.g., @include apply(bg(coral)))
|
|
48
|
+
// - Type detection in the framework
|
|
49
|
+
// Note: Generating utilities for all these colors would create thousands of classes
|
|
50
|
+
// (each color × states × breakpoints), significantly increasing bundle size.
|
|
51
|
+
// If you need specific named colors as utilities, add them to $color-primitives instead.
|
|
42
52
|
$colors-constants: (
|
|
43
53
|
"aliceblue": aliceblue,
|
|
44
54
|
"antiquewhite": antiquewhite,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Configuration: Shadows
|
|
2
|
-
// Shadow color definitions
|
|
2
|
+
// Shadow color definitions and shadow size configurations
|
|
3
3
|
|
|
4
4
|
$shadow-colors: (
|
|
5
5
|
"default": rgb(0 0 0 / 10%),
|
|
@@ -7,3 +7,44 @@ $shadow-colors: (
|
|
|
7
7
|
"darker": rgb(0 0 0 / 35%),
|
|
8
8
|
"darkest": rgb(0 0 0 / 50%),
|
|
9
9
|
) !default;
|
|
10
|
+
|
|
11
|
+
// Shadow size definitions
|
|
12
|
+
// Each size contains x, y, blur, and spread values
|
|
13
|
+
$shadow-sizes: (
|
|
14
|
+
"sm": (
|
|
15
|
+
"x": 0,
|
|
16
|
+
"y": 1px,
|
|
17
|
+
"blur": 2px,
|
|
18
|
+
"spread": 0,
|
|
19
|
+
),
|
|
20
|
+
"md": (
|
|
21
|
+
"x": 0,
|
|
22
|
+
"y": 4px,
|
|
23
|
+
"blur": 6px,
|
|
24
|
+
"spread": -1px,
|
|
25
|
+
),
|
|
26
|
+
"lg": (
|
|
27
|
+
"x": 0,
|
|
28
|
+
"y": 10px,
|
|
29
|
+
"blur": 15px,
|
|
30
|
+
"spread": -3px,
|
|
31
|
+
),
|
|
32
|
+
"xl": (
|
|
33
|
+
"x": 0,
|
|
34
|
+
"y": 20px,
|
|
35
|
+
"blur": 25px,
|
|
36
|
+
"spread": -5px,
|
|
37
|
+
),
|
|
38
|
+
"hero": (
|
|
39
|
+
"x": 0,
|
|
40
|
+
"y": 20px,
|
|
41
|
+
"blur": 25px,
|
|
42
|
+
"spread": 5px,
|
|
43
|
+
),
|
|
44
|
+
"monster": (
|
|
45
|
+
"x": 0,
|
|
46
|
+
"y": 20px,
|
|
47
|
+
"blur": 55px,
|
|
48
|
+
"spread": 20px,
|
|
49
|
+
),
|
|
50
|
+
) !default;
|
|
@@ -174,6 +174,11 @@ $color-cache: (); // to store the generated colors
|
|
|
174
174
|
@return $default-color;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
// Convert string shade to number if needed
|
|
178
|
+
@if meta.type-of($shade) == "string" {
|
|
179
|
+
$shade: fn-math.to-number($shade);
|
|
180
|
+
}
|
|
181
|
+
|
|
177
182
|
@if not is-valid-shade($shade) {
|
|
178
183
|
@warn "Invalid shade value: #{$shade}. Valid range is 50 to 900.";
|
|
179
184
|
@return $default-color;
|
|
@@ -273,6 +278,11 @@ $color-cache: (); // to store the generated colors
|
|
|
273
278
|
}
|
|
274
279
|
|
|
275
280
|
@function is-valid-shade($shade) {
|
|
281
|
+
// Convert string to number if needed
|
|
282
|
+
@if meta.type-of($shade) == "string" {
|
|
283
|
+
$shade: fn-math.to-number($shade);
|
|
284
|
+
}
|
|
285
|
+
|
|
276
286
|
@if meta.type-of($shade) == "number" {
|
|
277
287
|
@return $shade >= 50 and $shade <= 900;
|
|
278
288
|
}
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
position: absolute;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// @mixin
|
|
82
|
-
// @description Sets position to
|
|
81
|
+
// @mixin fixed
|
|
82
|
+
// @description Sets position to fixed, removing from normal document flow and fixing relative to viewport
|
|
83
83
|
// @example
|
|
84
84
|
// .popup {
|
|
85
|
-
// @include
|
|
85
|
+
// @include fixed;
|
|
86
86
|
// top: 0;
|
|
87
87
|
// left: 0;
|
|
88
88
|
// }
|
|
@@ -147,10 +147,15 @@
|
|
|
147
147
|
// @include left(0);
|
|
148
148
|
// }
|
|
149
149
|
@mixin left($value) {
|
|
150
|
-
left: $value;
|
|
150
|
+
left: fn-units.fix-units($value);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
//
|
|
153
|
+
// @mixin absolute-center
|
|
154
|
+
// @description Centers an element absolutely within its positioned parent
|
|
155
|
+
// @example
|
|
156
|
+
// .modal {
|
|
157
|
+
// @include absolute-center;
|
|
158
|
+
// }
|
|
154
159
|
@mixin absolute-center {
|
|
155
160
|
position: absolute;
|
|
156
161
|
left: 50%;
|
|
@@ -162,8 +167,14 @@
|
|
|
162
167
|
transform: translateX(var(--translate-x)) translateY(var(--translate-y)) translateZ(var(--translate-z, 0)) rotate(var(--rotate, 0)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));
|
|
163
168
|
}
|
|
164
169
|
|
|
165
|
-
//
|
|
166
|
-
//
|
|
170
|
+
// @variable $position-fractions
|
|
171
|
+
// @description Common percentage values for positioning elements
|
|
172
|
+
// @note These values are used to generate position utility classes like .top-25p, .left-50p, etc.
|
|
173
|
+
// @example
|
|
174
|
+
// .sidebar {
|
|
175
|
+
// @include absolute;
|
|
176
|
+
// @include top(map.get($position-fractions, "25p")); // top: 25%
|
|
177
|
+
// }
|
|
167
178
|
$position-fractions: (
|
|
168
179
|
"25p": 25%,
|
|
169
180
|
"33p": 33.333%,
|
|
@@ -7,45 +7,7 @@
|
|
|
7
7
|
@use "../config/shadows" as config-shadow;
|
|
8
8
|
@use "../functions/feature-flags" as fn-flags;
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
$shadow-sizes: (
|
|
12
|
-
"sm": (
|
|
13
|
-
"x": 0,
|
|
14
|
-
"y": 1px,
|
|
15
|
-
"blur": 2px,
|
|
16
|
-
"spread": 0,
|
|
17
|
-
),
|
|
18
|
-
"md": (
|
|
19
|
-
"x": 0,
|
|
20
|
-
"y": 4px,
|
|
21
|
-
"blur": 6px,
|
|
22
|
-
"spread": -1px,
|
|
23
|
-
),
|
|
24
|
-
"lg": (
|
|
25
|
-
"x": 0,
|
|
26
|
-
"y": 10px,
|
|
27
|
-
"blur": 15px,
|
|
28
|
-
"spread": -3px,
|
|
29
|
-
),
|
|
30
|
-
"xl": (
|
|
31
|
-
"x": 0,
|
|
32
|
-
"y": 20px,
|
|
33
|
-
"blur": 25px,
|
|
34
|
-
"spread": -5px,
|
|
35
|
-
),
|
|
36
|
-
"hero": (
|
|
37
|
-
"x": 0,
|
|
38
|
-
"y": 20px,
|
|
39
|
-
"blur": 25px,
|
|
40
|
-
"spread": 5px,
|
|
41
|
-
),
|
|
42
|
-
"monster": (
|
|
43
|
-
"x": 0,
|
|
44
|
-
"y": 20px,
|
|
45
|
-
"blur": 55px,
|
|
46
|
-
"spread": 20px,
|
|
47
|
-
),
|
|
48
|
-
);
|
|
10
|
+
// Shadow sizes are now configured in config/_shadows.scss
|
|
49
11
|
|
|
50
12
|
// Generates a CSS shadow string from a given size.
|
|
51
13
|
// @param {String} $size - The shadow size.
|
|
@@ -60,8 +22,8 @@ $shadow-sizes: (
|
|
|
60
22
|
// @param {String} $size - The shadow size.
|
|
61
23
|
// @param {String} $color - The shadow color.
|
|
62
24
|
@mixin shadow($size: "md", $color: "default") {
|
|
63
|
-
@if not map.has-key(
|
|
64
|
-
@error "Shadow size '#{$size}' not found in
|
|
25
|
+
@if not map.has-key(config-shadow.$shadow-sizes, $size) {
|
|
26
|
+
@error "Shadow size '#{$size}' not found in config-shadow.$shadow-sizes map";
|
|
65
27
|
$size: "md"; // Fallback to default
|
|
66
28
|
}
|
|
67
29
|
@if not map.has-key(config-shadow.$shadow-colors, $color) {
|
|
@@ -69,13 +31,13 @@ $shadow-sizes: (
|
|
|
69
31
|
$color: "default"; // Fallback to default
|
|
70
32
|
}
|
|
71
33
|
|
|
72
|
-
$shadow: map.get(
|
|
34
|
+
$shadow: map.get(config-shadow.$shadow-sizes, $size);
|
|
73
35
|
$shadow-color: map.get(config-shadow.$shadow-colors, $color);
|
|
74
36
|
@include shadow-base(map.get($shadow, "x"), map.get($shadow, "y"), map.get($shadow, "blur"), map.get($shadow, "spread"), $shadow-color);
|
|
75
37
|
}
|
|
76
38
|
|
|
77
39
|
@mixin shadow-inset($size: "md", $color: "default") {
|
|
78
|
-
$shadow: map.get(
|
|
40
|
+
$shadow: map.get(config-shadow.$shadow-sizes, $size);
|
|
79
41
|
$shadow-color: map.get(config-shadow.$shadow-colors, $color);
|
|
80
42
|
|
|
81
43
|
box-shadow: inset map.get($shadow, "x") map.get($shadow, "y") map.get($shadow, "blur") map.get($shadow, "spread") $shadow-color;
|
|
@@ -103,7 +65,7 @@ $shadow-sizes: (
|
|
|
103
65
|
box-shadow: none !important;
|
|
104
66
|
}
|
|
105
67
|
|
|
106
|
-
@each $size, $values in
|
|
68
|
+
@each $size, $values in config-shadow.$shadow-sizes {
|
|
107
69
|
#{config-flags.$parent-selector} .shadow-#{$size} {
|
|
108
70
|
@include shadow($size);
|
|
109
71
|
}
|
|
@@ -176,7 +138,7 @@ $shadow-sizes: (
|
|
|
176
138
|
// Responsive variants
|
|
177
139
|
@each $breakpoint, $width in config-breakpoint.$breakpoints {
|
|
178
140
|
@media (min-width: #{$width}) {
|
|
179
|
-
@each $size, $values in
|
|
141
|
+
@each $size, $values in config-shadow.$shadow-sizes {
|
|
180
142
|
// Regular shadows with breakpoints
|
|
181
143
|
#{config-flags.$parent-selector} .shadow-#{$size}\@#{$breakpoint} {
|
|
182
144
|
@include shadow($size);
|
|
@@ -137,8 +137,6 @@
|
|
|
137
137
|
// @description Sets vertical margin (top and bottom)
|
|
138
138
|
// @param {Number|String} $val - Margin value
|
|
139
139
|
@mixin my($val) {
|
|
140
|
-
$val: fn-units.fix-units($val);
|
|
141
|
-
|
|
142
140
|
margin-block: fn-units.fix-units($val);
|
|
143
141
|
}
|
|
144
142
|
|
|
@@ -146,7 +144,7 @@
|
|
|
146
144
|
// @description Sets margin-top
|
|
147
145
|
// @param {Number|String} $val - Margin value
|
|
148
146
|
@mixin mt($val) {
|
|
149
|
-
margin-top: fn-units.fix-units($val
|
|
147
|
+
margin-top: fn-units.fix-units($val);
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
// @mixin mr
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
|
|
269
269
|
@each $size, $val in config-typo.$font-sizes {
|
|
270
270
|
#{config-flags.$parent-selector} .text-#{$size}#{$suffix} {
|
|
271
|
-
@include
|
|
271
|
+
@include font-size($size);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
|
|
@@ -446,7 +446,7 @@
|
|
|
446
446
|
@media (min-width: #{$width}) {
|
|
447
447
|
@each $size, $val in config-typo.$font-sizes {
|
|
448
448
|
#{config-flags.$parent-selector} .text-#{$size}\@#{$breakpoint} {
|
|
449
|
-
@include
|
|
449
|
+
@include font-size($size);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
@include responsive-config-typo($breakpoint);
|