@nuvoui/core 0.3.1 → 1.0.1

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,29 +1,25 @@
1
- @use "sass:math";
2
- @use 'sass:color';
3
- @use 'sass:map';
4
1
 
5
2
  @use './variables' as *;
6
3
 
7
-
8
-
9
4
  // Display Mixins
10
5
  @mixin d-none { display: none; }
11
6
  @mixin d-block { display: block; }
12
7
  @mixin d-inline { display: inline; }
13
8
  @mixin d-inline-block { display: inline-block; }
14
- @mixin d-table { display: table; }
15
- @mixin d-table-row { display: table-row; }
16
- @mixin d-table-cell { display: table-cell; }
9
+ @mixin d-tbl { display: table; }
10
+ @mixin d-tbl-row { display: table-row; }
11
+ @mixin d-tbl-cell { display: table-cell; }
17
12
 
18
- // Base Classes
13
+ // Base Classes
19
14
  .hide { @include d-none; }
20
15
  .block { @include d-block; }
21
16
  .inline { @include d-inline; }
22
17
  .inline-block { @include d-inline-block; }
18
+
23
19
  .d {
24
- &-table { @include d-table; }
25
- &-table-row { @include d-table-row; }
26
- &-table-cell { @include d-table-cell; }
20
+ &-tbl { @include d-tbl; }
21
+ &-tbl-row { @include d-tbl-row; }
22
+ &-tbl-cell { @include d-tbl-cell; }
27
23
  }
28
24
 
29
25
  // Responsive Variants
@@ -33,10 +29,11 @@
33
29
  .block\@#{$breakpoint} { @include d-block; }
34
30
  .inline\@#{$breakpoint} { @include d-inline; }
35
31
  .inline-block\@#{$breakpoint} { @include d-inline-block; }
32
+
36
33
  .d {
37
- &-table\@#{$breakpoint} { @include d-table; }
38
- &-table-row\@#{$breakpoint} { @include d-table-row; }
39
- &-table-cell\@#{$breakpoint} { @include d-table-cell; }
34
+ &-tbl\@#{$breakpoint} { @include d-tbl; }
35
+ &-tbl-row\@#{$breakpoint} { @include d-tbl-row; }
36
+ &-tbl-cell\@#{$breakpoint} { @include d-tbl-cell; }
40
37
  }
41
38
  }
42
39
  }
@@ -29,8 +29,7 @@
29
29
 
