@nuvoui/core 1.1.4 → 1.1.5

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.
@@ -42,8 +42,8 @@
42
42
 
43
43
 
44
44
  // Color Relationship Functions
45
- @function find-text-color($background) {
46
- $luminance: luminance($background);
45
+ @function find-text-color($color) {
46
+ $luminance: luminance($color);
47
47
  @return if($luminance > 0.55, #000, #fff);
48
48
  }
49
49
 
@@ -61,12 +61,12 @@
61
61
  }
62
62
 
63
63
  // Context-Aware Colors
64
- @mixin adaptive-contrast($background) {
65
- background: $background;
66
- color: find-text-color($background);
64
+ @mixin adaptive-contrast($color) {
65
+ background: $color;
66
+ color: find-text-color($color);
67
67
 
68
68
  @media (prefers-contrast: more) {
69
- $high-contrast: adjust-contrast($background, 20%);
69
+ $high-contrast: adjust-contrast($color, 20%);
70
70
 
71
71
  background: $high-contrast;
72
72
  }
@@ -1,5 +1,8 @@
1
1
  @use 'sass:string';
2
2
  @use 'sass:math';
3
+ @use 'sass:map';
4
+ @use 'sass:list';
5
+ @use 'variables' as *;
3
6
 
4
7
  @function strip-unit($value) {
5
8
  @return math.div($value, ($value * 0 + 1));
@@ -56,4 +59,126 @@
56
59
 
57
60
  // Return empty string if no unit found
58
61
  @return '';
62
+ }
63
+
64
+ @if $enable-debuger {
65
+ .NuvoUI-Debugger-Wrapper {
66
+ color: #fff;
67
+ font-family: Arial, sans-serif;
68
+ position: fixed;
69
+ z-index: 999999;
70
+ inset: 10px auto auto 10px;
71
+ pointer-events: none;
72
+
73
+ &.top-left {
74
+ inset: 10px auto auto 10px;
75
+ text-align: left;
76
+ }
77
+
78
+ &.top-right {
79
+ inset: 10px 10px auto auto;
80
+ text-align: right;
81
+ }
82
+
83
+ &.bottom-left {
84
+ inset: auto auto 10px 10px;
85
+ text-align: left;
86
+ }
87
+
88
+ &.bottom-right {
89
+ inset: auto 10px 10px auto;
90
+ text-align: right;
91
+ }
92
+
93
+ .NuvoUI-Debugger-Main, .NuvoUI-Debugger{
94
+ padding: 10px;
95
+ background-color: rgb(0 0 0 / 80%);
96
+ border-radius: 5px;
97
+ border: 1px solid green;
98
+ box-shadow: 0 0 2px 0 #fff;
99
+ pointer-events: none;
100
+ }
101
+
102
+ .NuvoUI-Debugger-Main {
103
+ $breakpoint-keys: map.keys($breakpoints);
104
+ $total: list.length($breakpoint-keys);
105
+
106
+ &::before,
107
+ &::after {
108
+ font-family: 'Courier New', Courier, monospace;
109
+ font-size: 0.8em;
110
+ display: block;
111
+ }
112
+
113
+ &::before {
114
+ font-weight: bold;
115
+ }
116
+
117
+ @for $i from 1 through $total {
118
+ $current: list.nth($breakpoint-keys, $i);
119
+ $current-width: map.get($breakpoints, $current);
120
+
121
+ @if $i == 1 {
122
+ @media (max-width: $current-width) {
123
+ &::before {
124
+ content: "Screen: #{$current}";
125
+ }
126
+ }
127
+ } @else {
128
+ $prev: list.nth($breakpoint-keys, $i - 1);
129
+ $prev-width: map.get($breakpoints, $prev);
130
+
131
+ @media (min-width: $prev-width) and (max-width: ($current-width - 1)) {
132
+ &::before {
133
+ content: "Screen: #{$current}";
134
+ }
135
+ }
136
+ }
137
+ }
138
+
139
+ &::after {
140
+ content: attr(data-size);
141
+ }
142
+ }
143
+
144
+ .NuvoUI-Debugger {
145
+ margin-top: 10px;
146
+
147
+ &::before,
148
+ &::after {
149
+ font-family: 'Courier New', Courier, monospace;
150
+ font-size: 0.8em;
151
+ display: block;
152
+ }
153
+
154
+ &::before {
155
+ font-weight: bold;
156
+ content: attr(data-element);
157
+ }
158
+
159
+ &::after {
160
+ content: attr(data-size);
161
+ }
162
+ }
163
+
164
+ .NuvoUI-Debugger-Close {
165
+ color: #fff;
166
+ cursor: pointer;
167
+ font-size: 14px;
168
+ pointer-events: auto;
169
+ position: absolute;
170
+ right: 0;
171
+ top: 0;
172
+ background: #00800199;
173
+ border-radius: 20px;
174
+ height: 14px;
175
+ width: 14px;
176
+ line-height: 14px;
177
+ text-align: center;
178
+
179
+ &:hover {
180
+ background: #008001;
181
+ }
182
+ }
183
+ }
59
184
  }
@@ -28,8 +28,28 @@
28
28
  }
29
29
 
30
30
  @mixin media-between($lower, $upper) {
31
- @if map.has-key($breakpoints, $lower) and map.has-key($breakpoints, $upper) {
32
- @media screen and (min-width: map.get($breakpoints, $lower)) and (max-width: (map.get($breakpoints, $upper) - 0.02px)) {
31
+
32
+ $-lower: null;
33
+ $-upper: null;
34
+
35
+ @if map.has-key($breakpoints, $lower) {
36
+ $-lower: map.get($breakpoints, $lower);
37
+ } @else if meta.type-of($lower) == number {
38
+ $-lower: $lower - 0.02px;
39
+ } @else {
40
+ @warn 'Unknown lower breakpoint: #{$lower}';
41
+ }
42
+
43
+ @if map.has-key($breakpoints, $upper) {
44
+ $-upper: map.get($breakpoints, $upper);
45
+ } @else if meta.type-of($upper) == number {
46
+ $-upper: $upper - 0.02px;
47
+ } @else {
48
+ @warn 'Unknown uppper breakpoint: #{$upper}';
49
+ }
50
+
51
+ @if $-lower and $-upper {
52
+ @media screen and (min-width: $-lower) and (max-width: $-upper) {
33
53
  @content;
34
54
  }
35
55
  }
@@ -80,17 +100,13 @@
80
100
  }
81
101
  }
82
102
 
83
- // Modern feature detection
84
103
  // Example: @include supports(display: grid) { }
85
104
  @mixin supports($property) {
86
- @supports #{$property} {
105
+ @supports (#{$property}) {
87
106
  @content;
88
107
  }
89
108
  }
90
109
 
91
-
92
-
93
-
94
110
  // Mixin: Dark Mode
95
111
  // Applies styles when the user prefers a dark color scheme.
96
112
  @mixin dark-mode {
@@ -41,10 +41,10 @@
41
41
  @each $i in $percentages {
42
42
  .w-#{$i}per { @include width-percent($i); }
43
43
  .h-#{$i}per { @include height-percent($i); }
44
- .min-w-#{$i} { @include min-width-percent($i); }
45
- .min-h-#{$i} { @include min-height-percent($i); }
46
- .max-w-#{$i} { @include max-width-percent($i); }
47
- .max-h-#{$i} { @include max-height-percent($i); }
44
+ .min-w-#{$i}per { @include min-width-percent($i); }
45
+ .min-h-#{$i}per { @include min-height-percent($i); }
46
+ .max-w-#{$i}per { @include max-width-percent($i); }
47
+ .max-h-#{$i}per { @include max-height-percent($i); }
48
48
  }
49
49
 
50
50
  // Generate utilities from spacing map
@@ -62,6 +62,12 @@
62
62
  @media (min-width: $width) {
63
63
  // Generate utilities from spacing map
64
64
  @each $i in $spacings {
65
+ .w-#{$i}per\@#{$breakpoint} { @include width-percent($i); }
66
+ .h-#{$i}per\@#{$breakpoint} { @include height-percent($i); }
67
+ .min-w-#{$i}per\@#{$breakpoint} { @include min-width-percent($i); }
68
+ .min-h-#{$i}per\@#{$breakpoint} { @include min-height-percent($i); }
69
+ .max-w-#{$i}per\@#{$breakpoint} { @include max-width-percent($i); }
70
+ .max-h-#{$i}per\@#{$breakpoint} { @include max-height-percent($i); }
65
71
  .w-#{$i}\@#{$breakpoint} { @include width($i); }
66
72
  .h-#{$i}\@#{$breakpoint} { @include height($i); }
67
73
  .min-w-#{$i}\@#{$breakpoint} { @include min-width($i) }
@@ -1,6 +1,7 @@
1
1
  @use 'sass:map';
2
2
 
3
3
  // Global variables that might be used across different modules
4
+ $enable-debuger: false !default;
4
5
  $enable-dark-mode: true !default;
5
6
  $enable-rtl: true !default;;
6
7
  $enable-reduced-motion: true !default;;
@@ -36,20 +37,20 @@ $theme-tokens: (
36
37
 
37
38
  // Default theme config (can be overridden)
38
39
  $light-theme: (
39
- 'background': #ffffff,
40
- 'foreground': #000000,
41
- 'surface': #ffffff,
40
+ 'background': #fff,
41
+ 'foreground': #000,
42
+ 'surface': #fff,
42
43
  'border': #e5e7eb,
43
- 'text-primary': #000000,
44
+ 'text-primary': #000,
44
45
  'text-secondary': #4b5563
45
46
  ) !default;
46
47
 
47
48
  $dark-theme: (
48
- 'background': #000000,
49
- 'foreground': #ffffff,
49
+ 'background': #000,
50
+ 'foreground': #fff,
50
51
  'surface': #1a1a1a,
51
52
  'border': #2e2e2e,
52
- 'text-primary': #ffffff,
53
+ 'text-primary': #fff,
53
54
  'text-secondary': #a3a3a3
54
55
  ) !default;
55
56