Foundations

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";
HandleUnitsValue
space.pxhairline1px
space.s0_5× 0.52px
space.s1× 14px
space.s1_5× 1.56px
space.s2× 28px
space.s2_5× 2.510px
space.s3× 312px
space.s4× 416px
space.s5× 520px
space.s6× 624px
space.s8× 832px

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, or target.
  • Visual size and hit area are separate. A control stays at least target.min to hit: 24px, or 44px under a coarse pointer. Independent controls sit target.gap apart: 2px, or 8px.
  • Use logical properties: paddingInline, marginBlockStart, insetInlineEnd.

Targets

PartTokenValue
Minimum hit area--nyte-target-min24px · touch 44px
Gap between controls--nyte-target-gap2px · touch 8px