vunor 0.1.2 → 0.1.4
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 +6 -11
- package/dist/AppLayout.mjs +0 -0
- package/dist/AppToasts.mjs +4 -8
- package/dist/Button.mjs +5 -10
- package/dist/ButtonBase.mjs +4 -8
- package/dist/Calendar.mjs +10 -14
- package/dist/Card.mjs +4 -9
- package/dist/CardHeader.mjs +5 -10
- package/dist/CardInner.mjs +4 -9
- package/dist/Checkbox.mjs +4 -8
- package/dist/Combobox.d.mts +9 -9
- package/dist/Combobox.mjs +5 -9
- package/dist/DatePicker.d.mts +9 -9
- package/dist/DatePicker.mjs +12 -17
- package/dist/DatePickerBase.d.mts +9 -9
- package/dist/DatePickerBase.mjs +13 -17
- package/dist/DatePickerInner.mjs +5 -9
- package/dist/DatePickerPopup.mjs +4 -8
- package/dist/DelayedSwitch.mjs +4 -9
- package/dist/DevTools.mjs +583 -150
- package/dist/Dialog.d.mts +6 -6
- package/dist/Dialog.mjs +4 -8
- package/dist/Icon.mjs +4 -9
- package/dist/InnerLoading.mjs +4 -8
- package/dist/Input.d.mts +13 -13
- package/dist/Input.mjs +4 -8
- package/dist/InputBase.d.mts +9 -9
- package/dist/InputBase.mjs +4 -8
- package/dist/Label.mjs +1 -4
- package/dist/LoadingIndicator.mjs +4 -8
- package/dist/Menu.d.mts +2 -2
- package/dist/Menu.mjs +5 -14
- package/dist/MenuItem.mjs +4 -9
- package/dist/OverflowContainer.mjs +4 -8
- package/dist/Pagination.mjs +4 -9
- package/dist/Popover.mjs +4 -9
- package/dist/ProgressBar.mjs +4 -9
- package/dist/RadioGroup.mjs +4 -8
- package/dist/Select.d.mts +9 -9
- package/dist/Select.mjs +4 -9
- package/dist/SelectBase.mjs +4 -8
- package/dist/Slider.mjs +4 -8
- package/dist/Tabs.mjs +4 -9
- package/dist/nuxt.mjs +1 -3
- package/dist/theme.d.mts +35 -0
- package/dist/theme.mjs +313 -336
- package/dist/utils-6bTTIoaw.js +40 -0
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +1 -4
- package/dist/vite.mjs +1 -2
- package/dist/vunor.d.mts +13 -13
- package/dist/vunor.mjs +1 -6
- package/package.json +30 -37
- package/scripts/setup-skills.js +0 -78
- package/skills/vunor/SKILL.md +0 -115
- package/skills/vunor/components.md +0 -320
- package/skills/vunor/core.md +0 -173
- package/skills/vunor/forms.md +0 -348
- package/skills/vunor/palette.md +0 -223
- package/skills/vunor/rules.md +0 -263
- package/skills/vunor/shortcuts.md +0 -239
- package/skills/vunor/typography.md +0 -204
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
# Typography & spacing — vunor
|
|
2
|
-
|
|
3
|
-
> Golden ratio type scale, spacing tokens, text margin utilities, fingertip sizes, and card spacing.
|
|
4
|
-
|
|
5
|
-
## Concepts
|
|
6
|
-
|
|
7
|
-
All dimensions in Vunor derive from the golden ratio (`k = 1.618`). Font sizes, line heights, spacing, border radii, and touch targets are computed as powers of `k`, producing a naturally harmonious scale.
|
|
8
|
-
|
|
9
|
-
Each typography level sets multiple CSS custom properties:
|
|
10
|
-
- `--font-size` — the em size
|
|
11
|
-
- `--font-corrected` — actual rendered glyph height (accounting for font metrics)
|
|
12
|
-
- `--font-bold` — bold weight for this level
|
|
13
|
-
- `--font-weight` — normal weight for this level
|
|
14
|
-
- `--font-bc` / `--font-tc` — bottom/top correction for precise vertical spacing
|
|
15
|
-
- `line-height`, `letter-spacing`
|
|
16
|
-
|
|
17
|
-
## API Reference
|
|
18
|
-
|
|
19
|
-
### Typography utilities
|
|
20
|
-
|
|
21
|
-
Applied as UnoCSS classes: `text-h1`, `text-body`, `text-label`, etc.
|
|
22
|
-
|
|
23
|
-
| Name | Scale (k^n) | ~Size | Weight | Bold | Line Height |
|
|
24
|
-
|------|-------------|-------|--------|------|-------------|
|
|
25
|
-
| `text-h1` | k^3.5 | ~3.33em | 400 | 700 | k^0.5 |
|
|
26
|
-
| `text-h2` | k^2.5 | ~2.06em | 400 | 700 | k^0.5 |
|
|
27
|
-
| `text-h3` | k^2 | ~1.62em | 400 | 700 | k^0.5 |
|
|
28
|
-
| `text-h4` | k^1 | ~1.24em | 400 | 600 | k^0.5 |
|
|
29
|
-
| `text-h5` | k^0.5 | ~1.10em | 400 | 600 | k^0.5 |
|
|
30
|
-
| `text-h6` | k^0.25 | ~1.05em | 600 | 700 | k^0.5 |
|
|
31
|
-
| `text-body` | k^0 | 1em | 400 | 600 | k^0.75 |
|
|
32
|
-
| `text-body-l` | k^0.5 | ~1.27em | 400 | 600 | k^0.75 |
|
|
33
|
-
| `text-body-s` | k^-0.5 | ~0.79em | 400 | 600 | k^1 |
|
|
34
|
-
| `text-label` | k^-0.25 | ~0.89em | 500 | 700 | k^0.5 |
|
|
35
|
-
| `text-caption` | k^-0.5 | ~0.79em | 400 | 600 | k^0.5 |
|
|
36
|
-
| `text-overline` | k^-0.5 | ~0.79em | 400 | 600 | k^0.5 |
|
|
37
|
-
| `text-subheading` | k^-0.2 | ~0.91em | 400 | 600 | k^0.75 |
|
|
38
|
-
| `text-callout` | k^-0.25 | ~0.89em | 400 | 600 | k^0.5 |
|
|
39
|
-
|
|
40
|
-
```html
|
|
41
|
-
<h1 class="text-h1">Large heading</h1>
|
|
42
|
-
<p class="text-body">Regular paragraph</p>
|
|
43
|
-
<span class="text-caption">Small caption</span>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Typography overrides
|
|
47
|
-
|
|
48
|
-
Override individual entries in `presetVunor`:
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
presetVunor({
|
|
52
|
-
typography: {
|
|
53
|
-
h1: { size: 4, weight: 300, boldWeight: 700 },
|
|
54
|
-
body: { height: 1.75 }, // taller line-height
|
|
55
|
-
label: { weight: 600 },
|
|
56
|
-
},
|
|
57
|
-
})
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Each entry accepts: `size` (em), `weight`, `boldWeight`, `height` (line-height), `letterSpacing`.
|
|
61
|
-
|
|
62
|
-
### Spacing tokens
|
|
63
|
-
|
|
64
|
-
Golden ratio spacing progression, used as UnoCSS utilities:
|
|
65
|
-
|
|
66
|
-
| Token | Scale | ~Value |
|
|
67
|
-
|-------|-------|--------|
|
|
68
|
-
| `$xxs` | 1/k^3 | 0.24em |
|
|
69
|
-
| `$xs` | 1/k^2 | 0.38em |
|
|
70
|
-
| `$s` | 1/k | 0.62em |
|
|
71
|
-
| `$m` | 1 | 1em |
|
|
72
|
-
| `$l` | k | 1.62em |
|
|
73
|
-
| `$xl` | k^2 | 2.62em |
|
|
74
|
-
| `$xxl` | k^3 | 4.24em |
|
|
75
|
-
|
|
76
|
-
```html
|
|
77
|
-
<div class="p-$m">Standard padding (1em)</div>
|
|
78
|
-
<div class="p-$s gap-$xs">Smaller padding, tiny gap</div>
|
|
79
|
-
<div class="m-$l">Large margin</div>
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Works with all standard UnoCSS spacing utilities: `p-`, `m-`, `gap-`, `px-`, `py-`, `mx-`, `my-`, etc.
|
|
83
|
-
|
|
84
|
-
### Text-aware margins
|
|
85
|
-
|
|
86
|
-
#### `text-mt-{size}` / `text-mb-{size}` / `text-my-{size}`
|
|
87
|
-
|
|
88
|
-
Text margin utilities that compensate for line-height to maintain optically correct spacing. They use `--font-tc` (top correction) and `--font-bc` (bottom correction) to adjust margins.
|
|
89
|
-
|
|
90
|
-
```html
|
|
91
|
-
<h1 class="text-h1 text-mb-$m">Title</h1>
|
|
92
|
-
<p class="text-body text-mt-$s">Paragraph with optically corrected spacing</p>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Fingertip (touch target) sizes
|
|
96
|
-
|
|
97
|
-
Interactive elements default to `--v-fingertip` for accessibility. Configurable sizes:
|
|
98
|
-
|
|
99
|
-
| Class | Default | Purpose |
|
|
100
|
-
|-------|---------|---------|
|
|
101
|
-
| `fingertip-xs` | ~1.24em | Compact controls |
|
|
102
|
-
| `fingertip-s` | ~1.85em | Small buttons |
|
|
103
|
-
| `fingertip` / `fingertip-m` | 3em (~48px) | Standard touch target |
|
|
104
|
-
| `fingertip-l` | 3.5em | Large buttons |
|
|
105
|
-
| `fingertip-xl` | 4em | Extra-large targets |
|
|
106
|
-
|
|
107
|
-
```html
|
|
108
|
-
<button class="h-fingertip">Standard height</button>
|
|
109
|
-
<button class="fingertip-xs h-fingertip">Compact height</button>
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Components like `VuButton` and `VuInput` use `h-fingertip` by default.
|
|
113
|
-
|
|
114
|
-
Override in preset:
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
presetVunor({
|
|
118
|
-
fingertip: { xs: '1.25em', s: '2em', m: '3em', l: '3.5em', xl: '4em' },
|
|
119
|
-
})
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Card spacing
|
|
123
|
-
|
|
124
|
-
#### `card-{typography}`
|
|
125
|
-
|
|
126
|
-
Sets `--card-spacing` proportional to the heading's corrected font size. Use on `<VuCard>` via the `level` prop.
|
|
127
|
-
|
|
128
|
-
```html
|
|
129
|
-
<VuCard level="h3">
|
|
130
|
-
<VuCardHeader>Section Title</VuCardHeader>
|
|
131
|
-
<p>Content with h3-proportional padding</p>
|
|
132
|
-
</VuCard>
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Valid values: `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `subheading`, `body`, `body-l`, `body-s`, `callout`, `label`, `caption`, `overline`.
|
|
136
|
-
|
|
137
|
-
#### `card-dense`
|
|
138
|
-
|
|
139
|
-
Reduces card spacing to 60% of normal (configurable via `cardSpacingFactor.dense`).
|
|
140
|
-
|
|
141
|
-
```html
|
|
142
|
-
<VuCard level="h4" dense>Compact card</VuCard>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Border radius
|
|
146
|
-
|
|
147
|
-
Default border radius is `0.618em` (1/golden-ratio). Override globally:
|
|
148
|
-
|
|
149
|
-
```ts
|
|
150
|
-
presetVunor({
|
|
151
|
-
baseRadius: '0.5em', // or any CSS length
|
|
152
|
-
})
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Applied via the `rounded-base` utility class.
|
|
156
|
-
|
|
157
|
-
## Common patterns
|
|
158
|
-
|
|
159
|
-
### Pattern: Heading + body with harmonious spacing
|
|
160
|
-
|
|
161
|
-
```html
|
|
162
|
-
<article>
|
|
163
|
-
<h2 class="text-h2 text-mb-$s">Article Title</h2>
|
|
164
|
-
<p class="text-body text-mb-$m">First paragraph...</p>
|
|
165
|
-
<p class="text-body text-mb-$m">Second paragraph...</p>
|
|
166
|
-
</article>
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Pattern: Card with typography-driven spacing
|
|
170
|
-
|
|
171
|
-
```html
|
|
172
|
-
<VuCard level="h3">
|
|
173
|
-
<VuCardHeader>Dashboard</VuCardHeader>
|
|
174
|
-
<div class="flex flex-col gap-$s">
|
|
175
|
-
<p class="text-body">Card padding scales with the h3 heading.</p>
|
|
176
|
-
</div>
|
|
177
|
-
</VuCard>
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Pattern: Dense layout
|
|
181
|
-
|
|
182
|
-
```html
|
|
183
|
-
<div class="fingertip-xs">
|
|
184
|
-
<VuCard level="body" dense>
|
|
185
|
-
<div class="flex gap-$xxs">
|
|
186
|
-
<!-- Compact controls and tight spacing -->
|
|
187
|
-
</div>
|
|
188
|
-
</VuCard>
|
|
189
|
-
</div>
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## Best practices
|
|
193
|
-
|
|
194
|
-
- Use `text-mt-*` and `text-mb-*` instead of plain `mt-*` / `mb-*` for spacing between typographic elements — they compensate for line-height optical differences.
|
|
195
|
-
- Use spacing tokens (`$s`, `$m`, `$l`) instead of arbitrary values — they maintain the golden ratio relationship.
|
|
196
|
-
- Set `level` on `VuCard` to match the most prominent heading inside — this auto-calculates harmonious padding.
|
|
197
|
-
- Don't mix pixel-based spacing with the token system — the tokens are em-based and scale with font size.
|
|
198
|
-
|
|
199
|
-
## Gotchas
|
|
200
|
-
|
|
201
|
-
- Spacing tokens use `$` prefix (e.g., `p-$m`), not bare names. `p-m` is a standard UnoCSS utility (medium), not a Vunor token.
|
|
202
|
-
- `text-h1` through `text-caption` set multiple CSS properties, not just `font-size`. Overriding `font-size` directly may break spacing calculations.
|
|
203
|
-
- `--font-corrected` depends on `actualFontHeightFactor` in the preset. If your font renders significantly taller/shorter than the default, adjust this factor for correct spacing.
|
|
204
|
-
- Card spacing is relative to the heading size — a `card-h1` has much larger padding than `card-body`. This is intentional but can be surprising.
|