Spacing
One 4px unit, Tailwind's steps, and named structural measurements
Spacing counts 4px units the way Tailwind does: s2 is two units, s1_5 is one and a half.
space.px is a hairline.
import { space, target } from "@nyte-ai/ui/styles/schema.stylex";| Handle | Units | Value | |
|---|---|---|---|
space.px | hairline | 1px | |
space.s0_5 | × 0.5 | 2px | |
space.s1 | × 1 | 4px | |
space.s1_5 | × 1.5 | 6px | |
space.s2 | × 2 | 8px | |
space.s2_5 | × 2.5 | 10px | |
space.s3 | × 3 | 12px | |
space.s4 | × 4 | 16px | |
space.s5 | × 5 | 20px | |
space.s6 | × 6 | 24px | |
space.s8 | × 8 | 32px |
Rules
- Padding, margin, gap, and inset use
space.*. - A structural measurement, such as a sidebar width or a menu width, gets a name in a schema file instead of a literal.
- Controls and rows take their height from
button,input,row,menu, ortarget. - Visual size and hit area are separate. A control stays at least
target.minto hit: 24px, or 44px under a coarse pointer. Independent controls sittarget.gapapart: 2px, or 8px. - Use logical properties:
paddingInline,marginBlockStart,insetInlineEnd.
Targets
| Part | Token | Value |
|---|---|---|
| Minimum hit area | --nyte-target-min | 24px · touch 44px |
| Gap between controls | --nyte-target-gap | 2px · touch 8px |