30
30
  @mixin media-between($lower, $upper) {
31
31
  @if map.has-key($breakpoints, $lower) and map.has-key($breakpoints, $upper) {
32
- @media screen and (min-width: map.get($breakpoints, $lower)) and
33
- (max-width: (map.get($breakpoints, $upper) - 0.02px)) {
32
+ @media screen and (min-width: map.get($breakpoints, $lower)) and (max-width: (map.get($breakpoints, $upper) - 0.02px)) {
34
33
  @content;
35
34
  }
36
35
  }
@@ -43,13 +42,13 @@
43
42
  $next-breakpoint: null;
44
43
 
45
44
  @each $name, $width in $breakpoints {
46
- @if $width > $min and ($next-breakpoint == null or $width < $next-breakpoint) {
45
+ @if $width > $min and (meta.type-of($next-breakpoint) == 'null' or $width < $next-breakpoint) {
47
46
  $next-breakpoint: $width;
48
47
  }
49
48
  }
50
49
 
51
50
  @if $next-breakpoint {
52
- @media (min-width: $min) and (max-width: $next-breakpoint - 1) {
51
+ @media (min-width: $min) and (max-width: ($next-breakpoint - 1)) {
53
52
  @content;
54
53
  }
55
54
  } @else {
@@ -81,13 +80,6 @@
81
80
  }
82
81
  }
83
82
 
84
- // Retina displays
85
- @mixin retina {
86
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
87
- @content;
88
- }
89
- }
90
-
91
83
  // Modern feature detection
92
84
  // Example: @include supports(display: grid) { }
93
85
  @mixin supports($property) {
@@ -96,21 +88,11 @@
96
88
  }
97
89
  }
98
90
 
99
- // Reduced motion preference
100
- @mixin reduced-motion {
101
- @media (prefers-reduced-motion: reduce) {
102
- @content;
103
- }
104
- }
105
91
 
106
- // High contrast mode
107
- @mixin high-contrast {
108
- @media (forced-colors: active) {
109
- @content;
110
- }
111
- }
112
92
 
113
- // Dark mode
93
+
94
+ // Mixin: Dark Mode
95
+ // Applies styles when the user prefers a dark color scheme.
114
96
  @mixin dark-mode {
115
97
  @media (prefers-color-scheme: dark) {
116
98
  @content;
@@ -130,32 +112,9 @@
130
112
  }
131
113
  }
132
114
 
133
- // Modern hover capabilities
134
- @mixin hover-device {
135
- @media (hover: hover) and (pointer: fine) {
136
- @content;
137
- }
138
- }
139
-
140
115
  // Modern aspect ratio
141
116
  @mixin aspect-ratio($ratio) {
142
- @supports (aspect-ratio: #{$ratio}) {
143
- aspect-ratio: #{$ratio};
144
- }
145
-
146
- @supports not (aspect-ratio: #{$ratio}) {
147
- &::before {
148
- float: left;
149
- padding-top: percentage(1 / $ratio);
150
- content: '';
151
- }
152
-
153
- &::after {
154
- display: block;
155
- content: '';
156
- clear: both;
157
- }
158
- }
117
+ aspect-ratio: #{$ratio};
159
118
  }
160
119
 
161
120
  // Dynamic viewport units (modern browsers)
@@ -174,11 +133,15 @@
174
133
  #{$property}: env(safe-area-inset-#{$position});
175
134
  }
176
135
 
