inputscss
Form
Styling for native form controls: inputs, selects, textareas, radios, checkboxes, ranges, toggle switches, labels, icons, sizes, and selectable card/field layouts.
CSS Variables
| Variable | Default | Scope | Description |
|---|---|---|---|
--z-form-checkbox-image · hook | | .z-checkbox:checked | Background image drawn for a checked checkbox (the check mark). |
--z-form-checkbox-image-indeterminate · hook | | .z-checkbox:indeterminate | Background image drawn for an indeterminate checkbox (the dash). |
--z-form-danger-ring-color | var(--z-danger) | .z-form-danger:focus | Focus ring color for fields marked .z-form-danger. |
--z-form-danger-ring-color-o | 100% | .z-form-danger:focus | Opacity applied to the danger focus ring color. |
--z-form-focus-ring-color | var(--z-focus) | .z-input:focus, .z-select:focus, .z-textarea:focus, .z-input-fake:focus | Focus ring color for inputs, selects, textareas, and fake inputs. |
--z-form-focus-ring-color-o | 100% | .z-input:focus, .z-select:focus, .z-textarea:focus, .z-input-fake:focus | Opacity applied to the focus ring color. |
--z-form-icon-width | 2.5rem | .z-form-icon, .z-input | Width reserved for a leading or trailing form icon; the input pads itself by this amount. |
--z-form-input-bg | transparent | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Background color of inputs, selects, textareas, fake inputs, and radio cards. |
--z-form-input-border-color | var(--z-input) | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Border color of the shared input base. |
--z-form-input-border-color-o | var(--z-input-o) | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Opacity applied to the input border color. |
--z-form-input-color | var(--z-bg-f) | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Text color of the shared input base. |
--z-form-input-color-o | 100% | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Opacity applied to the input text color. |
--z-form-input-font-size | var(--z-global-font-size-small) | .z-form-xsmall | Font size of controls; overridden by the small and extra-small size variants. |
--z-form-input-height | calc(var(--z-global-font-size) * var(--z-interactive-height-multiplier)) | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Computed control height from the global font size and the interactive height multiplier. |
--z-form-input-line-height | var(--z-global-line-height-small) | .z-form-xsmall | Line height of controls; overridden by the small and extra-small size variants. |
--z-form-input-padding | var(--z-form-input-padding-block) var(--z-form-input-padding-inline) | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Shorthand padding of the shared input base, composed from the block and inline padding variables. |
--z-form-input-padding-block | calc( var(--z-global-font-size) * var(--z-interactive-padding-block-multiplier) ) | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Block (vertical) padding of controls, derived from the interactive padding multiplier. |
--z-form-input-padding-inline | calc( var(--z-global-font-size) * var(--z-interactive-padding-inline-multiplier) ) | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Inline (horizontal) padding of controls, derived from the interactive padding multiplier. |
--z-form-input-radius · hook | | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Corner radius of the shared input base; supplied by the theme. |
--z-form-input-shadow · hook | | .z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-card | Box shadow of the shared input base; supplied by the theme. |
--z-form-radio-border-color | var(--z-input) | .z-radio, .z-checkbox | Border color of radios and checkboxes. |
--z-form-radio-border-color-o | var(--z-input-o) | .z-radio, .z-checkbox | Opacity applied to the radio/checkbox border color. |
--z-form-radio-focus-ring-color | var(--z-form-radio-checked-border-color) | .z-radio:focus, .z-checkbox:focus | Focus ring color for radios and checkboxes; defaults to the checked border color. |
--z-form-radio-focus-ring-color-o | 30% | .z-radio:focus, .z-checkbox:focus | Opacity applied to the radio/checkbox focus ring color. |
--z-form-radio-image · hook | | .z-radio:checked | Background image drawn for a checked radio (the dot). |
--z-form-radio-indeterminate-bg | var(--z-muted) | .z-checkbox:indeterminate | Background color of an indeterminate checkbox. |
--z-form-radio-indeterminate-bg-o | 8% | .z-checkbox:indeterminate | Opacity applied to the indeterminate background color. |
--z-form-radio-indeterminate-border-color | var(--z-muted) | .z-checkbox:indeterminate | Border color of an indeterminate checkbox. |
--z-form-radio-indeterminate-border-color-o | 32% | .z-checkbox:indeterminate | Opacity applied to the indeterminate border color. |
--z-form-radio-radius · hook | | .z-radio, .z-checkbox | Corner radius of radios and checkboxes; supplied by the theme (radios override it to a circle). |
--z-form-radio-shadow · hook | | .z-radio, .z-checkbox | Box shadow of radios and checkboxes; supplied by the theme. |
--z-form-toggle-switch-shadow · hook | | .z-toggle-switch | Box shadow of the toggle switch; supplied by the theme. |
--z-radio-card-checked-border-color | var(--z-bg-f) | .z-radio-card | Border color token for a checked radio card, overridden by .z-form-danger; currently declared but not consumed by any rule. |
--z-radio-card-gap | 0.5rem | .z-radio-card | Gap between a radio card's control and its text column. |
--z-range-thumb-bg | var(--z-bg) | .z-range | Background color of the range thumb. |
--z-range-thumb-bg-o | 100% | .z-range | Opacity applied to the range thumb color. |
--z-range-thumb-border-color | var(--z-primary) | .z-range | Border color of the range thumb. |
--z-range-thumb-border-color-o | 50% | .z-range | Opacity applied to the range thumb border color. |
--z-range-thumb-margin-top | -7px | .z-range | Vertical offset that centers the range thumb on the track. |
--z-range-thumb-radius | 500px | .z-range | Corner radius of the range thumb. |
--z-range-thumb-size | 1rem | .z-range | Height and width of the range thumb. |
--z-range-track-bg | var(--z-primary) | .z-range | Background color of the range track. |
--z-range-track-bg-o | 20% | .z-range | Opacity applied to the range track color. |
--z-range-track-height | 3px | .z-range | Height of the range track. |
--z-range-track-radius | 500px | .z-range | Corner radius of the range track. |
--z-toggle-field-gap | 1rem | .z-toggle-field | Gap between a toggle field's text and its switch. |
--z-toggle-switch-bg | var(--z-input) | .z-toggle-switch | Background color of the unchecked toggle switch track. |
--z-toggle-switch-bg-o | var(--z-input-o) | .z-toggle-switch | Opacity applied to the toggle switch track color. |
--z-toggle-switch-height | 1.25rem | .z-toggle-switch | Height of the toggle switch track. |
--z-toggle-switch-knob-bg | var(--z-bg) | .z-toggle-switch | Background color of the toggle switch knob. |
--z-toggle-switch-knob-bg-o | 100% | .z-toggle-switch | Opacity applied to the toggle switch knob color. |
--z-toggle-switch-width | 2.25rem | .z-toggle-switch | Width of the toggle switch track. |
CSS Classes
| Class | Role | Applies to | Description |
|---|---|---|---|
.z-checkbox | element | .z-input | Native checkbox styled as a custom square; the check and indeterminate marks come from background images. |
.z-fieldset | element | .z-input | Fieldset wrapper with min-width: 0 so it can shrink inside flex/grid layouts. |
.z-form-blank | element | .z-input | Removes an input's background, border, and shadow, and suppresses the focus outline. |
.z-form-custom | element | .z-input | Wrapper that overlays a native <select> or file <input> transparently on top of custom-styled content. |
.z-form-danger | modifier | .z-input | Marks a field invalid: switches the focus ring (and radio-card border) to the danger color. |
.z-form-help | element | .z-input | Small helper text below a field. |
.z-form-icon | modifier | .z-input | Icon positioned inside an input's leading edge; the input pads itself to make room. |
.z-form-icon-flip | element | .z-input | Moves the form icon to the trailing edge of the input. |
.z-form-label | element | .z-input | Field label typography. |
.z-form-label-required | element | .z-input | Appends a danger-colored asterisk to a required field's label. |
.z-form-large | modifier | .z-input | Large control size: taller height and larger padding. |
.z-form-medium | modifier | .z-input | Medium (default) control size. |
.z-form-small | modifier | .z-input | Small control size with smaller font and line height. |
.z-form-stacked | element | .z-input | Stacks labels above their fields by making .z-form-label block-level. |
.z-form-xsmall | modifier | .z-input | Extra-small control size with smaller font and line height. |
.z-inline | element | .z-input | Inline-block wrapper that keeps an input and its icon aligned on one line. |
.z-input | root | .z-input | Root class for native text inputs; also the shared base style for selects, textareas, fake inputs, and radio cards. |
.z-input-fake | element | .z-input | Non-input element styled to look like an input, such as a custom select trigger. |
.z-radio | element | .z-input | Native radio styled as a custom circle; the checked dot comes from a background image. |
.z-radio-card | modifier | .z-input | Selectable card wrapping a radio/checkbox with a label and description; highlights its border when checked. |
.z-radio-card-body | element | .z-input | Text column of a radio card, holding the label and description. |
.z-radio-card-control | element | .z-input | Leading column of a radio card that holds and vertically centers the radio/checkbox. |
.z-radio-card-description | element | .z-input | Muted description text inside a radio card. |
.z-radio-card-label | element | .z-input | Label text inside a radio card. |
.z-range | element | .z-input | Native range slider with a custom track and thumb. |
.z-select | element | .z-input | Native <select> styled to match inputs; single selects drop the native arrow, while multiple/size selects grow and resize vertically. |
.z-textarea | element | .z-input | Native textarea styled to match inputs, with a two-line minimum height. |
.z-toggle-field | element | .z-input | Row pairing a label/description with a toggle switch, spaced apart and clickable as a whole. |
.z-toggle-field-body | element | .z-input | Text column of a toggle field, holding the label and description. |
.z-toggle-field-control | element | .z-input | Trailing column of a toggle field that holds and centers the switch. |
.z-toggle-field-description | element | .z-input | Muted description text inside a toggle field. |
.z-toggle-field-label | element | .z-input | Label text inside a toggle field. |
.z-toggle-switch | element | .z-input | Checkbox styled as a sliding toggle switch. |
.z-toggle-switch-danger | element | .z-input | Colors the checked toggle switch with the danger color. |
.z-toggle-switch-primary | element | .z-input | Colors the checked toggle switch with the primary color. |
Accessibility
- Radio cards and toggle fields wrap their native control in a clickable row, so the label activates the control; a disabled control dims the whole row.
- The asterisk added by
.z-form-label-requiredis visual only; set the nativerequiredattribute for semantics.