@gnome-ui/core 0.1.0 → 1.1.0
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 +90 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# @gnome-ui/core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic CSS design tokens for the GNOME UI design system, based on the [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/) and the [Adwaita](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/css-variables.html) design language.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@gnome-ui/core)
|
|
6
|
+
[](../../LICENSE)
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @gnome-ui/core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Import the tokens once at the root of your app:
|
|
17
|
+
|
|
18
|
+
```css
|
|
19
|
+
@import "@gnome-ui/core/styles";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import "@gnome-ui/core/styles";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
All tokens are then available as CSS custom properties:
|
|
27
|
+
|
|
28
|
+
```css
|
|
29
|
+
.my-button {
|
|
30
|
+
background-color: var(--gnome-accent-bg-color);
|
|
31
|
+
color: var(--gnome-accent-fg-color);
|
|
32
|
+
border-radius: var(--gnome-radius-md);
|
|
33
|
+
font-family: var(--gnome-font-family);
|
|
34
|
+
padding: var(--gnome-space-1) var(--gnome-space-2);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Token reference
|
|
39
|
+
|
|
40
|
+
### Colors
|
|
41
|
+
|
|
42
|
+
| Token | Light | Dark |
|
|
43
|
+
|-------|-------|------|
|
|
44
|
+
| `--gnome-accent-bg-color` | `#3584e4` | `#3584e4` |
|
|
45
|
+
| `--gnome-destructive-bg-color` | `#e01b24` | `#e01b24` |
|
|
46
|
+
| `--gnome-success-bg-color` | `#2ec27e` | `#2ec27e` |
|
|
47
|
+
| `--gnome-warning-bg-color` | `#f6d32d` | `#f6d32d` |
|
|
48
|
+
| `--gnome-window-bg-color` | `#fafafa` | `#242424` |
|
|
49
|
+
| `--gnome-window-fg-color` | `rgba(0,0,0,.8)` | `rgba(255,255,255,.87)` |
|
|
50
|
+
| `--gnome-card-bg-color` | `#ffffff` | `#383838` |
|
|
51
|
+
| `--gnome-headerbar-bg-color` | `#ebebeb` | `#303030` |
|
|
52
|
+
|
|
53
|
+
### Spacing (6px grid)
|
|
54
|
+
|
|
55
|
+
| Token | Value |
|
|
56
|
+
|-------|-------|
|
|
57
|
+
| `--gnome-space-1` | `6px` |
|
|
58
|
+
| `--gnome-space-2` | `12px` |
|
|
59
|
+
| `--gnome-space-3` | `18px` |
|
|
60
|
+
| `--gnome-space-4` | `24px` |
|
|
61
|
+
| `--gnome-space-5` | `36px` |
|
|
62
|
+
| `--gnome-space-6` | `48px` |
|
|
63
|
+
|
|
64
|
+
### Border radius
|
|
65
|
+
|
|
66
|
+
| Token | Value | Use |
|
|
67
|
+
|-------|-------|-----|
|
|
68
|
+
| `--gnome-radius-sm` | `4px` | Small elements |
|
|
69
|
+
| `--gnome-radius-md` | `8px` | Default |
|
|
70
|
+
| `--gnome-radius-lg` | `12px` | Cards, popovers |
|
|
71
|
+
| `--gnome-radius-xl` | `15px` | Windows |
|
|
72
|
+
| `--gnome-radius-pill` | `9999px` | Pill/circular buttons |
|
|
73
|
+
|
|
74
|
+
### Typography
|
|
75
|
+
|
|
76
|
+
| Token | Value |
|
|
77
|
+
|-------|-------|
|
|
78
|
+
| `--gnome-font-family` | `"Adwaita Sans", Cantarell, "Inter", system-ui, sans-serif` |
|
|
79
|
+
| `--gnome-font-size-body` | `1rem` |
|
|
80
|
+
| `--gnome-font-size-title-4` | `1.125rem` |
|
|
81
|
+
| `--gnome-font-size-title-3` | `1.25rem` |
|
|
82
|
+
| `--gnome-font-size-title-2` | `1.5rem` |
|
|
83
|
+
| `--gnome-font-size-title-1` | `1.875rem` |
|
|
84
|
+
| `--gnome-font-size-large-title` | `2.25rem` |
|
|
85
|
+
|
|
86
|
+
Dark mode is handled automatically via `@media (prefers-color-scheme: dark)`.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
[MIT](../../LICENSE)
|