sm · 22px
md · 30px
lg · 36px
<button wr-btn type="button" size="sm">Small</button>
<input wrInput size="md" />
<wr-select size="lg">…</wr-select>Size and round your own controls with ngwr's tokens.
Every form control takes size: sm (22px), md (30px, default) or lg (36px).
<button wr-btn type="button" size="sm">Small</button>
<input wrInput size="md" />
<wr-select size="lg">…</wr-select>Height is the line-height, plus the vertical padding twice, plus a 1px border on each side.
| Token | sm / md / lg |
|---|---|
--wr-control-padding-y-{size} | 2px / 4px / 5px |
--wr-control-padding-x-{size} | 8px / 12px / 16px |
--wr-control-line-height-{size} | 16px / 20px / 24px |
--wr-control-font-size-{size} | 12px / 14px / 16px |
--wr-control-radius-{size} | 5px / 6px / 7px |
.my-control {
padding: calc(var(--wr-control-padding-y-md) * var(--wr-density-y, 1))
calc(var(--wr-control-padding-x-md) * var(--wr-density-x, 1));
line-height: var(--wr-control-line-height-md);
font-size: var(--wr-control-font-size-md);
border: 1px solid var(--wr-border-base);
border-radius: var(--wr-control-radius-md);
}One scale for padding, margin and gap.
| Token | Value |
|---|---|
--wr-space-xs | 0.25rem |
--wr-space-sm | 0.5rem |
--wr-space-md | 0.75rem |
--wr-space-lg | 1rem |
--wr-space-xl | 1.5rem |
Panels and overlays use these; for a circle use 50%.
| Token | Value | Use |
|---|---|---|
--wr-border-radius-sm | 0.375rem | Rows inside a panel |
--wr-border-radius-base | 0.625rem | Cards, dropdowns, dialogs, toasts |
--wr-border-radius-lg | 1rem | Large surfaces |
--wr-border-radius-pill | 50rem | Pill ends: tags, pill buttons |
--wr-disabled-opacity (default 0.6) sets how far a disabled control fades.