@new-ui/foundations 0.3.1 → 0.3.3
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/README.md +123 -201
- package/dist/index.css +1862 -1
- package/dist/index.css.map +1 -1
- package/package.json +24 -13
- package/src/index.scss +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# New UI Foundations
|
|
2
2
|
|
|
3
3
|
#### What is New UI?
|
|
4
|
+
|
|
4
5
|
New UI is a modern, semantic UI framework for building beautiful, accessible websites and apps. It gives you all the core design foundations you need—colors, typography, spacing and sizing, reset, grid and layouts, and layering and elevations. It's designed to grow with you, from your first launch to millions of users. Thoughtfully made for makers, small teams, and anyone who cares about great design.
|
|
5
6
|
|
|
6
7
|
#### Install
|
|
8
|
+
|
|
7
9
|
To set up the project, open your terminal and run the following command:
|
|
8
10
|
|
|
9
11
|
```
|
|
@@ -13,236 +15,156 @@ npm i -D @new-ui/foundations
|
|
|
13
15
|
<strong>Note:</strong> This command installs all New UI foundation packages, which include reset, colors, effects, spacings, and typography. If you need to install only specific packages, refer to the foundations documentation for instructions.
|
|
14
16
|
|
|
15
17
|
#### Import
|
|
18
|
+
|
|
16
19
|
Import the New UI foundations by adding the following line at the top of your SCSS file:
|
|
17
20
|
|
|
18
21
|
```scss
|
|
19
|
-
@use '@new-ui/foundations';
|
|
22
|
+
@use '@new-ui/foundations'; // Use `@import` for CSS
|
|
20
23
|
```
|
|
21
24
|
|
|
22
25
|
#### Set the theme
|
|
26
|
+
|
|
23
27
|
Set the theme by adding the `data-new-ui-theme` attribute to your HTML wrapper element, for example:
|
|
24
28
|
|
|
25
29
|
```html
|
|
26
|
-
<html data-new-ui-theme="light">
|
|
30
|
+
<html data-new-ui-theme="light"></html>
|
|
27
31
|
```
|
|
28
32
|
|
|
29
|
-
Available themes
|
|
30
|
-
|
|
31
|
-
Light (Default)
|
|
32
|
-
Light warm
|
|
33
|
-
Light cold
|
|
34
|
-
Dark
|
|
35
|
-
Dark warm
|
|
36
|
-
Dark cold
|
|
33
|
+
| Available themes | Value |
|
|
34
|
+
| :--------------- | :------------ |
|
|
35
|
+
| Light (Default) | `light` |
|
|
36
|
+
| Light warm | `light--warm` |
|
|
37
|
+
| Light cold | `light--cold` |
|
|
38
|
+
| Dark (Default) | `dark` |
|
|
39
|
+
| Dark warm | `dark--warm` |
|
|
40
|
+
| Dark cold | `dark--cold` |
|
|
37
41
|
|
|
42
|
+
#### Utility classes, naming convention
|
|
38
43
|
|
|
39
|
-
#### Usage guide
|
|
40
44
|
- All classes associated with the New UI are prefixed with a global namespace followed by a hyphen: `nu-`
|
|
41
45
|
- In addition to a global namespace, we added prefixes to each class to make it more apparent what job that class is doing using BEM syntax.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
- `c-` for UI components.
|
|
47
|
+
- `l-` for layout-related styles.
|
|
48
|
+
- `u-` for utilities.
|
|
49
|
+
- `is-` and `has-` for state-based classes.
|
|
50
|
+
- `js-` for targeting JavaScript-specific functionality.
|
|
47
51
|
|
|
48
52
|
---
|
|
49
53
|
|
|
50
|
-
### Design
|
|
54
|
+
### Design tokens
|
|
51
55
|
|
|
52
56
|
#### Colors
|
|
53
57
|
|
|
54
|
-
Background
|
|
55
|
-
|
|
56
|
-
**`--background`**
|
|
57
|
-
**`--background-secondary`**
|
|
58
|
-
**`--background-hover`**
|
|
59
|
-
**`--background-selected`**
|
|
60
|
-
**`--background-selected-hover`** | UI element background hovered
|
|
61
|
-
**`--background-high-contrast`**
|
|
62
|
-
|
|
63
|
-
Border
|
|
64
|
-
|
|
65
|
-
**`--border-muted`**
|
|
66
|
-
**`--border`**
|
|
67
|
-
**`--border-strong`**
|
|
68
|
-
**`--border-inked`**
|
|
69
|
-
**`--border-inverse`** | Inverse strokes and separators
|
|
70
|
-
**`--border-focus`**
|
|
71
|
-
|
|
72
|
-
Button
|
|
73
|
-
|
|
74
|
-
**`--button`**
|
|
75
|
-
**`--button-hover`**
|
|
76
|
-
**`--button-active`**
|
|
77
|
-
**`--button-disabled`** | Disabled button background
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
**`--
|
|
82
|
-
**`--
|
|
83
|
-
**`--
|
|
84
|
-
**`--
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
**`--
|
|
90
|
-
**`--
|
|
91
|
-
**`--
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
**`--
|
|
97
|
-
**`--
|
|
98
|
-
**`--
|
|
99
|
-
**`--
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
**`--text-primary`** | Primary body copy
|
|
104
|
-
**`--text-secondary`** | Secondary text color
|
|
105
|
-
**`--text-secondary-alt`** | Secondary text color alt
|
|
106
|
-
**`--text-placeholder`** | Placeholder text color
|
|
107
|
-
**`--text-on-color`** | Text on interactive color
|
|
108
|
-
**`--text-error`** | Error message
|
|
109
|
-
**`--text-success`** | Success message
|
|
110
|
-
**`--text-inked`** | Inked text
|
|
58
|
+
| Background | Role |
|
|
59
|
+
| :-------------------------------- | :---------------------------- |
|
|
60
|
+
| **`--background`** | Default app background |
|
|
61
|
+
| **`--background-secondary`** | Secondary app background |
|
|
62
|
+
| **`--background-hover`** | Background hover |
|
|
63
|
+
| **`--background-selected`** | UI element background |
|
|
64
|
+
| **`--background-selected-hover`** | UI element background hovered |
|
|
65
|
+
| **`--background-high-contrast`** | High contrast background |
|
|
66
|
+
|
|
67
|
+
| Border | Role |
|
|
68
|
+
| :--------------------- | :----------------------------- |
|
|
69
|
+
| **`--border-muted`** | Muted strokes and separators |
|
|
70
|
+
| **`--border`** | Default strokes and separators |
|
|
71
|
+
| **`--border-strong`** | Strong strokes and separators |
|
|
72
|
+
| **`--border-inked`** | Inked strokes and separators |
|
|
73
|
+
| **`--border-inverse`** | Inverse strokes and separators |
|
|
74
|
+
| **`--border-focus`** | Focus outline |
|
|
75
|
+
|
|
76
|
+
| Button | Role |
|
|
77
|
+
| :---------------------- | :------------------------- |
|
|
78
|
+
| **`--button`** | Primary button background |
|
|
79
|
+
| **`--button-hover`** | Primary button hover |
|
|
80
|
+
| **`--button-active`** | Primary button active |
|
|
81
|
+
| **`--button-disabled`** | Disabled button background |
|
|
82
|
+
|
|
83
|
+
| Link | Role |
|
|
84
|
+
| :------------------- | :--------------------------- |
|
|
85
|
+
| **`--link`** | Primary link |
|
|
86
|
+
| **`--link-hover`** | Hover state for primary link |
|
|
87
|
+
| **`--link-subtle`** | Secondary link |
|
|
88
|
+
| **`--link-visited`** | Link visited |
|
|
89
|
+
|
|
90
|
+
| Support | Role |
|
|
91
|
+
| :---------------------- | :---------- |
|
|
92
|
+
| **`--support-error`** | Error |
|
|
93
|
+
| **`--support-warning`** | Warning |
|
|
94
|
+
| **`--support-success`** | Success |
|
|
95
|
+
| **`--support-info`** | Information |
|
|
96
|
+
|
|
97
|
+
| Content | Role |
|
|
98
|
+
| :---------------------------- | :------------------------ |
|
|
99
|
+
| **`--content-primary`** | Primary body copy |
|
|
100
|
+
| **`--content-secondary`** | Secondary text color |
|
|
101
|
+
| **`--content-secondary-alt`** | Secondary text color alt |
|
|
102
|
+
| **`--content-placeholder`** | Placeholder text color |
|
|
103
|
+
| **`--content-on-color`** | Text on interactive color |
|
|
104
|
+
| **`--content-error`** | Error message |
|
|
105
|
+
| **`--content-success`** | Success message |
|
|
106
|
+
| **`--content-inked`** | Inked text |
|
|
111
107
|
|
|
112
108
|
#### Effects
|
|
113
109
|
|
|
114
|
-
Shadows
|
|
115
|
-
|
|
116
|
-
**`--dialog-strong`** | Modals, sidebar overlays, toasts
|
|
117
|
-
**`--dialog`**
|
|
118
|
-
**`--content`**
|
|
119
|
-
**`--canvas`**
|
|
120
|
-
**`--keyboard-key`**
|
|
121
|
-
|
|
122
|
-
Focus
|
|
123
|
-
|
|
124
|
-
**`--focus-default`** | Default focus
|
|
125
|
-
**`--focus-accent`**
|
|
126
|
-
**`--focus-inverse`** | Focus inverse
|
|
127
|
-
|
|
128
|
-
Borders | Role
|
|
129
|
-
:--- | :---
|
|
130
|
-
**`--border-width-01`** | Default border width
|
|
131
|
-
**`--border-width-02`** | Used for the selection and focus order
|
|
110
|
+
| Shadows | Role |
|
|
111
|
+
| :-------------------- | :-------------------------------------------- |
|
|
112
|
+
| **`--dialog-strong`** | Modals, sidebar overlays, toasts |
|
|
113
|
+
| **`--dialog`** | Dropdown, tooltip, popover |
|
|
114
|
+
| **`--content`** | Content area, buttons, controls, cards, pills |
|
|
115
|
+
| **`--canvas`** | Background |
|
|
116
|
+
| **`--keyboard-key`** | Keyboard key component |
|
|
117
|
+
|
|
118
|
+
| Focus | Role |
|
|
119
|
+
| :-------------------- | :------------ |
|
|
120
|
+
| **`--focus-default`** | Default focus |
|
|
121
|
+
| **`--focus-accent`** | Accent focus |
|
|
122
|
+
| **`--focus-inverse`** | Focus inverse |
|
|
132
123
|
|
|
133
124
|
#### Spacings
|
|
134
125
|
|
|
135
|
-
Token | Size (px/rem)
|
|
136
|
-
|
|
137
|
-
**`--spacing-
|
|
138
|
-
**`--spacing-
|
|
139
|
-
**`--spacing-
|
|
140
|
-
**`--spacing-
|
|
141
|
-
**`--spacing-
|
|
142
|
-
**`--spacing-
|
|
143
|
-
**`--spacing-
|
|
144
|
-
**`--spacing-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
**`--
|
|
151
|
-
**`--
|
|
152
|
-
**`--
|
|
153
|
-
**`--
|
|
154
|
-
**`--
|
|
155
|
-
**`--spacing-18`** | 160 / 10
|
|
126
|
+
| Token | Source | Size (px/rem) |
|
|
127
|
+
| :------------------- | :------------- | :------------ |
|
|
128
|
+
| **`--spacing-zero`** | `--spacing-00` | 0 / 0 |
|
|
129
|
+
| **`--spacing-xs`** | `--spacing-02` | 4 / 0.25 |
|
|
130
|
+
| **`--spacing-s`** | `--spacing-04` | 8 / 0.5 |
|
|
131
|
+
| **`--spacing-m`** | `--spacing-05` | 12 / 0.75 |
|
|
132
|
+
| **`--spacing-l`** | `--spacing-06` | 16 / 1 |
|
|
133
|
+
| **`--spacing-xl`** | `--spacing-08` | 24 / 1.5 |
|
|
134
|
+
| **`--spacing-xxl`** | `--spacing-09` | 32 / 2 |
|
|
135
|
+
| **`--spacing-xxxl`** | `--spacing-11` | 48 / 3 |
|
|
136
|
+
|
|
137
|
+
#### Sizing
|
|
138
|
+
|
|
139
|
+
| Token | Source | Size (px/rem) |
|
|
140
|
+
| :---------------------------- | :------------- | :------------ |
|
|
141
|
+
| **`--size-xs`** | `--spacing-06` | 16 / 1 |
|
|
142
|
+
| **`--size-s`** | `--spacing-08` | 24 / 1.5 |
|
|
143
|
+
| **`--size-m`** | `--spacing-09` | 32 / 2 |
|
|
144
|
+
| **`--controls-size-default`** | `--spacing-09` | 32 / 2 |
|
|
145
|
+
| **`--controls-size-small`** | `--spacing-08` | 24 / 1.5 |
|
|
156
146
|
|
|
157
147
|
#### Typography
|
|
158
148
|
|
|
159
|
-
Heading (Desktop)
|
|
160
|
-
|
|
161
|
-
**`--desktop-heading-01`** | **`--mobile-heading-01`** | Heading 01
|
|
162
|
-
**`--desktop-heading-02`** | **`--mobile-heading-02`** | Heading 02
|
|
163
|
-
**`--desktop-heading-03`** | **`--mobile-heading-03`** | Heading 03
|
|
164
|
-
**`--desktop-heading-04`** | **`--mobile-heading-04`** | Heading 04
|
|
165
|
-
**`--desktop-heading-05`** | **`--mobile-heading-05`** | Heading 05
|
|
166
|
-
**`--desktop-heading-06`** | **`--mobile-heading-06`** | Heading 06
|
|
167
|
-
|
|
168
|
-
Body (Desktop)
|
|
169
|
-
|
|
170
|
-
**`--desktop-body-xl`** | **`--mobile-body-xl`** | Body large
|
|
171
|
-
**`--desktop-body`**
|
|
172
|
-
**`--desktop-body-sm`** | **`--mobile-body-sm`** | Body small
|
|
173
|
-
|
|
174
|
-
Utility (Desktop)
|
|
175
|
-
|
|
176
|
-
**`--desktop-caption`**
|
|
177
|
-
**`--desktop-helper-text`** | **`--mobile-helper-text`** | Helper text
|
|
178
|
-
**`--desktop-code`**
|
|
149
|
+
| Heading (Desktop) | Heading (Mobile) | Role |
|
|
150
|
+
| :------------------------- | :------------------------ | :--------- |
|
|
151
|
+
| **`--desktop-heading-01`** | **`--mobile-heading-01`** | Heading 01 |
|
|
152
|
+
| **`--desktop-heading-02`** | **`--mobile-heading-02`** | Heading 02 |
|
|
153
|
+
| **`--desktop-heading-03`** | **`--mobile-heading-03`** | Heading 03 |
|
|
154
|
+
| **`--desktop-heading-04`** | **`--mobile-heading-04`** | Heading 04 |
|
|
155
|
+
| **`--desktop-heading-05`** | **`--mobile-heading-05`** | Heading 05 |
|
|
156
|
+
| **`--desktop-heading-06`** | **`--mobile-heading-06`** | Heading 06 |
|
|
157
|
+
|
|
158
|
+
| Body (Desktop) | Body (Mobile) | Role |
|
|
159
|
+
| :---------------------- | :--------------------- | :--------- |
|
|
160
|
+
| **`--desktop-body-xl`** | **`--mobile-body-xl`** | Body large |
|
|
161
|
+
| **`--desktop-body`** | **`--mobile-body`** | Body copy |
|
|
162
|
+
| **`--desktop-body-sm`** | **`--mobile-body-sm`** | Body small |
|
|
163
|
+
|
|
164
|
+
| Utility (Desktop) | Utility (Mobile) | Role |
|
|
165
|
+
| :-------------------------- | :------------------------- | :---------- |
|
|
166
|
+
| **`--desktop-caption`** | **`--mobile-caption`** | Caption |
|
|
167
|
+
| **`--desktop-helper-text`** | **`--mobile-helper-text`** | Helper text |
|
|
168
|
+
| **`--desktop-code`** | **`--mobile-code`** | Code |
|
|
179
169
|
|
|
180
170
|
> Note: To set line height, simply add the prefix `--lh` to the font size variables. For instance, `--desktop-body-xl` becomes `--lh-desktop-body-xl`.
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
### The new reset
|
|
185
|
-
|
|
186
|
-
A thoughtful SCSS, CSS reset that preserves browser defaults while giving you complete design control. New UI reset eliminates cross-browser inconsistencies without being overly opinionated, allowing you to build upon a clean foundation.
|
|
187
|
-
|
|
188
|
-
```scss
|
|
189
|
-
// https://cdn.jsdelivr.net/npm/@new-ui/reset@latest/dist/index.css
|
|
190
|
-
|
|
191
|
-
*, *::before, *::after {
|
|
192
|
-
box-sizing: border-box;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
html {
|
|
196
|
-
-moz-text-size-adjust: none;
|
|
197
|
-
-webkit-text-size-adjust: none;
|
|
198
|
-
text-size-adjust: none;
|
|
199
|
-
vertical-align: baseline;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
body, h1, h2, h3, h4, p,
|
|
203
|
-
figure, blockquote, dl, dd {
|
|
204
|
-
margin: 0;
|
|
205
|
-
padding: 0;
|
|
206
|
-
margin-block-end: 0;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
ul[role='list'],
|
|
210
|
-
ol[role='list'] {
|
|
211
|
-
list-style: none;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
body {
|
|
215
|
-
min-height: 100vh;
|
|
216
|
-
line-height: 1.5;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
h1, h2,
|
|
220
|
-
h3, h4 {
|
|
221
|
-
text-wrap: balance;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
a:not([class]) {
|
|
225
|
-
text-decoration-skip-ink: auto;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
img,
|
|
229
|
-
picture {
|
|
230
|
-
max-width: 100%;
|
|
231
|
-
display: block;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
input, textarea, button, select {
|
|
235
|
-
font-family: inherit;
|
|
236
|
-
font-size: inherit;
|
|
237
|
-
margin: 0;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
table {
|
|
241
|
-
border-collapse: collapse;
|
|
242
|
-
border-spacing: 0;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
:target {
|
|
246
|
-
scroll-margin-block: 5ex;
|
|
247
|
-
}
|
|
248
|
-
```
|