@new-ui/foundations 0.3.2 → 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 +118 -114
- 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,37 +15,39 @@ 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
|
|
37
|
-
|
|
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` |
|
|
38
41
|
|
|
39
42
|
#### Utility classes, naming convention
|
|
43
|
+
|
|
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
|
|
|
@@ -51,116 +55,116 @@ Dark cold | `dark--cold`
|
|
|
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
|
-
Link
|
|
80
|
-
|
|
81
|
-
**`--link`**
|
|
82
|
-
**`--link-hover`**
|
|
83
|
-
**`--link-subtle`**
|
|
84
|
-
**`--link-visited`** | Link visited
|
|
85
|
-
|
|
86
|
-
Support
|
|
87
|
-
|
|
88
|
-
**`--support-error`**
|
|
89
|
-
**`--support-warning`** | Warning
|
|
90
|
-
**`--support-success`** | Success
|
|
91
|
-
**`--support-info`**
|
|
92
|
-
|
|
93
|
-
Content
|
|
94
|
-
|
|
95
|
-
**`--content-primary`**
|
|
96
|
-
**`--content-secondary`**
|
|
97
|
-
**`--content-secondary-alt`** | Secondary text color alt
|
|
98
|
-
**`--content-placeholder`**
|
|
99
|
-
**`--content-on-color`**
|
|
100
|
-
**`--content-error`**
|
|
101
|
-
**`--content-success`**
|
|
102
|
-
**`--content-inked`**
|
|
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 |
|
|
103
107
|
|
|
104
108
|
#### Effects
|
|
105
109
|
|
|
106
|
-
Shadows
|
|
107
|
-
|
|
108
|
-
**`--dialog-strong`** | Modals, sidebar overlays, toasts
|
|
109
|
-
**`--dialog`**
|
|
110
|
-
**`--content`**
|
|
111
|
-
**`--canvas`**
|
|
112
|
-
**`--keyboard-key`**
|
|
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 |
|
|
113
117
|
|
|
114
|
-
Focus
|
|
115
|
-
|
|
116
|
-
**`--focus-default`** | Default focus
|
|
117
|
-
**`--focus-accent`**
|
|
118
|
-
**`--focus-inverse`** | Focus inverse
|
|
118
|
+
| Focus | Role |
|
|
119
|
+
| :-------------------- | :------------ |
|
|
120
|
+
| **`--focus-default`** | Default focus |
|
|
121
|
+
| **`--focus-accent`** | Accent focus |
|
|
122
|
+
| **`--focus-inverse`** | Focus inverse |
|
|
119
123
|
|
|
120
124
|
#### Spacings
|
|
121
125
|
|
|
122
|
-
Token
|
|
123
|
-
|
|
124
|
-
**`--spacing-zero`** | `--spacing-00` | 0 / 0
|
|
125
|
-
**`--spacing-xs`**
|
|
126
|
-
**`--spacing-s`**
|
|
127
|
-
**`--spacing-m`**
|
|
128
|
-
**`--spacing-l`**
|
|
129
|
-
**`--spacing-xl`**
|
|
130
|
-
**`--spacing-xxl`**
|
|
131
|
-
**`--spacing-xxxl`** | `--spacing-11` | 48 / 3
|
|
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 |
|
|
132
136
|
|
|
133
137
|
#### Sizing
|
|
134
138
|
|
|
135
|
-
Token
|
|
136
|
-
|
|
137
|
-
**`--size-xs`**
|
|
138
|
-
**`--size-s`**
|
|
139
|
-
**`--size-m`**
|
|
140
|
-
**`--controls-size-default`** | `--spacing-09` | 32 / 2
|
|
141
|
-
**`--controls-size-small`**
|
|
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 |
|
|
142
146
|
|
|
143
147
|
#### Typography
|
|
144
148
|
|
|
145
|
-
Heading (Desktop)
|
|
146
|
-
|
|
147
|
-
**`--desktop-heading-01`** | **`--mobile-heading-01`** | Heading 01
|
|
148
|
-
**`--desktop-heading-02`** | **`--mobile-heading-02`** | Heading 02
|
|
149
|
-
**`--desktop-heading-03`** | **`--mobile-heading-03`** | Heading 03
|
|
150
|
-
**`--desktop-heading-04`** | **`--mobile-heading-04`** | Heading 04
|
|
151
|
-
**`--desktop-heading-05`** | **`--mobile-heading-05`** | Heading 05
|
|
152
|
-
**`--desktop-heading-06`** | **`--mobile-heading-06`** | Heading 06
|
|
153
|
-
|
|
154
|
-
Body (Desktop)
|
|
155
|
-
|
|
156
|
-
**`--desktop-body-xl`** | **`--mobile-body-xl`** | Body large
|
|
157
|
-
**`--desktop-body`**
|
|
158
|
-
**`--desktop-body-sm`** | **`--mobile-body-sm`** | Body small
|
|
159
|
-
|
|
160
|
-
Utility (Desktop)
|
|
161
|
-
|
|
162
|
-
**`--desktop-caption`**
|
|
163
|
-
**`--desktop-helper-text`** | **`--mobile-helper-text`** | Helper text
|
|
164
|
-
**`--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 |
|
|
165
169
|
|
|
166
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`.
|