generalcss

Button

Styled button classes with color schemes, outline/ghost/text variants, four sizes, and icon-only and grouped layouts.

CSS Variables

VariableDefaultScopeDescription
--z-button-bgvar(--z-bg).z-buttonBackground color of the button.
--z-button-bg-o100%.z-buttonOpacity applied to the background color.
--z-button-bordervar(--z-border).z-buttonBorder color.
--z-button-border-ovar(--z-border-o).z-buttonOpacity applied to the border color.
--z-button-colorvar(--z-bg-f).z-buttonText and icon color.
--z-button-disabled-o50%.z-buttonOpacity of disabled buttons.
--z-button-font-sizevar(--z-global-font-size).z-buttonLabel font size.
--z-button-font-weight500.z-buttonLabel font weight.
--z-button-heightcalc(var(--z-global-font-size) * var(--z-interactive-height-multiplier)).z-buttonButton height, derived from the font size and the interactive height multiplier.
--z-button-hover-bgvar(--z-accent).z-buttonBackground color on hover.
--z-button-hover-bg-o4%.z-buttonOpacity applied to the hover background color.
--z-button-hover-colorvar(--z-accent-f).z-buttonText and icon color on hover.
--z-button-icon-size1rem.z-buttonWidth and height of icons inside the button.
--z-button-line-heightvar(--z-global-line-height).z-buttonLabel line height.
--z-button-paddingvar(--z-button-padding-block) var(--z-button-padding-inline).z-buttonShorthand padding assembled from the block and inline padding variables.
--z-button-padding-blockcalc( var(--z-global-font-size) * var(--z-interactive-padding-block-multiplier) ).z-buttonVertical padding; feeds --z-button-padding.
--z-button-padding-inlinecalc( var(--z-global-font-size) * var(--z-interactive-padding-inline-multiplier) ).z-buttonHorizontal padding; feeds --z-button-padding.
--z-button-radiusvar(--z-global-radius).z-buttonCorner radius.
--z-button-shadowvar(--z-global-shadow-small).z-buttonBox shadow.

CSS Classes

ClassRoleApplies toDescription
.z-buttonroot.z-buttonBase class for styled buttons and button-like links.
.z-button-dangermodifier.z-buttonDanger color scheme with white text.
.z-button-defaultmodifier.z-buttonNeutral surface color scheme.
.z-button-ghostmodifier.z-buttonTransparent background and border with no shadow; an accent tint appears on hover.
.z-button-groupelement.z-buttonJoins adjacent buttons into one segmented unit with shared radius and shadow.
.z-button-iconelement.z-buttonSquare icon-only button with no padding.
.z-button-infomodifier.z-buttonInfo color scheme with white text.
.z-button-largemodifier.z-buttonLarge size: taller height and wider padding.
.z-button-mediummodifier.z-buttonMedium size.
.z-button-outlinemodifier.z-buttonTransparent background with colored border and text; combines with the color schemes.
.z-button-primarymodifier.z-buttonPrimary color scheme.
.z-button-secondarymodifier.z-buttonSubtle secondary color scheme with a faint tinted background.
.z-button-smallmodifier.z-buttonSmall size with reduced font and padding.
.z-button-successmodifier.z-buttonSuccess color scheme with white text.
.z-button-textmodifier.z-buttonInline text button with an animated underline and no background, border, or padding.
.z-button-warningmodifier.z-buttonWarning color scheme with white text.
.z-button-xsmallmodifier.z-buttonExtra-small size with reduced font and padding.