@nuvoui/core 1.4.6 → 1.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvoui/core",
3
- "version": "1.4.6",
3
+ "version": "1.5.1",
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",
@@ -5,213 +5,212 @@
5
5
  @use "../config/feature-flags" as config-flags;
6
6
  @use "../tools/accessibility" as tool-accessibility;
7
7
 
8
- :root {
9
- --font-family-base: #{config-typo.$font-family};
10
- }
11
-
12
- // Base config-typo styles
13
- html {
14
- font-size: config-typo.$base-size;
15
- }
16
-
17
- body#{config-flags.$parent-selector} {
18
- font-family: var(--font-family-base);
19
- font-weight: 400;
20
- line-height: 1.5;
21
- color: var(--text-default);
22
- }
23
-
24
- // Headings
25
- #{config-flags.$parent-selector} h1,
26
- #{config-flags.$parent-selector} h2,
27
- #{config-flags.$parent-selector} h3,
28
- #{config-flags.$parent-selector} h4,
29
- #{config-flags.$parent-selector} h5,
30
- #{config-flags.$parent-selector} h6 {
31
- margin-bottom: 0.5em;
32
- font-family: var(--font-family-base);
33
- font-weight: 700;
34
- line-height: 1.2;
35
- }
36
-
37
- #{config-flags.$parent-selector} h1 {
38
- font-size: map.get(config-typo.$font-sizes, "4xl");
39
- }
40
-
41
- #{config-flags.$parent-selector} h2 {
42
- font-size: map.get(config-typo.$font-sizes, "3xl");
43
- }
44
-
45
- #{config-flags.$parent-selector} h3 {
46
- font-size: map.get(config-typo.$font-sizes, "2xl");
47
- }
48
-
49
- #{config-flags.$parent-selector} h4 {
50
- font-size: map.get(config-typo.$font-sizes, "xl");
51
- }
52
-
53
- #{config-flags.$parent-selector} h5 {
54
- font-size: map.get(config-typo.$font-sizes, "lg");
55
- }
56
-
57
- #{config-flags.$parent-selector} h6 {
58
- font-size: map.get(config-typo.$font-sizes, "base");
59
- }
60
-
61
- // Paragraphs
62
- #{config-flags.$parent-selector} p {
63
- margin-bottom: 1rem;
64
- }
65
-
66
- // Small text
67
- #{config-flags.$parent-selector} small {
68
- font-size: map.get(config-typo.$font-sizes, "sm");
69
- }
70
-
71
- // Buttons
72
- #{config-flags.$parent-selector} button {
73
- padding: 0.5rem 1rem;
74
- border: 0;
75
- border-radius: 0.25rem;
76
- font-family: var(--font-family-base);
77
- cursor: pointer;
78
- transition:
79
- background-color 0.2s ease-in-out,
80
- color 0.2s ease-in-out;
81
-
82
- &:focus {
83
- outline: none;
84
- }
85
-
86
- &:disabled {
87
- background-color: #e0e0e0; // Disabled button color
88
- color: #a0a0a0; // Disabled text color
89
- cursor: not-allowed;
90
- }
91
-
92
- // Default styling when no bg-* class is present
93
- &:not([class*="bg-"]) {
94
- background-color: var(--button-bg-color, #007bff); // Default button color
8
+ @layer base {
9
+ :root {
10
+ --font-family-base: #{config-typo.$font-family};
11
+ }
12
+
13
+ // Base config-typo styles
14
+ html {
15
+ font-size: config-typo.$base-size;
16
+ }
17
+
18
+ body#{config-flags.$parent-selector} {
19
+ font-family: var(--font-family-base);
20
+ font-weight: 400;
21
+ line-height: 1.5;
22
+ color: var(--text-default);
23
+ }
24
+
25
+ // Headings
26
+ #{config-flags.$parent-selector} h1,
27
+ #{config-flags.$parent-selector} h2,
28
+ #{config-flags.$parent-selector} h3,
29
+ #{config-flags.$parent-selector} h4,
30
+ #{config-flags.$parent-selector} h5,
31
+ #{config-flags.$parent-selector} h6 {
32
+ margin-bottom: 0.5em;
33
+ font-family: var(--font-family-base);
34
+ font-weight: 700;
35
+ line-height: 1.2;
36
+ }
37
+
38
+ #{config-flags.$parent-selector} h1 {
39
+ font-size: map.get(config-typo.$font-sizes, "4xl");
40
+ }
41
+
42
+ #{config-flags.$parent-selector} h2 {
43
+ font-size: map.get(config-typo.$font-sizes, "3xl");
44
+ }
45
+
46
+ #{config-flags.$parent-selector} h3 {
47
+ font-size: map.get(config-typo.$font-sizes, "2xl");
48
+ }
49
+
50
+ #{config-flags.$parent-selector} h4 {
51
+ font-size: map.get(config-typo.$font-sizes, "xl");
52
+ }
53
+
54
+ #{config-flags.$parent-selector} h5 {
55
+ font-size: map.get(config-typo.$font-sizes, "lg");
56
+ }
57
+
58
+ #{config-flags.$parent-selector} h6 {
59
+ font-size: map.get(config-typo.$font-sizes, "base");
60
+ }
61
+
62
+ // Paragraphs
63
+ #{config-flags.$parent-selector} p {
64
+ margin-bottom: 1rem;
65
+ }
66
+
67
+ // Small text
68
+ #{config-flags.$parent-selector} small {
69
+ font-size: map.get(config-typo.$font-sizes, "sm");
70
+ }
71
+
72
+ // Buttons
73
+ #{config-flags.$parent-selector} button {
74
+ padding: 0.5rem 1rem;
75
+ border: 0;
76
+ border-radius: 0.25rem;
77
+ font-family: var(--font-family-base);
78
+ cursor: pointer;
79
+ transition:
80
+ background-color 0.2s ease-in-out,
81
+ color 0.2s ease-in-out;
82
+
83
+ &:focus {
84
+ outline: none;
85
+ }
86
+
87
+ &:disabled {
88
+ background-color: #e0e0e0;
89
+ color: #a0a0a0;
90
+ cursor: not-allowed;
91
+ }
92
+
93
+ background-color: var(--button-bg-color, #007bff);
95
94
  color: var(--button-text-color, #fff);
96
95
 
97
96
  &:hover {
98
97
  background-color: var(--button-bg-color-hover, #0056b3);
99
98
  }
100
99
  }
101
- }
102
-
103
- // Inputs
104
- #{config-flags.$parent-selector} input[type="text"],
105
- #{config-flags.$parent-selector} input[type="tel"],
106
- #{config-flags.$parent-selector} input[type="email"],
107
- #{config-flags.$parent-selector} input[type="password"],
108
- #{config-flags.$parent-selector} input[type="number"],
109
- #{config-flags.$parent-selector} input[type="search"],
110
- #{config-flags.$parent-selector} textarea {
111
- padding: 0.5rem;
112
- border: var(--border-size, 1px) var(--border-style, solid) var(--border-base, var(--secondary));
113
- border-radius: 0.25rem;
114
- width: 100%; // Full width
115
- font-family: var(--font-family-base);
116
- transition: border 0.2s ease-in-out;
117
-
118
- &:focus {
119
- border-color: var(--link-color);
120
- outline: none;
121
- }
122
- }
123
-
124
- // Checkboxes and Radio Buttons
125
- #{config-flags.$parent-selector} input[type="checkbox"],
126
- #{config-flags.$parent-selector} input[type="radio"] {
127
- margin-right: 0.5rem; // Space between input and label
128
- }
129
-
130
- // Selects
131
- #{config-flags.$parent-selector} select {
132
- padding: 0.5rem;
133
- border: var(--border-size, 1px) var(--border-style, solid) var(--border-base, var(--secondary));
134
- border-radius: 0.25rem;
135
- width: 100%; // Full width
136
- font-family: var(--font-family-base);
137
- transition: border 0.2s ease-in-out;
138
-
139
- &:focus {
140
- border-color: var(--link-color);
141
- outline: none;
142
- }
143
- }
144
-
145
- // Blockquotes
146
- #{config-flags.$parent-selector} blockquote {
147
- margin: 1rem 0;
148
- padding: 0.5rem 1rem;
149
- border-left: var(--border-size, 4px) var(--border-style, solid) var(--border-base, var(--secondary));
150
- font-style: italic;
151
- }
152
-
153
- // Horizontal Rule
154
- #{config-flags.$parent-selector} hr {
155
- border: none;
156
- border-top: var(--border-size, 1px) var(--border-style, solid) var(--border-base, var(--secondary));
157
- margin: 1rem 0;
158
- }
159
-
160
- // Images
161
- #{config-flags.$parent-selector} img {
162
- max-width: 100%; // Responsive images
163
- height: auto;
164
- }
165
-
166
- // Figures and Captions
167
- #{config-flags.$parent-selector} figure {
168
- margin: 1rem 0;
169
- }
170
-
171
- #{config-flags.$parent-selector} figcaption {
172
- font-size: 0.875rem; // Smaller font for captions
173
- color: var(--text-muted, #666); // Optional secondary text color
174
- }
175
-
176
- // Links
177
- #{config-flags.$parent-selector} a {
178
- &:not([class]) {
179
- color: var(--link-color);
180
100
 
181
- &:hover {
182
- color: var(--link-hover-color);
101
+ // Inputs
102
+ #{config-flags.$parent-selector} input[type="text"],
103
+ #{config-flags.$parent-selector} input[type="tel"],
104
+ #{config-flags.$parent-selector} input[type="email"],
105
+ #{config-flags.$parent-selector} input[type="password"],
106
+ #{config-flags.$parent-selector} input[type="number"],
107
+ #{config-flags.$parent-selector} input[type="search"],
108
+ #{config-flags.$parent-selector} textarea {
109
+ padding: 0.5rem;
110
+ border: var(--border-size, 1px) var(--border-style, solid) var(--border-base, var(--secondary));
111
+ border-radius: 0.25rem;
112
+ width: 100%; // Full width
113
+ font-family: var(--font-family-base);
114
+ transition: border 0.2s ease-in-out;
115
+
116
+ &:focus {
117
+ border-color: var(--link-color);
118
+ outline: none;
119
+ }
120
+ }
121
+
122
+ // Checkboxes and Radio Buttons
123
+ #{config-flags.$parent-selector} input[type="checkbox"],
124
+ #{config-flags.$parent-selector} input[type="radio"] {
125
+ margin-right: 0.5rem; // Space between input and label
126
+ }
127
+
128
+ // Selects
129
+ #{config-flags.$parent-selector} select {
130
+ padding: 0.5rem;
131
+ border: var(--border-size, 1px) var(--border-style, solid) var(--border-base, var(--secondary));
132
+ border-radius: 0.25rem;
133
+ width: 100%; // Full width
134
+ font-family: var(--font-family-base);
135
+ transition: border 0.2s ease-in-out;
136
+
137
+ &:focus {
138
+ border-color: var(--link-color);
139
+ outline: none;
140
+ }
141
+ }
142
+
143
+ // Blockquotes
144
+ #{config-flags.$parent-selector} blockquote {
145
+ margin: 1rem 0;
146
+ padding: 0.5rem 1rem;
147
+ border-left: var(--border-size, 4px) var(--border-style, solid) var(--border-base, var(--secondary));
148
+ font-style: italic;
149
+ }
150
+
151
+ // Horizontal Rule
152
+ #{config-flags.$parent-selector} hr {
153
+ border: none;
154
+ border-top: var(--border-size, 1px) var(--border-style, solid) var(--border-base, var(--secondary));
155
+ margin: 1rem 0;
156
+ }
157
+
158
+ // Images
159
+ #{config-flags.$parent-selector} img {
160
+ max-width: 100%; // Responsive images
161
+ height: auto;
162
+ }
163
+
164
+ // Figures and Captions
165
+ #{config-flags.$parent-selector} figure {
166
+ margin: 1rem 0;
167
+ }
168
+
169
+ #{config-flags.$parent-selector} figcaption {
170
+ font-size: 0.875rem; // Smaller font for captions
171
+ color: var(--text-muted, #666); // Optional secondary text color
172
+ }
173
+
174
+ // Links
175
+ #{config-flags.$parent-selector} a {
176
+ &:not([class]) {
177
+ color: var(--link-color);
178
+
179
+ &:hover {
180
+ color: var(--link-hover-color);
181
+ }
182
+ }
183
+ }
184
+
185
+ // Labels
186
+ #{config-flags.$parent-selector} label[for] {
187
+ cursor: pointer;
188
+ }
189
+
190
+ // todo: add to doc
191
+ #{config-flags.$parent-selector} .sr-only {
192
+ position: absolute !important;
193
+ width: 1px !important;
194
+ height: 1px !important;
195
+ padding: 0 !important;
196
+ margin: -1px !important;
197
+ overflow: hidden !important;
198
+ clip: rect(0, 0, 0, 0) !important;
199
+ white-space: nowrap !important;
200
+ border: 0 !important;
201
+ }
202
+
203
+ #{config-flags.$parent-selector} code {
204
+ font-family: "Courier New", Courier, monospace;
205
+ background-color: #f8f8f8;
206
+ color: #d63384;
207
+ padding: 2px 6px;
208
+ border-radius: 3px;
209
+ white-space: nowrap;
210
+
211
+ @include tool-accessibility.dark-mode {
212
+ background-color: #333;
213
+ color: #f8f8f2;
183
214
  }
