@nuvoui/core 1.2.6 → 1.3.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.
@@ -1,6 +1,8 @@
1
1
  // _theme.scss - CSS variables and utility classes
2
2
  @use "sass:color";
3
3
  @use "sass:map";
4
+ @use "sass:string";
5
+ @use "sass:list";
4
6
  @use "../utilities/colors" as COL;
5
7
  @use "../abstracts/config" as VAR;
6
8
 
@@ -25,36 +27,20 @@
25
27
 
26
28
  @each $token in VAR.$theme-tokens {
27
29
  --#{$token}: #{map.get(VAR.$light-theme, $token)};
30
+ --inverted-#{$token}: #{map.get(VAR.$dark-theme, $token)};
31
+ }
32
+ @each $color-name, $color-val in VAR.$basic-colors {
33
+ --#{$color-name}: #{$color-val};
28
34
  }
29
35
 
30
- --button-text-color: #{map.get(VAR.$dark-theme, "text-default")};
31
- --inverted-text-color: #{map.get(VAR.$dark-theme, "text-default")};
36
+ // --button-text-color: #{map.get(VAR.$dark-theme, "text-default")};
37
+ // --inverted-text-color: #{map.get(VAR.$dark-theme, "text-default")};
32
38
 
33
39
  // Light theme variables
34
40
  --button-bg-color: var(--primary);
35
41
  --button-bg-color-hover: var(--primary-600);
36
42
  --link-color: var(--primary);
37
43
  --link-hover-color: var(--primary-600);
38
-
39
- // #{VAR.$parent-selector} {
40
- // // Scrollbar styling
41
- // &::-webkit-scrollbar {
42
- // width: 12px;
43
- // }
44
-
45
- // &::-webkit-scrollbar-track {
46
- // background: var(--background);
47
- // }
48
-
49
- // &::-webkit-scrollbar-thumb {
50
- // background-color: #888;
51
- // border-radius: 6px;
52
- // border: 3px solid var(--background);
53
- // }
54
-
55
- // scrollbar-width: thin;
56
- // scrollbar-color: #888 var(--background);
57
- // }
58
44
  }
59
45
 
60
46
  @if VAR.$enable-dark-mode {
@@ -62,10 +48,10 @@
62
48
  [data-theme="dark"] {
63
49
  @each $token in VAR.$theme-tokens {
64
50
  --#{$token}: #{map.get(VAR.$dark-theme, $token)};
51
+ --inverted-#{$token}: #{map.get(VAR.$light-theme, $token)};
65
52
  }
66
53
 
67
54
  --button-text-color: #{map.get(VAR.$light-theme, "text-default")};
68
- --inverted-text-color: #{map.get(VAR.$light-theme, "text-default")};
69
55
  --button-bg-color: var(--primary);
70
56
  --button-bg-color-hover: var(--primary-400);
71
57
  --link-color: var(--primary);
@@ -184,57 +170,55 @@
184
170
  }
185
171
  }
186
172
 
187
- // Semantic color utilities
188
- #{VAR.$parent-selector} .bg-page {
189
- background-color: var(--background);
190
- }
191
-
192
- #{VAR.$parent-selector} .bg-surface {
193
- background-color: var(--surface);
194
- }
195
-
196
- #{VAR.$parent-selector} .bg-active {
197
- background-color: var(--button-bg-color);
198
- }
199
-
200
- #{VAR.$parent-selector} .bg-hover {
201
- background-color: var(--button-bg-color-hover);
202
- }
203
-
204
- #{VAR.$parent-selector} .bg-white,
205
- .hover\:bg-white:hover {
206
- background-color: white;
207
- }
208
-
209
- #{VAR.$parent-selector} .bg-black,
210
- .hover\:bg-black:hover {
211
- background-color: black;
212
- }
213
-
214
- #{VAR.$parent-selector} .text-default {
215
- color: var(--text-default);
216
- }
173
+ @each $color-name, $color-val in VAR.$basic-colors {
174
+ // Base color classes
175
+ #{VAR.$parent-selector} .text-#{$color-name},
176
+ #{VAR.$parent-selector} .hover\:text-#{$color-name}:hover,
177
+ #{VAR.$parent-selector} .group:hover .group-hover\:text-#{$color-name} {
178
+ color: var(--#{$color-name});
179
+ }
217
180
 
218
- #{VAR.$parent-selector} .text-muted {
219
- color: var(--text-muted);
220
- }
181
+ #{VAR.$parent-selector} .bg-#{$color-name},
182
+ #{VAR.$parent-selector} .hover\:bg-#{$color-name}:hover,
183
+ #{VAR.$parent-selector} .group:hover .group-hover\:bg-#{$color-name} {
184
+ background-color: var(--#{$color-name});
185
+ }
221
186
 
