4.1 Text input
The workhorse. 1px hair border, 6px radius, 14.5px DM Sans. Focus lights up pink with a soft ring. Always paired with a visible label — never rely on placeholder alone.
Label + input + hint
<input class='input'><label class="input-wrap">
<span class="input-label">Work email</span>
<input class="input" type="email"
placeholder="jay@magicblocks.ai">
<span class="input-hint">We'll send a verification link.</span>
</label>
.input-wrap { display: flex; flex-direction: column; gap: 6px; }
.input-label {
font: 500 13px/1.3 var(--f-body);
color: var(--fg);
}
.input-hint { font: 400 12.5px/1.4 var(--f-body); color: var(--fg-dim); }
.input-error { font: 500 12.5px/1.4 var(--f-body); color: var(--error-text); display: inline-flex; align-items: center; gap: 4px; }
.input-success { font: 500 12.5px/1.4 var(--f-body); color: var(--success-text); display: inline-flex; align-items: center; gap: 4px; }
.input {
width: 100%;
font: 400 14.5px/1.4 var(--f-body);
color: var(--fg);
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-sm);
padding: 10px 14px;
transition: border-color var(--dur-2) var(--ease),
box-shadow var(--dur-2) var(--ease);
appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--fg-faint); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--fg-dim); }
.input:focus {
outline: 0;
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
.input:disabled { background: var(--bg-sunk); color: var(--fg-dim); cursor: not-allowed; }
.input-wrap.is-error .input { border-color: var(--error); }
.input-wrap.is-error .input:focus { box-shadow: 0 0 0 3px var(--error-soft); }
.input-wrap.is-success .input { border-color: var(--success); }4.2 Icons, prefixes, suffixes
Leading icons clarify intent (mail, search). Trailing buttons affect the input (show password, clear). Prefix/suffix chips handle URLs, currency, units.
Input group
.input-group.input-wrap { display: flex; flex-direction: column; gap: 6px; }
.input-label {
font: 500 13px/1.3 var(--f-body);
color: var(--fg);
}
.input-hint { font: 400 12.5px/1.4 var(--f-body); color: var(--fg-dim); }
.input-error { font: 500 12.5px/1.4 var(--f-body); color: var(--error-text); display: inline-flex; align-items: center; gap: 4px; }
.input-success { font: 500 12.5px/1.4 var(--f-body); color: var(--success-text); display: inline-flex; align-items: center; gap: 4px; }
.input {
width: 100%;
font: 400 14.5px/1.4 var(--f-body);
color: var(--fg);
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-sm);
padding: 10px 14px;
transition: border-color var(--dur-2) var(--ease),
box-shadow var(--dur-2) var(--ease);
appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--fg-faint); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--fg-dim); }
.input:focus {
outline: 0;
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
.input:disabled { background: var(--bg-sunk); color: var(--fg-dim); cursor: not-allowed; }
.input-wrap.is-error .input { border-color: var(--error); }
.input-wrap.is-error .input:focus { box-shadow: 0 0 0 3px var(--error-soft); }
.input-wrap.is-success .input { border-color: var(--success); }
.input-group {
position: relative;
display: flex;
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-sm);
transition: border-color var(--dur-2) var(--ease),
box-shadow var(--dur-2) var(--ease);
}
.input-group:focus-within {
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
.input-group .input {
border: 0; background: transparent;
}
.input-group .input:focus { box-shadow: none; }
.input-affix {
position: absolute; top: 0; bottom: 0;
display: inline-flex; align-items: center; justify-content: center;
width: 38px; color: var(--fg-dim);
pointer-events: none;
}
.input-group .input-affix:first-child { left: 0; }
.input-group .input-affix:last-child { right: 0; }
.input-affix-btn { pointer-events: auto; background: transparent; border: 0; cursor: pointer; border-radius: var(--r-xs); }
.input-affix-btn:hover { color: var(--fg); }
.input.has-leading { padding-left: 38px; }
.input.has-trailing { padding-right: 38px; }
.input-prefix, .input-suffix {
display: inline-flex; align-items: center;
padding: 0 12px;
font: 400 14px/1 var(--f-mono);
color: var(--fg-dim);
background: var(--bg-sunk);
border-right: 1px solid var(--hair);
}
.input-suffix { border-right: 0; border-left: 1px solid var(--hair); }
.input.has-prefix { padding-left: 12px; }4.3 States
Every input moves through six states. Error wins all ties — if a field is both error and focused, show the error. Success is confirmation only, not a default.
Default · focus · success · error · disabled · read-only
Six states.input-wrap { display: flex; flex-direction: column; gap: 6px; }
.input-label {
font: 500 13px/1.3 var(--f-body);
color: var(--fg);
}
.input-hint { font: 400 12.5px/1.4 var(--f-body); color: var(--fg-dim); }
.input-error { font: 500 12.5px/1.4 var(--f-body); color: var(--error-text); display: inline-flex; align-items: center; gap: 4px; }
.input-success { font: 500 12.5px/1.4 var(--f-body); color: var(--success-text); display: inline-flex; align-items: center; gap: 4px; }
.input {
width: 100%;
font: 400 14.5px/1.4 var(--f-body);
color: var(--fg);
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-sm);
padding: 10px 14px;
transition: border-color var(--dur-2) var(--ease),
box-shadow var(--dur-2) var(--ease);
appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--fg-faint); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--fg-dim); }
.input:focus {
outline: 0;
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
.input:disabled { background: var(--bg-sunk); color: var(--fg-dim); cursor: not-allowed; }
.input-wrap.is-error .input { border-color: var(--error); }
.input-wrap.is-error .input:focus { box-shadow: 0 0 0 3px var(--error-soft); }
.input-wrap.is-success .input { border-color: var(--success); }
.input.is-focus-demo {
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
/* warm-3 wash to match the disabled state — bg-sunk reads too heavy on white. */
.input.is-readonly { background: var(--warm-3); color: var(--fg-soft); }
body[data-theme="dark"] .input.is-readonly { background: var(--bg-sunk); }4.4 Textarea
Resize vertical only. Pair with a character counter on the trailing side when there's a real limit.
Textarea
.textarea.input-wrap { display: flex; flex-direction: column; gap: 6px; }
.input-label {
font: 500 13px/1.3 var(--f-body);
color: var(--fg);
}
.input-hint { font: 400 12.5px/1.4 var(--f-body); color: var(--fg-dim); }
.input-error { font: 500 12.5px/1.4 var(--f-body); color: var(--error-text); display: inline-flex; align-items: center; gap: 4px; }
.input-success { font: 500 12.5px/1.4 var(--f-body); color: var(--success-text); display: inline-flex; align-items: center; gap: 4px; }
.input {
width: 100%;
font: 400 14.5px/1.4 var(--f-body);
color: var(--fg);
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-sm);
padding: 10px 14px;
transition: border-color var(--dur-2) var(--ease),
box-shadow var(--dur-2) var(--ease);
appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--fg-faint); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--fg-dim); }
.input:focus {
outline: 0;
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
.input:disabled { background: var(--bg-sunk); color: var(--fg-dim); cursor: not-allowed; }
.input-wrap.is-error .input { border-color: var(--error); }
.input-wrap.is-error .input:focus { box-shadow: 0 0 0 3px var(--error-soft); }
.input-wrap.is-success .input { border-color: var(--success); }
.textarea {
resize: vertical;
min-height: 96px;
line-height: 1.55;
font-family: var(--f-body);
}
.input-meta {
display: flex; justify-content: space-between; align-items: center;
gap: var(--s-4);
}
.input-counter { font-size: 12px; color: var(--fg-dim); }4.5 Select
Native <select> styled to match. Keeps accessibility + mobile keyboards intact, wins every tradeoff.
Styled native select
.select-wrap > select.input-wrap { display: flex; flex-direction: column; gap: 6px; }
.input-label {
font: 500 13px/1.3 var(--f-body);
color: var(--fg);
}
.input-hint { font: 400 12.5px/1.4 var(--f-body); color: var(--fg-dim); }
.input-error { font: 500 12.5px/1.4 var(--f-body); color: var(--error-text); display: inline-flex; align-items: center; gap: 4px; }
.input-success { font: 500 12.5px/1.4 var(--f-body); color: var(--success-text); display: inline-flex; align-items: center; gap: 4px; }
.input {
width: 100%;
font: 400 14.5px/1.4 var(--f-body);
color: var(--fg);
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-sm);
padding: 10px 14px;
transition: border-color var(--dur-2) var(--ease),
box-shadow var(--dur-2) var(--ease);
appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--fg-faint); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--fg-dim); }
.input:focus {
outline: 0;
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
.input:disabled { background: var(--bg-sunk); color: var(--fg-dim); cursor: not-allowed; }
.input-wrap.is-error .input { border-color: var(--error); }
.input-wrap.is-error .input:focus { box-shadow: 0 0 0 3px var(--error-soft); }
.input-wrap.is-success .input { border-color: var(--success); }
.select-wrap { position: relative; display: block; }
.select {
padding-right: 44px;
cursor: pointer;
appearance: none; -webkit-appearance: none; -moz-appearance: none;
background-image: none;
min-width: 0;
text-overflow: ellipsis;
}
.select::-moz-focus-inner { border: 0; }
.select-chevron {
position: absolute; right: 14px; top: 50%;
transform: translateY(-50%);
width: 16px; height: 16px;
color: var(--fg-dim); pointer-events: none;
transition: color var(--dur-2) var(--ease);
display: inline-flex;
}
.select-wrap:focus-within .select-chevron { color: var(--accent-text); }4.6 Search field
Pill-shaped, leading icon, optional keyboard shortcut chip. The large variant is the brand-kit search at the top of brand.magicblocks.ai.
Search
.search-field.search-field {
display: inline-flex; align-items: center;
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-pill);
padding: 0 var(--s-4) 0 var(--s-5);
height: 40px;
gap: var(--s-3);
min-width: 320px; max-width: 100%;
transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.search-field:focus-within { border-color: var(--accent); box-shadow: var(--sh-focus); }
.search-icon { color: var(--fg-dim); display: inline-flex; }
.search-input {
flex: 1; border: 0; background: transparent;
font: 400 14.5px/1.4 var(--f-body); color: var(--fg);
outline: 0;
/* Strip native search-input chrome — without these, WebKit shows its
own inner focus ring inside the .search-field's outer halo
("two rings" look). */
appearance: none; -webkit-appearance: none;
}
.search-input:focus { box-shadow: none; }
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration { -webkit-appearance: none; }
.search-input::placeholder { color: var(--fg-faint); }
.search-kbd {
font-family: var(--f-mono); font-size: 11px;
padding: 2px 7px; color: var(--fg-dim);
background: var(--bg-sunk);
border: 1px solid var(--hair);
border-radius: var(--r-xs);
}
.search-field-lg {
height: 52px;
border-radius: var(--r-lg);
padding: 0 var(--s-6) 0 var(--s-6);
font-size: 16px;
min-width: min(420px, 100%);
width: 100%;
max-width: 520px;
}
.search-field-lg .search-input { font-size: 16px; }4.7 File upload & dropzone
A warm dropzone with dashed hair border. Uploaded files collapse into a chip showing icon + name + size + remove.
Dropzone + file chip
.dropzone · .file-chip.dropzone {
display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: var(--s-2);
padding: var(--s-9) var(--s-7);
background: var(--bg-paper);
border: 1.5px dashed var(--hair);
border-radius: var(--r-lg);
color: var(--fg);
cursor: pointer;
text-align: center;
min-width: 320px; max-width: 460px;
transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.dropzone:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 4%, var(--bg-paper)); }
.dropzone-icon { color: var(--accent-text); margin-bottom: var(--s-1); }
.dropzone-title { font: 600 16px/1.3 var(--f-display); }
.dropzone-hint { font: 400 13px/1.4 var(--f-body); color: var(--fg-soft); }
.dropzone-hint span { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.file-chip {
display: inline-flex; align-items: center; gap: var(--s-3);
padding: var(--s-3) var(--s-4);
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-md);
min-width: 280px;
}
.file-chip-icon {
width: 36px; height: 36px; border-radius: var(--r-sm);
background: var(--accent-soft); color: var(--accent-text);
display: inline-flex; align-items: center; justify-content: center;
font-size: 16px;
}
.file-chip-meta { flex: 1; min-width: 0; }
.file-chip-name {
font: 600 13.5px/1.3 var(--f-body); color: var(--fg);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-chip-size { font: 400 11.5px/1.3 var(--f-mono); color: var(--fg-dim); }
.file-chip-x {
width: 24px; height: 24px;
background: transparent; border: 0; color: var(--fg-dim);
border-radius: 50%; cursor: pointer; font-size: 18px;
}
.file-chip-x:hover { background: var(--bg-sunk); color: var(--fg); }4.8 Fieldset & legend
Group related inputs inside a fieldset. Use this for settings panels, multi-choice blocks, and any time a cluster of controls shares a context.
Fieldset + legend + description
<fieldset>.fs {
border: 1px solid var(--hair);
border-radius: var(--r-lg);
padding: var(--s-6);
background: var(--bg-paper);
display: flex; flex-direction: column; gap: var(--s-3);
}
.fs-legend {
font: 600 15px/1.3 var(--f-display);
color: var(--fg);
padding: 0 var(--s-2);
margin-left: -2px;
}
.fs-desc { font: 400 13px/1.5 var(--f-body); color: var(--fg-soft); margin: 0 0 var(--s-3); }
.cb { display: flex; align-items: center; gap: var(--s-3); cursor: pointer; font: 400 14px/1.3 var(--f-body); color: var(--fg); padding: 4px 0; }
.cb input { position: absolute; opacity: 0; pointer-events: none; }
.cb-box { flex: 0 0 18px; width: 18px; height: 18px; background: var(--bg-paper); border: 1.5px solid var(--hair); border-radius: var(--r-xs); position: relative; transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.cb input:checked + .cb-box { background: var(--accent); border-color: var(--accent); }
.cb input:checked + .cb-box::after { content: ""; position: absolute; width: 5px; height: 10px; border-right: 2px solid var(--paper); border-bottom: 2px solid var(--paper); margin: auto; top: -2px; left: 0; right: 0; bottom: 0; transform: rotate(45deg); }4.9 Combobox
Type-to-filter input with a dropdown list. Use when the option set is large (>7) and known, but users may want to type. Arrow keys navigate, Enter selects, Esc closes.
Filterable combobox
.comboInput borrows the standard .input styling; the open menu is a paper card with hair border and highlighted :is-active row.
<div class="combo">
<label class="input-wrap">
<span class="input-label">Assign to</span>
<input class="input" role="combobox" aria-expanded="true" />
</label>
<ul class="combo-menu" role="listbox">
<li class="combo-row is-active" role="option">Priya Raman</li>
<li class="combo-row" role="option">Pradeep Kumar</li>
</ul>
</div>.combo { position: relative; }
.combo-menu { list-style: none; margin: var(--s-2) 0 0; padding: var(--s-2);
background: var(--bg-paper); border: 1px solid var(--hair);
border-radius: var(--r-md); box-shadow: var(--sh-2); }
.combo-row { display: flex; justify-content: space-between; align-items: center;
padding: var(--s-2) var(--s-3); border-radius: var(--r-xs);
font: 400 14px/1 var(--f-body); color: var(--fg); cursor: pointer; }
.combo-row.is-active, .combo-row:hover { background: var(--accent-soft); color: var(--accent-text); }
.combo-meta { font: 400 12px/1 var(--f-mono); color: var(--fg-dim); }4.10 Date picker
Input trigger + popover calendar. Tabular-nums for the day grid; today has a pink ring; selected is a pink-filled cell. Range-selection picks a start and an end.
Date field + calendar
.datepickThe calendar popover uses a 7-column grid. Hover, focus, and keyboard navigation all target individual cells.
<div class="datepick">
<label class="input-wrap">
<span class="input-label">Meeting date</span>
<input class="input" type="text" aria-haspopup="dialog" />
</label>
<div class="cal">
<header class="cal-head">
<button class="cal-nav">‹</button>
<div class="cal-title">April 2026</div>
<button class="cal-nav">›</button>
</header>
<div class="cal-grid">
<button class="cal-d is-today">21</button>
<button class="cal-d is-sel">24</button>
</div>
</div>
</div>.cal { margin-top: var(--s-2); padding: var(--s-3);
background: var(--bg-paper); border: 1px solid var(--hair);
border-radius: var(--r-md); box-shadow: var(--sh-2); }
.cal-head { display: flex; justify-content: space-between; align-items: center;
margin-bottom: var(--s-2); }
.cal-title { font: 600 14px/1 var(--f-display); color: var(--fg); }
.cal-nav { width: 28px; height: 28px; border: 0; background: transparent;
border-radius: var(--r-xs); color: var(--fg-soft); cursor: pointer; }
.cal-nav:hover { background: var(--bg-sunk); color: var(--fg); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-weekdays span { text-align: center; font: 500 10px/1 var(--f-mono);
text-transform: uppercase; color: var(--fg-dim); padding: var(--s-2) 0; }
.cal-d { aspect-ratio: 1; border: 0; background: transparent;
border-radius: var(--r-xs); font: 500 13px/1 var(--f-mono);
font-variant-numeric: tabular-nums; color: var(--fg); cursor: pointer; }
.cal-d:hover { background: var(--bg-sunk); }
.cal-d.is-out { color: var(--fg-dim); }
.cal-d.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-text); }
.cal-d.is-sel { background: var(--accent); color: var(--paper); }4.11 Range sliders
Single- and dual-handle range inputs. Native <input type="range"> under the hood — keyboard arrow nav, screen-reader labels, and mobile touch all work without custom code.
Single-value slider
.rangePink fill up to the current value; ink-bordered circular thumb. Live value chip on the right of the label. Ticks are optional.
<div class="range" style="--pct: 72;">
<div class="range-head">
<span class="lbl">Lead volume / month</span>
<span class="val" data-range-value>1,440</span>
</div>
<div class="range-track-wrap">
<input type="range" min="0" max="2000" step="10" value="1440"
aria-label="Monthly lead volume" data-range-input>
</div>
<div class="range-meta"><span>0</span><span>2,000+</span></div>
</div>
<!-- Tiny listener (add once per page):
[data-range-input] → updates --pct on the .range wrapper + value chip -->
<script>
document.addEventListener('input', (e) => {
const el = e.target.closest('[data-range-input]');
if (!el) return;
const r = el.closest('.range');
const min = +el.min, max = +el.max, v = +el.value;
r.style.setProperty('--pct', ((v - min) / (max - min)) * 100);
const out = r.querySelector('[data-range-value]');
if (out) out.textContent = Number(v).toLocaleString();
});
</script>.range input[type="range"]::-webkit-slider-runnable-track {
height: 6px; border-radius: 6px;
background: linear-gradient(to right,
var(--accent) 0%,
var(--accent) calc(var(--pct) * 1%),
var(--hair) calc(var(--pct) * 1%),
var(--hair) 100%);
}
.range input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 22px; height: 22px; border-radius: 50%;
background: var(--bg-paper); border: 2px solid var(--ink);
margin-top: -8px;
}
.range input[type="range"]:focus-visible::-webkit-slider-thumb {
border-color: var(--accent);
box-shadow: 0 0 0 6px var(--accent-soft);
}Stepped slider with tick labels
.range.steppedAdd ticks via <span class="tick" style="--at: 25%"> children under the track.
Dual-handle range (min / max)
.range-pairTwo stacked native range inputs; a tiny listener keeps the handles from crossing and drives the filled band.
<div class="range" style="--min: 20; --max: 70;">
<div class="range-head">
<span class="lbl">Deal size range</span>
<span class="val" data-range-pair-value>$40k — $140k</span>
</div>
<div class="range-pair">
<div class="range-pair-track"></div>
<input type="range" min="0" max="200" step="10" value="40" data-range-min>
<input type="range" min="0" max="200" step="10" value="140" data-range-max>
</div>
</div>
<script>
document.addEventListener('input', (e) => {
const lo = e.target.closest('[data-range-min]');
const hi = e.target.closest('[data-range-max]');
if (!lo && !hi) return;
const r = (lo || hi).closest('.range');
const a = r.querySelector('[data-range-min]');
const b = r.querySelector('[data-range-max]');
let av = +a.value, bv = +b.value;
if (av > bv) { if (lo) { a.value = bv; av = bv; } else { b.value = av; bv = av; } }
const min = +a.min, max = +a.max;
r.style.setProperty('--min', ((av - min) / (max - min)) * 100);
r.style.setProperty('--max', ((bv - min) / (max - min)) * 100);
const out = r.querySelector('[data-range-pair-value]');
if (out) out.textContent = '$' + av + 'k — $' + bv + 'k';
});
</script>4.12 Form layout
Stack labels above inputs. Two-column rows only for inputs that share a mental category (first/last, city/zip). Actions live at the bottom-right.
A complete form
<form>Use grid for two-column rows. Actions row is bottom-right with ghost cancel + primary submit.
.input-wrap { display: flex; flex-direction: column; gap: 6px; }
.input-label {
font: 500 13px/1.3 var(--f-body);
color: var(--fg);
}
.input-hint { font: 400 12.5px/1.4 var(--f-body); color: var(--fg-dim); }
.input-error { font: 500 12.5px/1.4 var(--f-body); color: var(--error-text); display: inline-flex; align-items: center; gap: 4px; }
.input-success { font: 500 12.5px/1.4 var(--f-body); color: var(--success-text); display: inline-flex; align-items: center; gap: 4px; }
.input {
width: 100%;
font: 400 14.5px/1.4 var(--f-body);
color: var(--fg);
background: var(--bg-paper);
border: 1px solid var(--hair);
border-radius: var(--r-sm);
padding: 10px 14px;
transition: border-color var(--dur-2) var(--ease),
box-shadow var(--dur-2) var(--ease);
appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--fg-faint); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--fg-dim); }
.input:focus {
outline: 0;
border-color: var(--accent);
box-shadow: var(--sh-focus);
}
.input:disabled { background: var(--bg-sunk); color: var(--fg-dim); cursor: not-allowed; }
.input-wrap.is-error .input { border-color: var(--error); }
.input-wrap.is-error .input:focus { box-shadow: 0 0 0 3px var(--error-soft); }
.input-wrap.is-success .input { border-color: var(--success); }
.form-demo {
display: flex; flex-direction: column; gap: var(--s-5);
background: var(--bg-paper);
padding: var(--s-7);
border: 1px solid var(--hair);
border-radius: var(--r-lg);
max-width: 520px; width: 100%;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: var(--s-3); margin-top: var(--s-2); }
.btn-ghost-mini, .btn-primary-mini {
font: 600 14px/1 var(--f-display);
padding: 10px var(--s-5);
border-radius: var(--r-md); cursor: pointer; border: 1px solid transparent;
transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.btn-ghost-mini { background: transparent; color: var(--fg); }
.btn-ghost-mini:hover { background: var(--bg-sunk); }
.btn-primary-mini { background: var(--accent); color: var(--paper); box-shadow: var(--sh-pink); }
.btn-primary-mini:hover { transform: translateY(-1px); }4.13 Anatomy of a field
Six tokens define every input in the library.
- 11. Label
font: 500 13px/1.3 var(--f-body); - 22. Field
padding: 10px 14px; border-radius: var(--r-sm); - 33. Border
border: 1px solid var(--hair); - 44. Hint
font: 400 12.5px/1.4 var(--f-body); color: var(--fg-dim); - 55. Gap
gap: 6px; - 66. Focus ring
box-shadow: var(--sh-focus);