177
- // Color scheme transition
178
- @mixin color-scheme-transition {
179
- @media (prefers-reduced-motion: no-preference) {
180
- transition: background-color 0.3s ease, color 0.3s ease;
136
+ @mixin reduced-motion {
137
+ @media (prefers-reduced-motion: reduce) {
138
+ @content;
181
139
  }
182
140
  }
183
141
 
184
-
142
+ // High contrast mode
143
+ @mixin high-contrast {
144
+ @media (forced-colors: active) {
145
+ @content;
146
+ }
147
+ }
@@ -0,0 +1,20 @@
1
+ // _spacing.scss
2
+
3
+ @use 'sass:math';
4
+ @use './variables' as *;
5
+
6
+ // Opacity Utilities
7
+ @each $i in $percentages {
8
+ .opacity-#{$i} { opacity: math.div($i, 100); }
9
+ .hover\:opacity-#{$i}:hover { opacity: math.div($i, 100); }
10
+ }
11
+
12
+ // Responsive Variants for Opacity
13
+ @each $breakpoint, $width in $breakpoints {
14
+ @media (min-width: $width) {
15
+ @each $i in $percentages {
16
+ .opacity-#{$i}\@#{$breakpoint} { opacity: math.div($i, 100); }
17
+ .hover\:opacity-#{$i}\@#{$breakpoint}:hover { opacity: math.div($i, 100); }
18
+ }
19
+ }
20
+ }
@@ -1,63 +1,66 @@
1
1
  @use './variables' as *;
2
+
2
3
  // Position Mixins
3
- @mixin p-static {
4
+ @mixin static {
4
5
  position: static;
5
6
  }
6
7
 
7
- @mixin p-relative {
8
+ @mixin relative {
8
9
  position: relative;
9
10
  }
10
11
 
11
- @mixin p-absolute {
12
+ @mixin absolute {
12
13
  position: absolute;
13
14
  }
14
15
 
15
- @mixin p-fixed {
16
+ @mixin fixed {
16
17
  position: fixed;
17
- }
18
-
19
- @mixin p-sticky {
18
+ }
19
+
20
+ @mixin sticky {
20
21
  position: sticky;
21
- }
22
+ z-index: 999;
23
+ top: 0;
24
+ }
22
25
 
23
26
  // Position Classes
24
- .p-static {
25
- @include p-static;
27
+ .static {
28
+ @include static;
26
29
  }
27
30
 
28
- .p-relative {
29
- @include p-relative;
31
+ .relative {
32
+ @include relative;
30
33
  }
31
34
 
32
- .p-absolute {
33
- @include p-absolute;
35
+ .absolute {
36
+ @include absolute;
34
37
  }
35
38
 
36
- .p-fixed {
37
- @include p-fixed;
39
+ .fixed {
40
+ @include fixed;
38
41
  }
39
42
 
40
- .p-sticky {
41
- @include p-sticky;
43
+ .sticky {
44
+ @include sticky;
42
45
  }
43
46
 
44
47
  // Responsive Position Classes
45
48
  @each $breakpoint, $width in $breakpoints {
46
49
  @media (min-width: $width) {
47
- .p-static\@#{$breakpoint} {
48
- @include p-static;
50
+ .static\@#{$breakpoint} {
51
+ @include static;
49
52
  }
50
- .p-relative\@#{$breakpoint} {
51
- @include p-relative;
53
+ .relative\@#{$breakpoint} {
54
+ @include relative;
52
55
  }
53
- .p-absolute\@#{$breakpoint} {
54
- @include p-absolute;
56
+ .absolute\@#{$breakpoint} {
57
+ @include absolute;
55
58
  }
56
- .p-fixed\@#{$breakpoint} {
57
- @include p-fixed;
59
+ .fixed\@#{$breakpoint} {
60
+ @include fixed;
58
61
  }
59
- .p-sticky\@#{$breakpoint} {
60
- @include p-sticky;
62
+ .sticky\@#{$breakpoint} {
63
+ @include sticky;
61
64
  }
62
65
  }
63
66
  }
@@ -81,17 +84,23 @@
81
84
  }
82
85
 
83
86
  // Top, Right, Bottom, Left Classes
84
- @for $i from 0 through 100{
85
- .top-#{$i} {
86
- @include top($i);
87
- }
88
- .right-#{$i} {
89
- @include right($i);
90
- }
91
- .bottom-#{$i} {
92
- @include bottom($i);
93
- }
94
- .left-#{$i} {
95
- @include left($i);
87
+ @each $i in $spacings {
88
+ .top-#{$i} {@include top($i);}
89
+ .right-#{$i} {@include right($i);}
90
+ .bottom-#{$i} {@include bottom($i);}
91
+ .left-#{$i} {@include left($i);}
92
+ }
93
+
94
+
95
+ // Pixel widths based on spacing scale
96
+ @each $breakpoint, $width in $breakpoints {
97
+ @media (min-width: $width) {
98
+ // Generate utilities from spacing map
99
+ @each $i in $spacings {
100
+ .top-#{$i}\@#{$breakpoint} {height: if($i == 0, $i, $i + px);}
101
+ .right-#{$i}\@#{$breakpoint} {width: if($i == 0, $i, $i + px);}
102
+ .bottom-#{$i}\@#{$breakpoint} {min-width: if($i == 0, $i, $i + px);}
103
+ .left-#{$i}\@#{$breakpoint} {min-height: if($i == 0, $i, $i + px);}
104
+ }
96
105
  }
97
106
  }
@@ -7,10 +7,10 @@
7
7
 
8
8
  // Shadow Variables
9
9
  $shadow-colors: (
10
- 'default': rgba(0, 0, 0, 0.1),
11
- 'dark': rgba(0, 0, 0, 0.2),
12
- 'darker': rgba(0, 0, 0, 0.35),
13
- 'darkest': rgba(0, 0, 0, 0.5),
10
+ 'default': rgb(0 0 0 / 10%),
11
+ 'dark': rgb(0 0 0 / 20%),
12
+ 'darker': rgb(0 0 0 / 35%),
13
+ 'darkest': rgb(0 0 0 / 50%),
14
14
  );
15
15
 
16
16
  $shadow-sizes: (
@@ -60,7 +60,6 @@ $shadow-sizes: (
60
60
 
61
61
  @mixin shadow($size: 'md', $color: 'default') {
62
62
  $shadow: map.get($shadow-sizes, $size);
63
-
64
63
  $shadow-color: map.get($shadow-colors, $color);
65
64
  @include shadow-base(
66
65
  map.get($shadow, 'x'),
@@ -0,0 +1,73 @@
1
+ // _spacing.scss
2
+
3
+ @use 'sass:math';
4
+ @use './variables' as *;
5
+
6
+ @mixin width($value) { width: if($value == 0, $value, $value + px); }
7
+ @mixin height($value) { height: if($value == 0, $value, $value + px); }
8
+ @mixin min-width($value) { min-width: if($value == 0, $value, $value + px); }
9
+ @mixin min-height($value) { min-height: if($value == 0, $value, $value + px); }
10
+ @mixin max-width($value) { max-width: if($value == 0, $value, $value + px); }
11
+ @mixin max-height($value) { max-height: if($value == 0, $value, $value + px); }
12
+
13
+ @mixin width-percent($i) { width: #{$i + '%'}; }
14
+ @mixin height-percent($i) { height: #{$i + '%'}; }
15
+ @mixin min-width-percent($i) { min-width: #{$i + '%'}; }
16
+ @mixin min-height-percent($i) { min-height: #{$i + '%'}; }
17
+ @mixin max-width-percent($i) { max-width: #{$i + '%'}; }
18
+ @mixin max-height-percent($i) { max-height: #{$i + '%'}; }
19
+
20
+
21
+ @mixin w-auto { width: auto; }
22
+ @mixin w-full { width: 100%; }
23
+ @mixin h-auto { height: auto; }
24
+ @mixin h-full { height: 100%; }
25
+ @mixin min-w-full { min-width: 100%; }
26
+ @mixin max-w-full { max-width: 100%; }
27
+ @mixin min-h-full { min-height: 100%; }
28
+ @mixin max-h-full { max-height: 100%; }
29
+
30
+ :not(.flex)>.w-auto { @include w-auto; }
31
+ :not(.flex)>.w-full { @include w-full; }
32
+
33
+ .h-auto { @include h-auto; }
34
+ .h-full { @include h-full; }
35
+ .min-w-full { @include min-w-full }
36
+ .max-w-full { @include max-w-full }
37
+ .min-h-full { @include min-h-full }
38
+ .max-h-full { @include max-h-full }
39
+
40
+ // Percentage widths
41
+ @each $i in $percentages {
42
+ .w-#{$i}per { @include width-percent($i); }
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); }
48
+ }
49
+
50
+ // Generate utilities from spacing map
51
+ @each $i in $spacings {
52
+ .w-#{$i} { @include width($i); }
53
+ .h-#{$i} { @include height($i); }
54
+ .min-w-#{$i} { @include min-width($i) }
55
+ .min-h-#{$i} { @include min-height($i) }
56
+ .max-w-#{$i} { @include max-width($i) }
57
+ .max-h-#{$i} { @include max-height($i) }
58
+ }
59
+
60
+ // Pixel widths based on spacing scale
61
+ @each $breakpoint, $width in $breakpoints {
62
+ @media (min-width: $width) {
63
+ // Generate utilities from spacing map
64
+ @each $i in $spacings {
65
+ .w-#{$i}\@#{$breakpoint} { @include width($i); }
66
+ .h-#{$i}\@#{$breakpoint} { @include height($i); }
67
+ .min-w-#{$i}\@#{$breakpoint} { @include min-width($i) }
68
+ .min-h-#{$i}\@#{$breakpoint} { @include min-height($i) }
69
+ .max-w-#{$i}\@#{$breakpoint} { @include max-width($i) }
70
+ .max-h-#{$i}\@#{$breakpoint} { @include max-height($i) }
71
+ }
72
+ }
73
+ }
@@ -1,27 +1,46 @@
1
- // _spacing.scss
2
-
3
1
  @use 'sass:math';
4
2
  @use './variables' as *;
5
3
 
6
4
 
7
5
  // Padding mixins
8
- @mixin p($val) { $val: if($val==0, $val, $val + px); padding: $val !important; }
9
- @mixin px($val) { $val: if($val==0, $val, $val + px); padding-left: $val !important; padding-right: $val !important; }
10
- @mixin py($val) { $val: if($val==0, $val, $val + px); padding-top: $val !important; padding-bottom: $val !important; }
11
- @mixin pt($val) { $val: if($val==0, $val, $val + px); padding-top: $val !important; }
12
- @mixin pr($val) { $val: if($val==0, $val, $val + px); padding-right: $val !important; }
13
- @mixin pb($val) { $val: if($val==0, $val, $val + px); padding-bottom: $val !important; }
14
- @mixin pl($val) { $val: if($val==0, $val, $val + px); padding-left: $val !important; }
6
+ @mixin p($val) { $val: if($val == 0, $val, $val + px); padding: $val !important; }
7
+ @mixin px($val) { $val: if($val == 0, $val, $val + px); padding-left: $val !important; padding-right: $val !important; }
8
+ @mixin py($val) { $val: if($val == 0, $val, $val + px); padding-top: $val !important; padding-bottom: $val !important; }
9
+ @mixin pt($val) { $val: if($val == 0, $val, $val + px); padding-top: $val !important; }
10
+ @mixin pr($val) { $val: if($val == 0, $val, $val + px); padding-right: $val !important; }
11
+ @mixin pb($val) { $val: if($val == 0, $val, $val + px); padding-bottom: $val !important; }
12
+ @mixin pl($val) { $val: if($val == 0, $val, $val + px); padding-left: $val !important; }
15
13
 
16
14
  // Margin mixins
17
- @mixin m($val) { $val: if($val==0, $val, $val + px); margin: $val !important; }
18
- @mixin mx($val) { $val: if($val==0, $val, $val + px); margin-left: $val !important; margin-right: $val !important; }
19
- @mixin my($val) { $val: if($val==0, $val, $val + px); margin-top: $val !important; margin-bottom: $val !important; }
20
- @mixin mt($val) { $val: if($val==0, $val, $val + px); margin-top: $val !important; }
21
- @mixin mr($val) { $val: if($val==0, $val, $val + px); margin-right: $val !important; }
22
- @mixin mb($val) { $val: if($val==0, $val, $val + px); margin-bottom: $val !important; }
23
- @mixin ml($val) { $val: if($val==0, $val, $val + px); margin-left: $val !important; }
15
+ @mixin m($val) { $val: if($val == 0, $val, $val + px); margin: $val !important; }
16
+ @mixin mx($val) { $val: if($val == 0, $val, $val + px); margin-left: $val !important; margin-right: $val !important; }
17
+ @mixin my($val) { $val: if($val == 0, $val, $val + px); margin-top: $val !important; margin-bottom: $val !important; }
18
+ @mixin mt($val) { $val: if($val == 0, $val, $val + px); margin-top: $val !important; }
19
+ @mixin mr($val) { $val: if($val == 0, $val, $val + px); margin-right: $val !important; }
20
+ @mixin mb($val) { $val: if($val == 0, $val, $val + px); margin-bottom: $val !important; }
21
+ @mixin ml($val) { $val: if($val == 0, $val, $val + px); margin-left: $val !important; }
22
+
23
+ // Auto margin utilities
24
+ @mixin ml-auto { margin-left: auto; }
25
+ @mixin mr-auto { margin-right: auto; }
26
+ @mixin mx-auto { @include ml-auto; @include mr-auto; }
27
+
28
+ // Spacing map
29
+ @mixin space-y($i) { & > * + * { margin-top: if($i == 0, 0, $i + px); } }
30
+ @mixin space-x($i) { & > * + * { margin-left: if($i == 0, 0, $i + px); } }
31
+
32
+
33
+ // Gap Mixins
34
+ @mixin gap($value) { gap: if($value == 0, $value, $value + px); }
35
+ @mixin gap-x($value) { column-gap: if($value == 0, $value, $value + px); }
36
+ @mixin gap-y($value) { row-gap: if($value == 0, $value, $value + px); }
37
+
38
+ .mx-auto { @include mx-auto; }
39
+ .ml-auto { @include ml-auto; }
40
+ .mr-auto { @include mr-auto; }
24
41
 
42
+ // Gap Classes
43
+ .gap-auto { gap: auto; }
25
44
 
26
45
  // Generate utilities from spacing map
27
46
  @each $i in $spacings {
@@ -42,13 +61,25 @@
42
61
  .mr-#{$i} { @include mr($i); }
43
62
  .mb-#{$i} { @include mb($i); }
44
63
  .ml-#{$i} { @include ml($i); }
45
- // .gap-#{$key} { gap: $value; }
64
+
65
+ // Gap classes
66
+ .gap-#{$i} { @include gap($i); }
67
+ .gap-x-#{$i} { @include gap-x($i); }
68
+ .gap-y-#{$i} { @include gap-y($i); }
69
+
70
+ // Space classes
71
+ .space-x-#{$i} { @include space-x($i); }
72
+ .space-y-#{$i} { @include space-y($i); }
46
73
  }
47
74
 
48
75
 
49
76
  // Responsive Position Classes
50
77
  @each $breakpoint, $width in $breakpoints {
51
78
  @media (min-width: $width) {
79
+ .mx-auto\@#{$breakpoint} { @include mx-auto; }
80
+ .ml-auto\@#{$breakpoint} { @include ml-auto; }
81
+ .mr-auto\@#{$breakpoint} { @include mr-auto; }
82
+
52
83
  // Generate utilities from spacing map
53
84
  @each $i in $spacings {
54
85
  // Padding classes
@@ -68,52 +99,15 @@
68
99
  .mr-#{$i}\@#{$breakpoint} { @include mr($i); }
69
100
  .mb-#{$i}\@#{$breakpoint} { @include mb($i); }
70
101
  .ml-#{$i}\@#{$breakpoint} { @include ml($i); }
71
- }
72
- }
73
- }
74
102
 
75
- // Auto margin utilities
76
- @mixin ml-auto { margin-left: auto; }
77
- @mixin mr-auto { margin-right: auto; }
78
- @mixin mx-auto { @include ml-auto; @include mr-auto; }
79
-
80
- .mx-auto { @include mx-auto; }
81
-
82
-
83
- .ml-auto { @include ml-auto; }
84
- .mr-auto { @include mr-auto; }
85
-
86
-
87
-
88
- // Gap Mixins
89
- @mixin gap($value) {
90
- gap: if($value == 0, $value, $value + px);
91
- }
92
-
93
- @mixin gap-x($value) {
94
- column-gap: if($value == 0, $value, $value + px);
95
- }
96
-
97
- @mixin gap-y($value) {
98
- row-gap: if($value == 0, $value, $value + px);
99
- }
100
-
101
- // Gap Classes
102
- .gap-auto { gap: auto; }
103
-
104
- @each $i in $spacings {
105
- .gap-#{$i} { @include gap($i); }
106
- .gap-x-#{$i} { @include gap-x($i); }
107
- .gap-y-#{$i} { @include gap-y($i); }
108
- }
109
-
110
- // Responsive Gap Classes
111
- @each $breakpoint, $width in $breakpoints {
112
- @media (min-width: $width) {
113
- @each $i in $spacings {
114
- .gap-#{$i}\@#{$breakpoint} { gap: $i; }
115
- .gap-x-#{$i}\@#{$breakpoint} { column-gap: $i; }
116
- .gap-y-#{$i}\@#{$breakpoint} { row-gap: $i; }
103
+ .gap-#{$i}\@#{$breakpoint} { gap: $i; }
104
+ .gap-x-#{$i}\@#{$breakpoint} { column-gap: $i; }
105
+ .gap-y-#{$i}\@#{$breakpoint} { row-gap: $i; }
106
+
107
+
108
+ // Space classes
109
+ .space-x-#{$i}\@#{$breakpoint} { @include space-x($i); }
110
+ .space-y-#{$i}\@#{$breakpoint} { @include space-y($i); }
111
+ }
117
112
  }
118
- }
119
113
  }