184
215
  }
185
- }
186
-
187
- // Labels
188
- #{config-flags.$parent-selector} label[for] {
189
- cursor: pointer;
190
- }
191
-
192
- // todo: add to doc
193
- #{config-flags.$parent-selector} .sr-only {
194
- position: absolute !important;
195
- width: 1px !important;
196
- height: 1px !important;
197
- padding: 0 !important;
198
- margin: -1px !important;
199
- overflow: hidden !important;
200
- clip: rect(0, 0, 0, 0) !important;
201
- white-space: nowrap !important;
202
- border: 0 !important;
203
- }
204
-
205
- #{config-flags.$parent-selector} code {
206
- font-family: "Courier New", Courier, monospace;
207
- background-color: #f8f8f8;
208
- color: #d63384;
209
- padding: 2px 6px;
210
- border-radius: 3px;
211
- white-space: nowrap;
212
-
213
- @include tool-accessibility.dark-mode {
214
- background-color: #333;
215
- color: #f8f8f2;
216
- }
217
- }
216
+ } // end @layer base
@@ -1,132 +1,136 @@
1
- // Box sizing rules
2
- *,
3
- ::before,
4
- ::after,
5
- ::backdrop,
6
- ::file-selector-button {
7
- box-sizing: border-box;
8
- }
9
-
10
- // Remove default margin and padding
11
- body,
12
- h1,
13
- h2,
14
- h3,
15
- h4,
16
- h5,
17
- h6,
18
- p,
19
- figure,
20
- blockquote,
21
- dl,
22
- dd {
23
- margin: 0;
24
- padding: 0;
25
- }
26
-
27
- // Prevent font size inflation
28
- html {
29
- text-size-adjust: none;
30
- }
31
-
32
- // Set core root defaults
33
- html:focus-within {
34
- scroll-behavior: smooth;
35
- }
36
-
37
- // Set core body defaults
38
- body {
39
- min-height: 100vh;
40
- min-height: 100dvh;
41
- text-rendering: optimizespeed;
42
- line-height: 1.5;
43
- -webkit-font-smoothing: antialiased;
44
- -moz-osx-font-smoothing: grayscale;
45
- }
46
-
47
- // Set shorter line heights on headings and interactive elements
48
- h1,
49
- h2,
50
- h3,
51
- h4,
52
- button,
53
- input,
54
- label {
55
- line-height: 1.1;
56
- }
57
-
58
- // Make images easier to work with
59
- img,
60
- picture,
61
- video,
62
- canvas,
63
- svg,
64
- audio,
65
- iframe,
66
- embed,
67
- object {
68
- display: block;
69
- vertical-align: middle;
70
- }
71
-
72
- img,
73
- picture,
74
- video,
75
- svg {
76
- max-width: 100%;
77
- height: auto;
78
- }
79
-
80
- // Inherit fonts for inputs and buttons
81
- input,
82
- button,
83
- textarea,
84
- select {
85
- font: inherit;
86
- cursor: pointer;
87
-
88
- &:disabled {
89
- cursor: not-allowed;
1
+ @layer reset, base, components;
2
+
3
+ @layer reset {
4
+ // Box sizing rules
5
+ *,
6
+ ::before,
7
+ ::after,
8
+ ::backdrop,
9
+ ::file-selector-button {
10
+ box-sizing: border-box;
90
11
  }
91
- }
92
12
 
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"] {
96
- list-style: none;
97
- padding-inline-start: 0; // Replaces padding-left
98
- margin-block: 0; // Replaces margin-top/bottom
13
+ // Remove default margin and padding
14
+ body,
15
+ h1,
16
+ h2,
17
+ h3,
18
+ h4,
19
+ h5,
20
+ h6,
21
+ p,
22
+ figure,
23
+ blockquote,
24
+ dl,
25
+ dd {
26
+ margin: 0;
27
+ padding: 0;
28
+ }
99
29
 
100
- & > li {
101
- margin-block: 0;
30
+ // Prevent font size inflation
31
+ html {
32
+ text-size-adjust: none;
102
33
  }
103
- }
104
-
105
- // Remove underline from links
106
- a {
107
- text-decoration-skip-ink: auto;
108
- text-decoration: none;
109
- color: inherit;
110
- }
111
-
112
- // Make sure text areas without a rows attribute are not tiny
113
- textarea:not([rows]) {
114
- min-height: 10em;
115
- }
116
-
117
- // Anything that has been anchored to should have extra scroll margin
118
- :target {
119
- scroll-margin-block: 5ex;
120
- }
121
-
122
- // Remove all animations and transitions for people that prefer not to see them
123
- @media (prefers-reduced-motion: reduce) {
124
- *,
125
- *::before,
126
- *::after {
127
- animation-duration: 0.01ms !important;
128
- animation-iteration-count: 1 !important;
129
- transition-duration: 0.01ms !important;
130
- scroll-behavior: auto !important;
34
+
35
+ // Set core root defaults
36
+ html:focus-within {
37
+ scroll-behavior: smooth;
38
+ }
39
+
40
+ // Set core body defaults
41
+ body {
42
+ min-height: 100vh;
43
+ min-height: 100dvh;
44
+ text-rendering: optimizespeed;
45
+ line-height: 1.5;
46
+ -webkit-font-smoothing: antialiased;
47
+ -moz-osx-font-smoothing: grayscale;
48
+ }
49
+
50
+ // Set shorter line heights on headings and interactive elements
51
+ h1,
52
+ h2,
53
+ h3,
54
+ h4,
55
+ button,
56
+ input,
57
+ label {
58
+ line-height: 1.1;
59
+ }
60
+
61
+ // Make images easier to work with
62
+ img,
63
+ picture,
64
+ video,
65
+ canvas,
66
+ svg,
67
+ audio,
68
+ iframe,
69
+ embed,
70
+ object {
71
+ display: block;
72
+ vertical-align: middle;
73
+ }
74
+
75
+ img,
76
+ picture,
77
+ video,
78
+ svg {
79
+ max-width: 100%;
80
+ height: auto;
81
+ }
82
+
83
+ // Inherit fonts for inputs and buttons
84
+ input,
85
+ button,
86
+ textarea,
87
+ select {
88
+ font: inherit;
89
+ cursor: pointer;
90
+
91
+ &:disabled {
92
+ cursor: not-allowed;
93
+ }
94
+ }
95
+
96
+ // Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed
97
+ ul[role="list"],
98
+ ol[role="list"] {
99
+ list-style: none;
100
+ padding-inline-start: 0; // Replaces padding-left
101
+ margin-block: 0; // Replaces margin-top/bottom
102
+
103
+ & > li {
104
+ margin-block: 0;
105
+ }
106
+ }
107
+
108
+ // Remove underline from links
109
+ a {
110
+ text-decoration-skip-ink: auto;
111
+ text-decoration: none;
112
+ color: inherit;
113
+ }
114
+
115
+ // Make sure text areas without a rows attribute are not tiny
116
+ textarea:not([rows]) {
117
+ min-height: 10em;
118
+ }
119
+
120
+ // Anything that has been anchored to should have extra scroll margin
121
+ :target {
122
+ scroll-margin-block: 5ex;
123
+ }
124
+
125
+ // Remove all animations and transitions for people that prefer not to see them
126
+ @media (prefers-reduced-motion: reduce) {
127
+ *,
128
+ *::before,
129
+ *::after {
130
+ animation-duration: 0.01ms !important;
131
+ animation-iteration-count: 1 !important;
132
+ transition-duration: 0.01ms !important;
133
+ scroll-behavior: auto !important;
134
+ }
131
135
  }
132
- }
136
+ } // end @layer reset