@gitbutler/design-core 1.0.2 → 1.0.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 +59 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,47 +1,81 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gitbutler/design-core
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
We use [Terrazzo](https://terrazzo.app/) to generate CSS custom properties from design tokens.
|
|
3
|
+
Design tokens and fonts for GitButler applications. This package provides CSS custom properties, design tokens in JSON format, and web fonts used across GitButler products.
|
|
5
4
|
|
|
6
5
|
## Installation
|
|
7
6
|
|
|
8
7
|
```bash
|
|
9
|
-
npm install
|
|
8
|
+
npm install @gitbutler/design-core
|
|
10
9
|
```
|
|
11
10
|
|
|
12
11
|
## Usage
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
### Design Tokens (CSS)
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
Import the design tokens CSS file:
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
@import '@gitbutler/design-core/tokens';
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
Or in JavaScript/TypeScript:
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
```javascript
|
|
24
|
+
import '@gitbutler/design-core/tokens';
|
|
25
|
+
```
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
This provides CSS custom properties for colors, spacing, typography, and other design tokens with automatic light/dark mode support.
|
|
28
|
+
|
|
29
|
+
### Design Tokens (JSON)
|
|
30
|
+
|
|
31
|
+
Import the raw design tokens data:
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
import tokens from '@gitbutler/design-core/tokens.json';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Fonts
|
|
38
|
+
|
|
39
|
+
Import all fonts:
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
@import '@gitbutler/design-core/fonts';
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or import individual font families:
|
|
46
|
+
|
|
47
|
+
```css
|
|
48
|
+
@import '@gitbutler/design-core/fonts/inter/Inter-Regular.woff2';
|
|
49
|
+
@import '@gitbutler/design-core/fonts/geist-mono/GeistMono-Regular.woff2';
|
|
50
|
+
@import '@gitbutler/design-core/fonts/but-head/But-Head-Regular.woff2';
|
|
51
|
+
@import '@gitbutler/design-core/fonts/pp-editorial/PPEditorialNew-Regular.woff2';
|
|
26
52
|
```
|
|
27
53
|
|
|
28
|
-
##
|
|
54
|
+
## Available Exports
|
|
55
|
+
|
|
56
|
+
- `@gitbutler/design-core/tokens` - CSS custom properties
|
|
57
|
+
- `@gitbutler/design-core/tokens.json` - Design tokens as JSON
|
|
58
|
+
- `@gitbutler/design-core/fonts` - All font CSS declarations
|
|
59
|
+
- `@gitbutler/design-core/fonts/*` - Individual font files
|
|
29
60
|
|
|
30
|
-
|
|
31
|
-
- `tokens/design-tokens.css` - CSS custom properties with light and dark mode support
|
|
32
|
-
- Formatted JSON and CSS files with prettier
|
|
61
|
+
## Included Fonts
|
|
33
62
|
|
|
34
|
-
|
|
63
|
+
- **Inter** - Primary UI font family
|
|
64
|
+
- **Geist Mono** - Monospace font for code
|
|
65
|
+
- **But Head** - Brand display font
|
|
66
|
+
- **PP Editorial** - Editorial content font
|
|
35
67
|
|
|
36
|
-
|
|
68
|
+
## Development
|
|
37
69
|
|
|
38
|
-
|
|
39
|
-
2. Reference the CSS custom properties in your stylesheets
|
|
40
|
-
3. The tokens support both light and dark themes through CSS selectors
|
|
70
|
+
This package uses [Terrazzo](https://terrazzo.app/) to generate CSS custom properties from design tokens.
|
|
41
71
|
|
|
42
|
-
|
|
72
|
+
```bash
|
|
73
|
+
# Install dependencies
|
|
74
|
+
npm install
|
|
75
|
+
|
|
76
|
+
# Build tokens
|
|
77
|
+
npm run build
|
|
43
78
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- Custom variable naming (removes `fx.` prefixes)
|
|
79
|
+
# Watch for changes
|
|
80
|
+
npm run dev
|
|
81
|
+
```
|