@nuvoui/core 1.4.2 → 1.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvoui/core",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "NuvoUI is a human-friendly SCSS framework designed for simplicity, and modern responsive designs.",
5
5
  "author": {
6
6
  "name": "AALA IT Solutions",
@@ -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;
@@ -78,11 +78,11 @@
78
78
  position: absolute;
79
79
  }
80
80
 
81
- // @mixin absolute
82
- // @description Sets position to absolute, removing from normal document flow
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 absolute;
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
- // todo: Documentation
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
- // todo: Documentation
166
- // Fractional and percentage placements
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
- // TODO: SHADOWS WITH COLOR VARIANTS WITH RESPONSIVE
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($shadow-sizes, $size) {
64
- @error "Shadow size '#{$size}' not found in $shadow-sizes map";
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($shadow-sizes, $size);
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($shadow-sizes, $size);
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 $shadow-sizes {
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 $shadow-sizes {
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, config-flags.$default-unit);
147
+ margin-top: fn-units.fix-units($val);
150
148
  }
151
149
 
152
150
  // @mixin mr