generalcss
Button
Styled button classes with color schemes, outline/ghost/text variants, four sizes, and icon-only and grouped layouts.
CSS Variables
| Variable | Default | Scope | Description |
|---|---|---|---|
--z-button-bg | var(--z-bg) | .z-button | Background color of the button. |
--z-button-bg-o | 100% | .z-button | Opacity applied to the background color. |
--z-button-border | var(--z-border) | .z-button | Border color. |
--z-button-border-o | var(--z-border-o) | .z-button | Opacity applied to the border color. |
--z-button-color | var(--z-bg-f) | .z-button | Text and icon color. |
--z-button-disabled-o | 50% | .z-button | Opacity of disabled buttons. |
--z-button-font-size | var(--z-global-font-size) | .z-button | Label font size. |
--z-button-font-weight | 500 | .z-button | Label font weight. |
--z-button-height | calc(var(--z-global-font-size) * var(--z-interactive-height-multiplier)) | .z-button | Button height, derived from the font size and the interactive height multiplier. |
--z-button-hover-bg | var(--z-accent) | .z-button | Background color on hover. |
--z-button-hover-bg-o | 4% | .z-button | Opacity applied to the hover background color. |
--z-button-hover-color | var(--z-accent-f) | .z-button | Text and icon color on hover. |
--z-button-icon-size | 1rem | .z-button | Width and height of icons inside the button. |
--z-button-line-height | var(--z-global-line-height) | .z-button | Label line height. |
--z-button-padding | var(--z-button-padding-block) var(--z-button-padding-inline) | .z-button | Shorthand padding assembled from the block and inline padding variables. |
--z-button-padding-block | calc( var(--z-global-font-size) * var(--z-interactive-padding-block-multiplier) ) | .z-button | Vertical padding; feeds --z-button-padding. |
--z-button-padding-inline | calc( var(--z-global-font-size) * var(--z-interactive-padding-inline-multiplier) ) | .z-button | Horizontal padding; feeds --z-button-padding. |
--z-button-radius | var(--z-global-radius) | .z-button | Corner radius. |
--z-button-shadow | var(--z-global-shadow-small) | .z-button | Box shadow. |
CSS Classes
| Class | Role | Applies to | Description |
|---|---|---|---|
.z-button | root | .z-button | Base class for styled buttons and button-like links. |
.z-button-danger | modifier | .z-button | Danger color scheme with white text. |
.z-button-default | modifier | .z-button | Neutral surface color scheme. |
.z-button-ghost | modifier | .z-button | Transparent background and border with no shadow; an accent tint appears on hover. |
.z-button-group | element | .z-button | Joins adjacent buttons into one segmented unit with shared radius and shadow. |
.z-button-icon | element | .z-button | Square icon-only button with no padding. |
.z-button-info | modifier | .z-button | Info color scheme with white text. |
.z-button-large | modifier | .z-button | Large size: taller height and wider padding. |
.z-button-medium | modifier | .z-button | Medium size. |
.z-button-outline | modifier | .z-button | Transparent background with colored border and text; combines with the color schemes. |
.z-button-primary | modifier | .z-button | Primary color scheme. |
.z-button-secondary | modifier | .z-button | Subtle secondary color scheme with a faint tinted background. |
.z-button-small | modifier | .z-button | Small size with reduced font and padding. |
.z-button-success | modifier | .z-button | Success color scheme with white text. |
.z-button-text | modifier | .z-button | Inline text button with an animated underline and no background, border, or padding. |
.z-button-warning | modifier | .z-button | Warning color scheme with white text. |
.z-button-xsmall | modifier | .z-button | Extra-small size with reduced font and padding. |