222
- #{VAR.$parent-selector} .text-inverted {
223
- color: var(--inverted-text-color);
187
+ #{VAR.$parent-selector} .border-#{$color-name},
188
+ #{VAR.$parent-selector} .hover\:border-#{$color-name}:hover,
189
+ #{VAR.$parent-selector} .group:hover .group-hover\:border-#{$color-name} {
190
+ border-color: var(--#{$color-name});
191
+ }
224
192
  }
225
193
 
226
- #{VAR.$parent-selector} .text-white,
227
- #{VAR.$parent-selector} .hover\:text-white:hover {
228
- color: white;
229
- }
194
+ @each $token in VAR.$theme-tokens {
195
+ $parts: string.split($token, "-");
196
+ $prefix: list.nth($parts, 1);
230
197
 
231
- #{VAR.$parent-selector} .text-black,
232
- #{VAR.$parent-selector} .hover\:text-black:hover {
233
- color: black;
234
- }
198
+ #{VAR.$parent-selector} .#{$token},
199
+ #{VAR.$parent-selector} .hover\:#{$token}:hover,
200
+ #{VAR.$parent-selector} .group:hover .group-hover\:#{$token} {
201
+ @if $prefix == "bg" {
202
+ background-color: var(--#{$token});
203
+ } @else if $prefix == "text" {
204
+ color: var(--#{$token});
205
+ } @else if $prefix == "border" {
206
+ border-color: var(--#{$token});
207
+ }
208
+ }
235
209
 
236
- #{VAR.$parent-selector} .text-subtle {
237
- color: var(--text-muted);
238
- opacity: 0.7;
210
+ #{VAR.$parent-selector} .inverted-#{$token},
211
+ #{VAR.$parent-selector} .hover\:inverted-#{$token}:hover,
212
+ #{VAR.$parent-selector} .group:hover .group-hover\:inverted-#{$token} {
213
+ @if $prefix == "bg" {
214
+ background-color: var(--inverted-#{$token});
215
+ } @else if $prefix == "text" {
216
+ color: var(--inverted-#{$token});
217
+ } @else if $prefix == "border" {
218
+ border-color: var(--inverted-#{$token});
219
+ } @else if $prefix == "fg" {
220
+ color: var(--inverted-#{$token});
221
+ }
222
+ }
239
223
  }
240
224
  }
@@ -17,11 +17,11 @@
17
17
  // Blur values
18
18
  $backdrop-blur-values: (
19
19
  "none": 0,
20
- "sm": 4px,
21
- "md": 8px,
22
- "lg": 12px,
23
- "xl": 24px,
24
- "2xl": 40px,
20
+ "sm": 2px,
21
+ "md": 4px,
22
+ "lg": 8px,
23
+ "xl": 16px,
24
+ "2xl": 32px,
25
25
  );
26
26
 
27
27
  // Brightness values
@@ -103,101 +103,129 @@ $backdrop-filter-presets: (
103
103
  backdrop-filter: $value;
104
104
  }
105
105
 
106
- // Specific filter mixins
106
+ // Base layer mixin that initializes the CSS variables
107
+ @mixin backdrop-layer {
108
+ --backdrop-blur: blur(0);
109
+ --backdrop-brightness: brightness(100%);
110
+ --backdrop-contrast: contrast(100%);
111
+ --backdrop-grayscale: grayscale(0);
112
+ --backdrop-hue-rotate: hue-rotate(0deg);
113
+ --backdrop-invert: invert(0);
114
+ --backdrop-saturate: saturate(100%);
115
+ --backdrop-sepia: sepia(0);
116
+
117
+ backdrop-filter: var(--backdrop-blur) var(--backdrop-brightness) var(--backdrop-contrast) var(--backdrop-grayscale) var(--backdrop-hue-rotate) var(--backdrop-invert) var(--backdrop-saturate) var(--backdrop-sepia);
118
+ }
119
+
120
+ // Specific filter mixins - now they set CSS variables instead of the backdrop-filter property
107
121
  @mixin backdrop-blur($value) {
108
122
  @if map.has-key($backdrop-blur-values, $value) {
109
- @include backdrop-filter(blur(map.get($backdrop-blur-values, $value)));
123
+ --backdrop-blur: blur(#{map.get($backdrop-blur-values, $value)});
110
124
  } @else {
111
- @include backdrop-filter(blur($value));
125
+ --backdrop-blur: blur(#{$value});
112
126
  }
113
127
  }
114
128
 
115
129
  @mixin backdrop-brightness($value) {
116
130
  @if map.has-key($backdrop-brightness-values, $value) {
117
- @include backdrop-filter(brightness(map.get($backdrop-brightness-values, $value)));
131
+ --backdrop-brightness: brightness(#{map.get($backdrop-brightness-values, $value)});
118
132
  } @else {
119
- @include backdrop-filter(brightness($value));
133
+ --backdrop-brightness: brightness(#{$value});
120
134
  }
121
135
  }
122
136
 
123
137
  @mixin backdrop-contrast($value) {
124
138
  @if map.has-key($backdrop-contrast-values, $value) {
125
- @include backdrop-filter(contrast(map.get($backdrop-contrast-values, $value)));
139
+ --backdrop-contrast: contrast(#{map.get($backdrop-contrast-values, $value)});
126
140
  } @else {
127
- @include backdrop-filter(contrast($value));
141
+ --backdrop-contrast: contrast(#{$value});
128
142
  }
129
143
  }
130
144
 
131
145
  @mixin backdrop-grayscale($value) {
132
146
  @if map.has-key($backdrop-grayscale-values, $value) {
133
- @include backdrop-filter(grayscale(map.get($backdrop-grayscale-values, $value)));
147
+ --backdrop-grayscale: grayscale(#{map.get($backdrop-grayscale-values, $value)});
134
148
  } @else {
135
- @include backdrop-filter(grayscale($value));
149
+ --backdrop-grayscale: grayscale(#{$value});
136
150
  }
137
151
  }
138
152
 
139
153
  @mixin backdrop-hue-rotate($value) {
140
154
  @if map.has-key($backdrop-hue-rotate-values, $value) {
141
- @include backdrop-filter(hue-rotate(map.get($backdrop-hue-rotate-values, $value)));
155
+ --backdrop-hue-rotate: hue-rotate(#{map.get($backdrop-hue-rotate-values, $value)});
142
156
  } @else {
143
- @include backdrop-filter(hue-rotate($value));
157
+ --backdrop-hue-rotate: hue-rotate(#{$value});
144
158
  }
145
159
  }
146
160
 
147
161
  @mixin backdrop-invert($value) {
148
162
  @if map.has-key($backdrop-invert-values, $value) {
149
- @include backdrop-filter(invert(map.get($backdrop-invert-values, $value)));
163
+ --backdrop-invert: invert(#{map.get($backdrop-invert-values, $value)});
150
164
  } @else {
151
- @include backdrop-filter(invert($value));
165
+ --backdrop-invert: invert(#{$value});
152
166
  }
153
167
  }
154
168
 
155
169
  @mixin backdrop-saturate($value) {
156
170
  @if map.has-key($backdrop-saturate-values, $value) {
157
- @include backdrop-filter(saturate(map.get($backdrop-saturate-values, $value)));
171
+ --backdrop-saturate: saturate(#{map.get($backdrop-saturate-values, $value)});
158
172
  } @else {
159
- @include backdrop-filter(saturate($value));
173
+ --backdrop-saturate: saturate(#{$value});
160
174
  }
161
175
  }
162
176
 
163
177
  @mixin backdrop-sepia($value) {
164
178
  @if map.has-key($backdrop-sepia-values, $value) {
165
- @include backdrop-filter(sepia(map.get($backdrop-sepia-values, $value)));
179
+ --backdrop-sepia: sepia(#{map.get($backdrop-sepia-values, $value)});
166
180
  } @else {
167
- @include backdrop-filter(sepia($value));
181
+ --backdrop-sepia: sepia(#{$value});
168
182
  }
169
183
  }
170
184
 
171
185
  // Preset backdrop effects
172
186
  @mixin backdrop-frosted {
173
- @include backdrop-filter(map.get($backdrop-filter-presets, "frosted"));
187
+ backdrop-filter: #{map.get($backdrop-filter-presets, "frosted")};
174
188
  }
175
189
 
176
190
  @mixin backdrop-glass {
177
- @include backdrop-filter(map.get($backdrop-filter-presets, "glass"));
191
+ backdrop-filter: #{map.get($backdrop-filter-presets, "glass")};
178
192
  }
179
193
 
180
194
  @mixin backdrop-dark-glass {
181
- @include backdrop-filter(map.get($backdrop-filter-presets, "dark-glass"));
195
+ backdrop-filter: #{map.get($backdrop-filter-presets, "dark-glass")};
182
196
  }
183
197
 
184
198
  @mixin backdrop-crystal {
185
- @include backdrop-filter(map.get($backdrop-filter-presets, "crystal"));
199
+ backdrop-filter: #{map.get($backdrop-filter-presets, "crystal")};
186
200
  }
187
201
 
188
202
  @mixin backdrop-matte {
189
- @include backdrop-filter(map.get($backdrop-filter-presets, "matte"));
203
+ backdrop-filter: #{map.get($backdrop-filter-presets, "matte")};
190
204
  }
191
205
 
192
206
  // Reset filter
193
207
  @mixin backdrop-none {
194
208
  backdrop-filter: none;
209
+
210
+ --backdrop-blur: none;
211
+ --backdrop-brightness: none;
212
+ --backdrop-contrast: none;
213
+ --backdrop-grayscale: none;
214
+ --backdrop-hue-rotate: none;
215
+ --backdrop-invert: none;
216
+ --backdrop-saturate: none;
217
+ --backdrop-sepia: none;
195
218
  }
196
219
 
197
220
  // Generate utility classes
198
221
  @mixin generate-backdrop-filter-utilities($breakpoint: null) {
199
222
  $suffix: if($breakpoint, "\\@#{$breakpoint}", "");
200
223
 
224
+ // Base layer class
225
+ #{VAR.$parent-selector} .backdrop-layer#{$suffix} {
226
+ @include backdrop-layer;
227
+ }
228
+
201
229
  // Basic backdrop utilities
202
230
  #{VAR.$parent-selector} .backdrop-none#{$suffix} {
203
231
  @include backdrop-none;
@@ -259,7 +287,7 @@ $backdrop-filter-presets: (
259
287
  }
260
288
  }
261
289
 
262
- // Preset utilities
290
+ // Preset utilities (these override the CSS variables approach)
263
291
  #{VAR.$parent-selector} .backdrop-frosted#{$suffix} {
264
292
  @include backdrop-frosted;
265
293
  }
@@ -288,10 +316,3 @@ $backdrop-filter-presets: (
288
316
  }
289
317
  }
290
318
  }
291
-
292
- // Update your mixins-map.scss to include these mixins:
293
- // @else if str.index($ms, 'backdrop-blur(') == 1 {
294
- // $param1: list.nth($params, 1);
295
- // @include backdrop-blur($param1);
296
- // }
297
- // Add similar entries for all other backdrop filter mixins
@@ -38,7 +38,7 @@ $border-styles: (solid, dashed, dotted, double, none);
38
38
 
39
39
  // Core Border Mixins - improved to include style and color by default
40
40
  // SKIP Documentation
41
- @mixin border($val, $style: solid, $color: var(--border)) {
41
+ @mixin border($val, $style: solid, $color: var(--border-base)) {
42
42
  $val: FN.fix-units($val);
43
43
 
44
44
  border-width: $val;
@@ -51,7 +51,7 @@
51
51
  * @description Set display to initial original state.
52
52
  */
53
53
  @mixin show {
54
- display: revert;
54
+ display: initial;
55
55
  }
56
56
 
57
57
  /**
@@ -120,7 +120,6 @@
120
120
  }
121
121
 
122
122
  @if VAR.$generate-utility-classes {
123
- // Base Classes
124
123
  #{VAR.$parent-selector} .hide {
125
124
  @include hide;
126
125
  }
@@ -64,11 +64,11 @@ $shadow-sizes: (
64
64
  */
65
65
  @mixin shadow($size: "md", $color: "default") {
66
66
  @if not map.has-key($shadow-sizes, $size) {
67
- @warn "Shadow size '#{$size}' not found in $shadow-sizes map";
67
+ @error "Shadow size '#{$size}' not found in $shadow-sizes map";
68
68
  $size: "md"; // Fallback to default
69
69
  }
70
70
  @if not map.has-key(VAR.$shadow-colors, $color) {
71
- @warn "Shadow color '#{$color}' not found in VAR.$shadow-colors map";
71
+ @error "Shadow color '#{$color}' not found in VAR.$shadow-colors map";
72
72
  $color: "default"; // Fallback to default
73
73
  }
74
74
 
@@ -259,7 +259,7 @@ $origin-values: (
259
259
  @include translate-x($value);
260
260
  }
261
261
 
262
- #{VAR.$parent-selector} .translate-x-#{$key}\@#{$breakpoint},
262
+ #{VAR.$parent-selector} .translate-y-#{$key}\@#{$breakpoint},
263
263
  #{VAR.$parent-selector} .hover\:translate-y-#{$key}\@#{$breakpoint}:hover,
264
264
  #{VAR.$parent-selector} .group:hover .group-hover\:translate-y-#{$key}\@#{$breakpoint} {
265
265
  @include translate-y($value);
@@ -272,7 +272,7 @@ $origin-values: (
272
272
  @include translate-x($value);
273
273
  }
274
274
 
275
- #{VAR.$parent-selector} .-translate-x-#{$key}\@#{$breakpoint},
275
+ #{VAR.$parent-selector} .-translate-y-#{$key}\@#{$breakpoint},
276
276
  #{VAR.$parent-selector} .hover\:-translate-y-#{$key}\@#{$breakpoint}:hover,
277
277
  #{VAR.$parent-selector} .group:hover .group-hover\:-translate-y-#{$key}\@#{$breakpoint} {
278
278
  @include translate-y($value);
@@ -286,6 +286,18 @@ $origin-values: (
286
286
  #{VAR.$parent-selector} .group:hover .group-hover\:scale-#{$key}\@#{$breakpoint} {
287
287
  @include scale($value);
288
288
  }
289
+
290
+ #{VAR.$parent-selector} .scale-x-#{$key}\@#{$breakpoint},
291
+ #{VAR.$parent-selector} .hover\:scale-x-#{$key}\@#{$breakpoint}:hover,
292
+ #{VAR.$parent-selector} .group:hover .group-hover\:scale-x-#{$key}\@#{$breakpoint} {
293
+ @include scale-x($value);
294
+ }
295
+
296
+ #{VAR.$parent-selector} .scale-y-#{$key}\@#{$breakpoint},
297
+ #{VAR.$parent-selector} .hover\:scale-y-#{$key}\@#{$breakpoint}:hover,
298
+ #{VAR.$parent-selector} .group:hover .group-hover\:scale-y-#{$key}\@#{$breakpoint} {
299
+ @include scale-y($value);
300
+ }
289
301
  }
290
302
 
291
303
  // Rotation hover responsive
@@ -305,6 +317,15 @@ $origin-values: (
305
317
  @include rotate($value);
306
318
  }
307
319
  }
320
+
321
+ // Add missing origin responsive variants
322
+ @each $key, $value in $origin-values {
323
+ #{VAR.$parent-selector} .origin-#{$key}\@#{$breakpoint},
324
+ #{VAR.$parent-selector} .hover\:origin-#{$key}\@#{$breakpoint}:hover,
325
+ #{VAR.$parent-selector} .group:hover .group-hover\:origin-#{$key}\@#{$breakpoint} {
326
+ @include origin($value);
327
+ }
328
+ }
308
329
  }
309
330
  }
310
331
  }
@@ -44,11 +44,11 @@ $z-index-levels: (
44
44
  "dropdown": 100,
45
45
  "sticky": 200,
46
46
  "fixed": 300,
47
- "drawer": 400,
48
- "modal": 500,
49
- "popover": 600,
50
- "tooltip": 700,
51
- "overlay": 800,
47
+ "overlay": 400,
48
+ "drawer": 500,
49
+ "modal": 600,
50
+ "popover": 700,
51
+ "tooltip": 800,
52
52
  "toast": 900,
53
53
  "max": 9999,
54
54
  );