@nuvoui/core 1.2.3 → 1.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvoui/core",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
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",
@@ -75,16 +75,15 @@
75
75
  "last 2 versions",
76
76
  "not dead"
77
77
  ],
78
-
79
78
  "devDependencies": {
80
79
  "cssnano": "^7.0.6",
81
- "postcss": "^8.4.49",
82
- "postcss-cli": "^11.0.0",
80
+ "postcss": "^8.5.3",
81
+ "postcss-cli": "^11.0.1",
83
82
  "postcss-import": "^16.1.0",
84
83
  "postcss-nested": "^7.0.2",
85
- "prettier": "^3.3.3",
86
- "sass": "^1.81.0",
87
- "stylelint": "^16.10.0",
84
+ "prettier": "^3.5.3",
85
+ "sass": "^1.85.1",
86
+ "stylelint": "^16.16.0",
88
87
  "stylelint-config-standard-scss": "^13.1.0"
89
88
  },
90
89
  "peerDependencies": {
@@ -5,32 +5,20 @@
5
5
  $generate-utility-classes: true !default;
6
6
  $enable-dark-mode: true !default;
7
7
  $enable-rtl: true !default;
8
- $enable-reduced-motion: true !default;
9
- $enable-container-queries: false !default;
8
+ $enable-debugger: false !default; // todo: spell mistake
9
+ $enable-reduced-motion: true !default; // todo: pending
10
+ $enable-container-queries: false !default; // todo: pending
10
11
 
11
- $base-size: 16;
12
-
13
- @function rem($px) {
14
- @if $px == 0 {
15
- @return 0;
16
- }
17
-
18
- // Strip units if $px has any
19
- $value: if(math.unit($px) == "", $px, math.div($px, math.unit($px)));
20
-
21
- @return math.div($value, $base-size) * 1rem;
22
- }
12
+ // Text
13
+ $base-size: 16 !default;
14
+ $font-family: system-ui, -apple-system, "BlinkMacSystemFont", 'Segoe UI', "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif !default;
23
15
 
24
16
  // Global variables that might be used across different modules
25
- $enable-debuger: false !default;
26
- $enable-dark-mode: true !default;
27
- $enable-rtl: true !default;
28
- $enable-reduced-motion: true !default;
29
- $column-count: 12 !default;
17
+ $column-count: 12 !default; // todo: pending
30
18
 
31
- $default-container-name: nuvoui-container !default;
32
- $nuvoui-container-queries: false !default;
19
+ $default-container-name: nuvoui-container !default; // todo: pending
33
20
 
21
+ // Accessible color palette
34
22
  $primary: #007bff !default;
35
23
  $secondary: #6c757d !default;
36
24
  $success: #28a745 !default;
@@ -38,6 +26,7 @@ $danger: #dc3545 !default;
38
26
  $warning: #ffc107 !default;
39
27
  $info: #17a2b8 !default;
40
28
 
29
+ // Color palette
41
30
  $color-primitives: (
42
31
  "gray": #6b7280,
43
32
  "red": #ef4444,
@@ -96,44 +85,55 @@ $grid-item-sizes: (
96
85
 
97
86
  // _variables.scss
98
87
  $font-sizes: (
99
- // 12px
100
- "xs": 0.75rem,
101
- // 14px
102
- "sm": 0.875rem,
103
- // 16px
104
- "md": 1rem,
105
- // 20px
106
- "lg": 1.25rem,
107
- // 24px
108
- "xl": 1.5rem,
109
- // 28px
110
- "2xl": 1.75rem,
111
- // 32px
112
- "3xl": 2rem,
113
- // 40px
114
- "4xl": 2.5rem
88
+ "xs": 0.75rem, // 12px
89
+ "sm": 0.875rem, // 14px
90
+ "md": 1rem, // 16px
91
+ "lg": 1.25rem, // 20px
92
+ "xl": 1.5rem, // 24px
93
+ "2xl": 1.75rem, // 28px
94
+ "3xl": 2rem, // 32px
95
+ "4xl": 2.5rem // 40px
115
96
  ) !default;
116
97
 
117
98
  // Updated spacing map
118
99
  $spacings: (
119
100
  0: 0,
120
- 1: 0.25rem, // 4px
121
- 2: 0.5rem, // 8px
122
- 3: 0.75rem, // 12px
123
- 4: 1rem, // 16px
124
- 5: 1.25rem, // 20px
125
- 6: 1.5rem, // 24px
126
- 8: 2rem, // 32px
127
- 10: 2.5rem, // 40px
128
- 12: 3rem, // 48px
129
- 16: 4rem, // 64px
130
- 20: 5rem, // 80px
131
- 24: 6rem, // 96px
132
- 32: 8rem, // 128px
133
- 40: 10rem,
134
- 48: 12rem,
135
- 56: 14rem,
136
- 64: 16rem,
101
+ 1: 0.25rem, // 4px
102
+ 2: 0.5rem, // 8px
103
+ 3: 0.75rem, // 12px
104
+ 4: 1rem, // 16px
105
+ 5: 1.25rem, // 20px
106
+ 6: 1.5rem, // 24px
107
+ 8: 2rem, // 32px
108
+ 10: 2.5rem, // 40px
109
+ 12: 3rem, // 48px
110
+ 16: 4rem, // 64px
111
+ 20: 5rem, // 80px
112
+ 24: 6rem, // 96px
113
+ 32: 8rem, // 128px
114
+ 40: 10rem, // 160px
115
+ 48: 12rem, // 192px
116
+ 56: 14rem, // 224px
117
+ 64: 16rem, // 256px
137
118
  ) !default;
138
119
 
139
120
  $percentages: (0, 5, 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90, 100) !default;
121
+
122
+
123
+ // if just a number passed, it will be assumed as px
124
+ $default-unit: px !default;
125
+
126
+ // Common border width values that are most useful
127
+ $border-widths: (0, 1, 2, 4, 8) !default;
128
+
129
+ // Common border radius values that are most useful
130
+ $border-radii: (
131
+ 'xs': 0.25rem,
132
+ 'sm': 0.375rem,
133
+ 'md': 0.5rem,
134
+ 'lg': 0.75rem,
135
+ 'xl': 1rem,
136
+ '2xl': 1.25rem,
137
+ 'full': 9999px,
138
+ 'none': 0
139
+ ) !default;
@@ -79,3 +79,76 @@
79
79
  // Return empty string if no unit found
80
80
  @return "";
81
81
  }
82
+
83
+ /**
84
+ * Ensures a value has a unit, adding $default-unit if none exists
85
+ * @param {Number|String} $val - The value to check
86
+ * @return {String} - The value with units
87
+ */
88
+ @function fix-units($val, $unit: $default-unit) {
89
+
90
+ @if meta.type-of($val) != number and meta.type-of($val) != string{
91
+ @error "fix-units() requires a number or string value";
92
+ @return null;
93
+ }
94
+
95
+ @if meta.type-of($val) == number {
96
+ @if string.length(math.unit($val)) == 0 {
97
+ @return string.unquote($val + $unit);
98
+ }
99
+ @return $val;
100
+ }
101
+
102
+ $val: strip-quotes($val);
103
+
104
+ @if $val == auto or $val == inherit or $val == initial or
105
+ $val == 'min-content' or $val == 'max-content' or $val == 'fit-content' {
106
+ @return string.unquote($val);
107
+ }
108
+
109
+ @if string.index($val, "px") or string.index($val, "em") or string.index($val, "rem") or
110
+ string.index($val, "%") or string.index($val, "vh") or string.index($val, "vw") or
111
+ string.index($val, "vmin") or string.index($val, "vmax") {
112
+ @return string.unquote($val);
113
+ }
114
+
115
+ @return string.unquote($val) + $unit;
116
+ }
117
+
118
+
119
+ @function strip-quotes($string) {
120
+ @if meta.type-of($string) == string {
121
+ @if string.slice($string, 1, 1) == '"' and string.slice($string, -1) == '"' {
122
+ @return string.slice($string, 2, -2);
123
+ } @else if string.slice($string, 1, 1) == "'" and string.slice($string, -1) == "'" {
124
+ @return string.slice($string, 2, -2);
125
+ }
126
+ }
127
+
128
+ @return $string;
129
+ }
130
+
131
+ @function str-trim($string) {
132
+ @while string.length($string) > 0 and string.slice($string, 1, 1) == " " {
133
+ $string: string.slice($string, 2);
134
+ }
135
+
136
+ @while string.length($string) > 0 and string.slice($string, -1) == " " {
137
+ $string: string.slice($string, 1, string.length($string) - 1);
138
+ }
139
+
140
+ @return $string;
141
+ }
142
+
143
+ @function split($string, $delimiter) {
144
+ $result: ();
145
+ $index: string.index($string, $delimiter);
146
+ @while $index != null {
147
+ $item: string.slice($string, 1, $index - 1);
148
+ $result: list.append($result, str-trim(string.unquote(strip-quotes($item))));
149
+ $string: string.slice($string, $index + string.length($delimiter));
150
+ $index: string.index($string, $delimiter);
151
+ }
152
+
153
+ @return list.append($result, str-trim($string));
154
+ }
@@ -1,2 +1 @@
1
1
  @forward "config";
2
- @forward "functions";
@@ -5,13 +5,12 @@
5
5
  @use '../utilities/media-queries' as media;
6
6
 
7
7
  :root {
8
- --font-family-base: system-ui, -apple-system, "BlinkMacSystemFont", 'Segoe UI', "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
8
+ --font-family-base: #{$font-family};
9
9
  }
10
10
 
11
11
  // Base typography styles
12
12
  html {
13
- font-size: 16px;
14
- font-family: var(--font-family-base);
13
+ font-size: $base-size;
15
14
  }
16
15
 
17
16
  body {
@@ -19,7 +18,6 @@ body {
19
18
  font-weight: 400;
20
19
  line-height: 1.5;
21
20
  color: var(--text-primary);
22
- transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
23
21
  }
24
22
 
25
23
  // Headings
@@ -69,15 +67,9 @@ button {
69
67
  padding: 0.5rem 1rem;
70
68
  border: 0;
71
69
  border-radius: 0.25rem;
72
- background-color: var(--button-bg-color, #007BFF); // Default button color
73
- color: var(--button-text-color, #FFF);
74
70
  font-family: var(--font-family-base);
75
71
  cursor: pointer;
76
72
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
77
-
78
- &:hover {
79
- background-color: var(--button-bg-color-hover, #0056B3); // Hover button color
80
- }
81
73
 
82
74
  &:focus {
83
75
  outline: none;
@@ -88,6 +80,16 @@ button {
88
80
  color: #A0A0A0; // Disabled text color
89
81
  cursor: not-allowed;
90
82
  }
83
+
84
+ // Default styling when no bg-* class is present
85
+ &:not([class*="bg-"]) {
86
+ background-color: var(--button-bg-color, #007BFF); // Default button color
87
+ color: var(--button-text-color, #FFF);
88
+
89
+ &:hover {
90
+ background-color: var(--button-bg-color-hover, #0056B3);
91
+ }
92
+ }
91
93
  }
92
94
 
93
95
  // Inputs
@@ -164,14 +166,23 @@ figcaption {
164
166
 
165
167
  // Links
166
168
  a {
167
- color: var(--link-color);
168
169
  transition: color 0.2s ease-in-out;
169
170
 
170
- &:hover {
171
- color: var(--link-hover-color);
171
+ &:not([class*="text-"]){ // document: if no hover or normal text provided it will use the default link color
172
+ color: var(--link-color);
173
+
174
+ &:hover {
175
+ color: var(--link-hover-color);
176
+ }
172
177
  }
173
178
  }
174
179
 
180
+ // Labels
181
+ label[for] {
182
+ cursor: pointer;
183
+ }
184
+
185
+ // todo: add to doc
175
186
  .sr-only {
176
187
  position: absolute !important;
177
188
  width: 1px !important;
@@ -184,19 +195,16 @@ a {
184
195
  border: 0 !important;
185
196
  }
186
197
 
187
-
188
-
189
198
  code {
190
199
  font-family: 'Courier New', Courier, monospace;
191
200
  background-color: #f8f8f8;
192
201
  color: #d63384;
193
202
  padding: 2px 6px;
194
203
  border-radius: 3px;
195
- box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
196
204
  white-space: nowrap;
197
205
 
198
206
  @include media.dark-mode {
199
207
  background-color: #333;
200
208
  color: #f8f8f2;
201
209
  }
202
- }
210
+ }
@@ -1,2 +1,2 @@
1
- @forward "base";
2
1
  @forward "reset";
2
+ @forward "base";
@@ -1,14 +1,15 @@
1
- // Modern CSS Reset
2
-
3
1
  // Box sizing rules
4
2
  *,
5
- *::before,
6
- *::after {
3
+ ::before,
4
+ ::after,
5
+ ::backdrop,
6
+ ::file-selector-button {
7
7
  box-sizing: border-box;
8
8
  margin: 0;
9
9
  padding: 0;
10
10
  }
11
11
 
12
+
12
13
  // Remove default margin and padding
13
14
  body,
14
15
  h1,
@@ -26,6 +27,18 @@ dd {
26
27
  padding: 0;
27
28
  }
28
29
 
30
+ // Prevent font size inflation
31
+ html {
32
+ -moz-text-size-adjust: none; /* stylelint-disable-line */
33
+ -webkit-text-size-adjust: none; /* stylelint-disable-line */
34
+ text-size-adjust: none;
35
+ }
36
+
37
+ // Set core root defaults
38
+ html:focus-within {
39
+ scroll-behavior: smooth;
40
+ }
41
+
29
42
  // Set core body defaults
30
43
  body {
31
44
  min-height: 100vh;
@@ -34,7 +47,12 @@ body {
34
47
  line-height: 1.5;
35
48
  -webkit-font-smoothing: antialiased;
36
49
  -moz-osx-font-smoothing: grayscale;
37
- font-family: var(--font-family-base);
50
+ }
51
+
52
+ // Set shorter line heights on headings and interactive elements
53
+ h1, h2, h3, h4,
54
+ button, input, label {
55
+ line-height: 1.1;
38
56
  }
39
57
 
40
58
  // Make images easier to work with
@@ -42,9 +60,21 @@ img,
42
60
  picture,
43
61
  video,
44
62
  canvas,
45
- svg {
63
+ svg,
64
+ audio,
65
+ iframe,
66
+ embed,
67
+ object {
46
68
  display: block;
69
+ vertical-align: middle;
70
+ }
71
+
72
+ img,
73
+ picture,
74
+ video,
75
+ svg {
47
76
  max-width: 100%;
77
+ height: auto;
48
78
  }
49
79
 
50
80
  // Inherit fonts for inputs and buttons
@@ -53,24 +83,16 @@ button,
53
83
  textarea,
54
84
  select {
55
85
  font: inherit;
56
- transition: all 0.2s ease-in-out;
57
- }
86
+ cursor: pointer;
58
87
 
59
- // Remove all animations and transitions for people that prefer not to see them
60
- @media (prefers-reduced-motion: reduce) {
61
- *,
62
- *::before,
63
- *::after {
64
- animation-duration: 0.01ms !important;
65
- animation-iteration-count: 1 !important;
66
- transition-duration: 0.01ms !important;
67
- scroll-behavior: auto !important;
88
+ &:disabled {
89
+ cursor: not-allowed;
68
90
  }
69
91
  }
70
92
 
71
- // Remove list styles
72
- ul,
73
- ol {
93
+ // Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed
94
+ ul[role='list'],
95
+ ol[role='list'] {
74
96
  list-style: none;
75
97
  margin: 0;
76
98
  padding: 0;
@@ -78,17 +100,12 @@ ol {
78
100
  // Modern properties
79
101
  padding-inline-start: 0; // Replaces padding-left
80
102
  margin-block: 0; // Replaces margin-top/bottom
81
- }
82
-
83
- li {
84
- margin: 0;
85
- padding: 0;
86
- margin-block: 0;
87
- }
88
-
89
- // Set core root defaults
90
- html:focus-within {
91
- scroll-behavior: smooth;
103
+
104
+ & > li {
105
+ margin: 0;
106
+ padding: 0;
107
+ margin-block: 0;
108
+ }
92
109
  }
93
110
 
94
111
  // Remove underline from links
@@ -102,3 +119,21 @@ a {
102
119
  textarea:not([rows]) {
103
120
  min-height: 10em;
104
121
  }
122
+
123
+ // Anything that has been anchored to should have extra scroll margin
124
+ :target {
125
+ scroll-margin-block: 5ex;
126
+ }
127
+
128
+
129
+ // Remove all animations and transitions for people that prefer not to see them
130
+ @media (prefers-reduced-motion: reduce) {
131
+ *,
132
+ *::before,
133
+ *::after {
134
+ animation-duration: 0.01ms !important;
135
+ animation-iteration-count: 1 !important;
136
+ transition-duration: 0.01ms !important;
137
+ scroll-behavior: auto !important;
138
+ }
139
+ }
@@ -4,6 +4,8 @@
4
4
  // Import base styles
5
5
  @forward "base";
6
6
 
7
+ // Import themes near bottom for overrides
8
+ @forward "themes";
7
9
 
8
10
  // Import layout components
9
11
  @forward "layouts";
@@ -11,9 +13,4 @@
11
13
  // Import utilities based on configuration
12
14
  @forward "utilities";
13
15
 
14
-
15
-
16
- // Import themes near bottom for overrides
17
- @forward "themes";
18
-
19
16
  @forward "./mixins-map";