Skip to main contentSkip to docs navigation

Chassis

Style actions with buttons in solid, outline, smooth, and link variants, three sizes, and context colors driven by design tokens.

@layer components
JavaScript is optional
Component tokens

Introduction

Buttons trigger actions and navigation. The .button class sets layout, typography, and interactive states, and takes its sizes and colors from the button design tokens, so a button in code matches its counterpart in the Figma library. Context classes set the color, and the .outline, .smooth, and .link modifiers set the style.

Basic structure

Apply .button to a <button> element. The class alone renders a button on the body colors; a context class such as .default or .primary sets its color, and .link renders it as a link.

HTML
<button type="button" class="button">Foundation class</button>
<button type="button" class="button default">Default Button</button>
<button type="button" class="button primary">Primary Button</button>
<button type="button" class="button link">Link</button>

Accessibility: The .button class includes a focus ring that shows on keyboard focus.

Button variants

Add a context class to .button to color it. Each context maps to a set of design tokens, and a button without a style modifier is solid.

HTML
<button type="button" class="button default">Default</button>
<button type="button" class="button alternate">Alternate</button>
<button type="button" class="button primary">Primary</button>
<button type="button" class="button secondary">Secondary</button>
<button type="button" class="button neutral">Neutral</button>
<button type="button" class="button danger">Danger</button>
<button type="button" class="button success">Success</button>
<button type="button" class="button warning">Warning</button>
<button type="button" class="button info">Info</button>
<button type="button" class="button black">Black</button>
<button type="button" class="button white">White</button>

Accessibility tip: Color alone shouldn't convey meaning as it's not perceived by assistive technology users. Ensure clarity through text with adequate contrast, ARIA attributes where needed, and consider using .visually-hidden for screen reader content.

Outline variants

The .outline modifier renders a button with a border and a transparent background in the colors of its context.

HTML
<button type="button" class="button default outline">Default</button>
<button type="button" class="button alternate outline">Alternate</button>
<button type="button" class="button primary outline">Primary</button>
<button type="button" class="button secondary outline">Secondary</button>
<button type="button" class="button neutral outline">Neutral</button>
<button type="button" class="button danger outline">Danger</button>
<button type="button" class="button success outline">Success</button>
<button type="button" class="button warning outline">Warning</button>
<button type="button" class="button info outline">Info</button>
<button type="button" class="button black outline">Black</button>
<button type="button" class="button white outline">White</button>

Some outline variants use a light foreground color and need a dark background to keep enough contrast.

Smooth variants

The .smooth modifier renders a button with a subdued background in the colors of its context.

HTML
<button type="button" class="button default smooth">Default</button>
<button type="button" class="button alternate smooth">Alternate</button>
<button type="button" class="button primary smooth">Primary</button>
<button type="button" class="button secondary smooth">Secondary</button>
<button type="button" class="button neutral smooth">Neutral</button>
<button type="button" class="button danger smooth">Danger</button>
<button type="button" class="button success smooth">Success</button>
<button type="button" class="button warning smooth">Warning</button>
<button type="button" class="button info smooth">Info</button>
<button type="button" class="button black smooth">Black</button>
<button type="button" class="button white smooth">White</button>

The .link modifier removes the background and border and renders the button text in the link color of its context.

HTML
<button type="button" class="button default link">Default</button>
<button type="button" class="button alternate link">Alternate</button>
<button type="button" class="button primary link">Primary</button>
<button type="button" class="button secondary link">Secondary</button>
<button type="button" class="button neutral link">Neutral</button>
<button type="button" class="button danger link">Danger</button>
<button type="button" class="button success link">Success</button>
<button type="button" class="button warning link">Warning</button>
<button type="button" class="button info link">Info</button>
<button type="button" class="button black link">Black</button>
<button type="button" class="button white link">White</button>

Element compatibility

The .button classes are written for the <button> element and also apply to <a> and <input> elements.

Link
HTML
<button class="button primary" type="submit">Button</button>
<input class="button primary" type="button" value="Input">
<input class="button primary" type="submit" value="Submit">
<input class="button primary" type="reset" value="Reset">
<a class="button primary" href="#">Link</a>

Add role="button" to an <a> element that triggers in-page functionality instead of navigating, so assistive technologies announce it as a button.

Icons

Place an icon before or after the button text. Both SVG icons and icon fonts work.

HTML
<button type="button" class="button default">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Default</span>
</button>
<button type="button" class="button primary">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Primary</span>
</button>
<button type="button" class="button default">
  <span>Default</span>
  <span class="icon cx-info-circle-solid" aria-hidden="true"></span>
</button>
<button type="button" class="button primary">
  <span>Primary</span>
  <span class="icon cx-info-circle-solid" aria-hidden="true"></span>
</button>

Icon spacing relies on the :first-child and :last-child pseudo-classes. Wrap the button text in a <span> element so the icon is matched as the first or last child.

Icon-only buttons

Add .icon-only to a button whose only content is an icon. The modifier sets the horizontal padding to the vertical padding, which makes the button square. Give the button an aria-label, since it has no visible text.

HTML
<button type="button" class="button default icon-only" aria-label="Info">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
</button>
<button type="button" class="button primary icon-only" aria-label="Info">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
</button>
<button type="button" class="button sm default icon-only" aria-label="Info">
  <span class="icon cx-info-circle-solid" aria-hidden="true"></span>
</button>
<button type="button" class="button sm primary icon-only" aria-label="Info">
  <span class="icon cx-info-circle-solid" aria-hidden="true"></span>
</button>
<button type="button" class="button lg default icon-only" aria-label="Info">
  <span class="icon cx-info-circle-solid" aria-hidden="true"></span>
</button>
<button type="button" class="button default lg icon-only" aria-label="Info">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
</button>
<button type="button" class="button lg primary icon-only" aria-label="Info">
  <span class="icon cx-info-circle-solid" aria-hidden="true"></span>
</button>

Size variants

Buttons come in three sizes. Add .lg or .sm for the large or small size; the medium size applies without a modifier.

HTML
<button type="button" class="button default lg">
  Default
</button>
<button type="button" class="button default lg">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Default</span>
</button>
<button type="button" class="button primary lg">
  Primary
</button>
<button type="button" class="button primary lg">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Primary</span>
</button>
HTML
<button type="button" class="button default sm">
  Default
</button>
<button type="button" class="button default sm">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Default</span>
</button>
<button type="button" class="button primary sm">
  Primary
</button>
<button type="button" class="button primary sm">
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Primary</span>
</button>

Custom sizing

For a size outside the three variants, set the sizing custom properties of the button, such as --cx-button-padding-y, --cx-button-padding-x, and --cx-button-font-size.

HTML
<button type="button" class="button primary"
  style="--cx-button-padding-y: .75rem; --cx-button-padding-x: 1.5rem; --cx-button-font-size: .75rem;">
  Custom-sized button
</button>

Disabled state

Add the disabled attribute to a <button> element to disable it. A disabled button takes the disabled colors of its variant and ignores pointer events.

HTML
<button type="button" class="button default" disabled>
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Default Button</span>
</button>
<button type="button" class="button default outline" disabled>
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Default button</span>
</button>
<button type="button" class="button default smooth" disabled>
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Default button</span>
</button>
<button type="button" class="button primary" disabled>
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Primary Button</span>
</button>
<button type="button" class="button primary outline" disabled>
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Primary Button</span>
</button>
<button type="button" class="button primary smooth" disabled>
  <svg class="icon" aria-hidden="true"><use href="#info-circle-solid"></use></svg>
  <span>Primary Button</span>
</button>

The <a> element has no disabled attribute, so a link button takes the .disabled class and aria-disabled="true" instead.

HTML
<a class="button default disabled" role="button" aria-disabled="true">Default Link</a>
<a class="button primary disabled" role="button" aria-disabled="true">Primary Link</a>
<a class="button secondary disabled" role="button" aria-disabled="true">Secondary Link</a>

A disabled link button needs three things:

  1. The .disabled class, which applies the disabled styles.
  2. aria-disabled="true", which communicates the state to assistive technologies.
  3. No href attribute where possible, which prevents navigation.

When the href attribute must stay, add tabindex="-1":

HTML
<a href="#" class="button default disabled" tabindex="-1" role="button" aria-disabled="true">Default Link</a>
<a href="#" class="button primary disabled" tabindex="-1" role="button" aria-disabled="true">Primary Link</a>
<a href="#" class="button secondary disabled" tabindex="-1" role="button" aria-disabled="true">Secondary Link</a>

The .disabled class applies pointer-events: none, which stops pointer interaction only. The link stays reachable by keyboard, so tabindex="-1" removes it from the tab order, and custom JavaScript is needed to disable its functionality completely.

Layout patterns

Buttons have no container classes of their own. Display, gap, sizing, and flex utilities on a wrapper control their spacing, alignment, and responsive behavior.

Full-width buttons

Wrap buttons in an element with .d-grid to stack them at the full width of the wrapper, and add a gap utility for spacing.

HTML
<div class="d-grid gap-xs">
  <button class="button default" type="button">Default</button>
  <button class="button primary" type="button">Primary</button>
</div>

Responsive buttons

Add a responsive display utility to change the layout at a breakpoint. With .md:d-block the buttons stack up to the md breakpoint and sit inline from there.

HTML
<div class="d-grid gap-xs md:d-block">
  <button class="button default" type="button">Default</button>
  <button class="button primary" type="button">Primary</button>
</div>

Width control

Apply a width utility to the wrapper to limit the width of the stacked buttons.

HTML
<div class="d-grid gap-xs w-6/12 mx-auto">
  <button class="button default" type="button">Default</button>
  <button class="button primary" type="button">Primary</button>
</div>

Alignment control

Combine responsive display and flex utilities to align the buttons inside the wrapper.

HTML
<div class="d-grid gap-xs md:d-flex md:justify-content-end">
  <button class="button default" type="button">Default</button>
  <button class="button primary" type="button">Primary</button>
</div>

Text handling

The $button-white-space Sass variable sets the white-space of every button. Its default is nowrap, which keeps button text on one line; set it to null to let button text wrap inside its container. In a build with wrapping buttons, the .text-nowrap utility keeps a single button on one line.

HTML
<div style="max-width: 200px;">
  <p><button type="button" class="button primary">Button with a longer text that will wrap</button></p>
  <p><button type="button" class="button primary text-nowrap">While no-wrap text will extend beyond boundaries</button></p>
</div>

Toggle functionality

The Button plugin turns a button into a toggle that keeps its pressed state. Assistive technologies announce a toggle button as "button"/"button pressed", where a checkbox toggle is announced as "checked"/"not checked".

Toggle states

Add data-cx-toggle="button" to make a button a toggle. Each click toggles the .active class and keeps aria-pressed in sync. For a button that starts pressed, add both the .active class and aria-pressed="true".

HTML
<p class="d-inline-flex gap-xs">
  <button type="button" class="button default" data-cx-toggle="button" aria-pressed="false">Toggle button</button>
  <button type="button" class="button default active" data-cx-toggle="button" aria-pressed="true">Active toggle</button>
  <button type="button" class="button default" disabled data-cx-toggle="button" aria-pressed="false">Disabled toggle</button>
  <button type="button" class="button default active" disabled data-cx-toggle="button" aria-pressed="true">Disabled active</button>
</p>
<p class="d-inline-flex gap-xs">
  <button type="button" class="button primary" data-cx-toggle="button" aria-pressed="false">Toggle button</button>
  <button type="button" class="button primary active" data-cx-toggle="button" aria-pressed="true">Active toggle</button>
  <button type="button" class="button primary" disabled data-cx-toggle="button" aria-pressed="false">Disabled toggle</button>
  <button type="button" class="button primary active" disabled data-cx-toggle="button" aria-pressed="true">Disabled active</button>
</p>

Link buttons toggle the same way. Add role="button" so the pressed state is announced.

HTML
<p class="d-inline-flex gap-xs">
  <a href="#" class="button default" role="button" data-cx-toggle="button" aria-pressed="false">Toggle link</a>
  <a href="#" class="button default active" role="button" data-cx-toggle="button" aria-pressed="true">Active toggle</a>
  <a href="#" class="button default disabled" aria-disabled="true" role="button" data-cx-toggle="button" aria-pressed="false">Disabled toggle</a>
  <a href="#" class="button default active disabled" aria-disabled="true" role="button" data-cx-toggle="button" aria-pressed="true">Disabled active</a>
</p>
<p class="d-inline-flex gap-xs">
  <a href="#" class="button primary" role="button" data-cx-toggle="button" aria-pressed="false">Toggle link</a>
  <a href="#" class="button primary active" role="button" data-cx-toggle="button" aria-pressed="true">Active toggle</a>
  <a href="#" class="button primary disabled" aria-disabled="true" role="button" data-cx-toggle="button" aria-pressed="false">Disabled toggle</a>
  <a href="#" class="button primary active disabled" aria-disabled="true" role="button" data-cx-toggle="button" aria-pressed="true">Disabled active</a>
</p>

JavaScript API

The Button plugin toggles the pressed state of a button. Chassis JS ships as an ES module — import the Button class:

JavaScript
import { Button } from '@chassis-ui/css'

Triggers

The data-attribute API needs no JavaScript beyond the plugin itself. A click on an element with data-cx-toggle="button" toggles it, as shown in Toggle functionality:

HTML
<button type="button" class="button default" data-cx-toggle="button" aria-pressed="false">Toggle button</button>

Initialization

For programmatic access, create an instance with the Button class:

JavaScript
const button = new Button('#myButton')

Methods

The plugin exposes one instance method of its own, next to the methods every Chassis plugin has:

MethodDescription
toggleToggles the .active class of the button and sets aria-pressed to match.
disposeDestroys the instance and removes its stored data from the element.
getInstanceStatic — returns the instance bound to a DOM element, or null: Button.getInstance(element).
getOrCreateInstanceStatic — returns the instance bound to a DOM element, or creates one: Button.getOrCreateInstance(element).

getOrCreateInstance toggles a set of buttons without tracking their instances:

JavaScript
document.querySelectorAll('[data-cx-toggle="button"]').forEach(element => {
  Button.getOrCreateInstance(element).toggle()
})

CSS

This component can be customized through Sass variables at compile time.

Custom properties

This component exposes CSS custom properties to control its appearance at runtime.

Common variables:

--border-width: var(--button-border-width, #{$button-border-width});
--transition: var(--button-transition, #{$button-transition});
--caret-icon: var(--button-caret-icon, #{svg-icon($button-caret-icon)});
--caret-spacing: var(--nudge) calc(-1 * var(--nudge));

Sizing:

--min-size: var(--button-min-size, #{$button-medium-min-size});
--padding-y: var(--button-padding-y, #{$button-medium-padding-y});
--padding-x: var(--button-padding-x, #{$button-medium-padding-x + $button-medium-nudge});
--gap: var(--button-gap, #{$button-medium-gap});
--nudge: var(--button-nudge, #{$button-medium-nudge});
--border-radius: var(--button-border-radius, #{$button-medium-border-radius});
--icon-size: var(--button-icon-size, #{$button-medium-icon-size});
@include map-font($button-medium-font, button);
--caret-size: var(--button-caret-size, #{$button-medium-caret-size});

Idle (default) state:

--fg-color: var(--button-idle-fg-color, var(--fg-idle));
--bg-color: var(--button-idle-bg-color, var(--bg-idle));
--icon-color: var(--button-idle-icon-color, var(--fg-idle));
--border-color: var(--button-idle-border-color, var(--border-idle));
--box-shadow: var(--button-box-shadow, #{$button-box-shadow});

Hover state:

--fg-color: var(--button-hover-fg-color, var(--fg-hover));
--bg-color: var(--button-hover-bg-color, var(--bg-hover));
--icon-color: var(--button-hover-icon-color, var(--fg-hover));
--border-color: var(--button-hover-border-color, var(--border-hover));

Press (active) state:

--fg-color: var(--button-press-fg-color, var(--fg-press));
--bg-color: var(--button-press-bg-color, var(--bg-press));
--icon-color: var(--button-press-icon-color, var(--fg-press));
--border-color: var(--button-press-border-color, var(--border-press));
--box-shadow: var(--button-active-box-shadow, #{$button-active-box-shadow});

Disabled state:

--fg-color: var(--button-disabled-fg-color, var(--fg-disabled));
--bg-color: var(--button-disabled-bg-color, var(--bg-disabled));
--icon-color: var(--button-disabled-icon-color, var(--fg-disabled));
--border-color: var(--button-disabled-border-color, var(--border-disabled));

Sass variables

This component uses Sass variables in scss/config/_defaults.scss to define its defaults.

$button-transition:                   color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
$button-white-space:                  nowrap; // Set to `null` to restore default wrapping behavior.
$button-focus-ring-color:             $focus-ring-color;
$button-focus-ring-offset:            1px;
$button-disabled-opacity:             1;
$button-link-font-weight:             var(--font-weight-ui-normal); // $link-decoration;
$button-link-text-decoration:         none; // $link-decoration;
$button-link-hover-decoration:        $link-hover-decoration;
$button-link-bg-hover:                var(--dim-slight);
$button-link-fg-disabled:             var(--fg-slight);
// $button-link-bg-color:                  var(--link-hover);
$button-box-shadow:                   none; // $box-shadow-emboss; //
$button-active-box-shadow:            none; // $box-shadow-inset; //

Placeholder selectors

Sass placeholder selectors hold the styles of each button variant. Extend them in a custom selector with @extend to give it the styles of a solid, outline, or smooth button.

Solid button placeholder selector:

%solid-button {
  @each $color in map.keys($context-colors) {
    &.#{$color} {
      --fg-idle: var(--button-#{$color}-fg-idle, #{map.get($button-colors, #{#{$color}-fg-idle})});
      --bg-idle: var(--button-#{$color}-bg-idle, #{map.get($button-colors, #{#{$color}-bg-idle})});
      --border-idle: var(--button-#{$color}-border-idle, #{map.get($button-colors, #{#{$color}-border-idle})});
      // Hover
      --fg-hover: var(--button-#{$color}-fg-hover, #{map.get($button-colors, #{#{$color}-fg-hover})});
      --bg-hover: var(--button-#{$color}-bg-hover, #{map.get($button-colors, #{#{$color}-bg-hover})});
      --border-hover: var(--button-#{$color}-border-hover, #{map.get($button-colors, #{#{$color}-border-hover})});
      // Press
      --fg-press: var(--button-#{$color}-fg-press, #{map.get($button-colors, #{#{$color}-fg-press})});
      --bg-press: var(--button-#{$color}-bg-press, #{map.get($button-colors, #{#{$color}-bg-press})});
      --border-press: var(--button-#{$color}-border-press, #{map.get($button-colors, #{#{$color}-border-press})});
      // Disabled
      --fg-disabled: var(--button-#{$color}-fg-disabled, #{map.get($button-colors, #{#{$color}-fg-disabled})});
      --bg-disabled: var(--button-#{$color}-bg-disabled, #{map.get($button-colors, #{#{$color}-bg-disabled})});
      --border-disabled: var(--button-#{$color}-border-disabled, #{map.get($button-colors, #{#{$color}-border-disabled})});
      // Focus ring color
      --cue-color: var(--button-#{$color}-cue-color, var(--#{$color}-cue-main));
    }
  }
}

Outline button placeholder selector:

%outline-button {
  --fg-idle: var(--button-outline-fg-idle, var(--context-base-color));
  --bg-idle: var(--button-outline-bg-idle, transparent);
  --border-idle: var(--button-outline-border-idle, var(--context-base-color));
  --fg-hover: var(--button-outline-fg-hover, var(--context-contrast-color));
  --bg-hover: var(--button-outline-bg-hover, var(--context-dim-main));
  --border-hover: var(--button-outline-border-hover, transparent);
  --fg-press: var(--button-outline-fg-press, var(--context-contrast-color));
  --bg-press: var(--button-outline-bg-press, var(--context-base-color));
  --border-press: var(--button-outline-border-press, transparent);
  --fg-disabled: var(--button-outline-fg-disabled, var(--context-fg-slight));
  --bg-disabled: var(--button-outline-bg-disabled, transparent);
  --border-disabled: var(--button-outline-border-disabled, var(--context-fg-slight));
  // Custom border width
  --border-width: var(--border-width-lg);
}

Smooth button placeholder selector:

%smooth-button {
  --fg-idle: var(--button-smooth-fg-idle, var(--context-fg-main));
  --bg-idle: var(--button-smooth-bg-idle, var(--context-bg-even));
  --border-idle: var(--button-smooth-border-idle, transparent);
  --fg-hover: var(--button-smooth-fg-hover, var(--context-fg-main));
  --bg-hover: var(--button-smooth-bg-hover, var(--context-bg-evident));
  --border-hover: var(--button-smooth-border-hover, transparent);
  --fg-press: var(--button-smooth-fg-press, var(--context-fg-main));
  --bg-press: var(--button-smooth-bg-press, var(--context-bg-even));
  --border-press: var(--button-smooth-border-press, transparent);
  --fg-disabled: var(--button-smooth-fg-disabled, var(--context-fg-slight));
  --bg-disabled: var(--button-smooth-bg-disabled, var(--context-bg-main));
  --border-disabled: var(--button-smooth-border-disabled, transparent);
}

Sass maps

The $button-colors map holds the colors of each context, and the button mixins generate the variants from it.

$button-colors: (
  // Default
  "default-fg-idle":              $button-default-fg-idle,
  "default-fg-hover":             $button-default-fg-hover,
  "default-fg-press":             $button-default-fg-press,
  "default-fg-disabled":          $button-default-fg-disabled,
  "default-bg-idle":              $button-default-bg-idle,
  "default-bg-hover":             $button-default-bg-hover,
  "default-bg-press":             $button-default-bg-press,
  "default-bg-disabled":          $button-default-bg-disabled,
  "default-border-idle":          $button-default-border-idle,
  "default-border-hover":         $button-default-border-hover,
  "default-border-press":         $button-default-border-press,
  "default-border-disabled":      $button-default-border-disabled,
  // Alternate
  "alternate-fg-idle":            $button-alternate-fg-idle,
  "alternate-fg-hover":           $button-alternate-fg-hover,
  "alternate-fg-press":           $button-alternate-fg-press,
  "alternate-fg-disabled":        $button-alternate-fg-disabled,
  "alternate-bg-idle":            $button-alternate-bg-idle,
  "alternate-bg-hover":           $button-alternate-bg-hover,
  "alternate-bg-press":           $button-alternate-bg-press,
  "alternate-bg-disabled":        $button-alternate-bg-disabled,
  "alternate-border-idle":        $button-alternate-border-idle,
  "alternate-border-hover":       $button-alternate-border-hover,
  "alternate-border-press":       $button-alternate-border-press,
  "alternate-border-disabled":    $button-alternate-border-disabled,
  // Primary
  "primary-fg-idle":              $button-primary-fg-idle,
  "primary-fg-hover":             $button-primary-fg-hover,
  "primary-fg-press":             $button-primary-fg-press,
  "primary-fg-disabled":          $button-primary-fg-disabled,
  "primary-bg-idle":              $button-primary-bg-idle,
  "primary-bg-hover":             $button-primary-bg-hover,
  "primary-bg-press":             $button-primary-bg-press,
  "primary-bg-disabled":          $button-primary-bg-disabled,
  "primary-border-idle":          $button-primary-border-idle,
  "primary-border-hover":         $button-primary-border-hover,
  "primary-border-press":         $button-primary-border-press,
  "primary-border-disabled":      $button-primary-border-disabled,
  // Secondary
  "secondary-fg-idle":            $button-secondary-fg-idle,
  "secondary-fg-hover":           $button-secondary-fg-hover,
  "secondary-fg-press":           $button-secondary-fg-press,
  "secondary-fg-disabled":        $button-secondary-fg-disabled,
  "secondary-bg-idle":            $button-secondary-bg-idle,
  "secondary-bg-hover":           $button-secondary-bg-hover,
  "secondary-bg-press":           $button-secondary-bg-press,
  "secondary-bg-disabled":        $button-secondary-bg-disabled,
  "secondary-border-idle":        $button-secondary-border-idle,
  "secondary-border-hover":       $button-secondary-border-hover,
  "secondary-border-press":       $button-secondary-border-press,
  "secondary-border-disabled":    $button-secondary-border-disabled,
  // Neutral
  "neutral-fg-idle":              $button-neutral-fg-idle,
  "neutral-fg-hover":             $button-neutral-fg-hover,
  "neutral-fg-press":             $button-neutral-fg-press,
  "neutral-fg-disabled":          $button-neutral-fg-disabled,
  "neutral-bg-idle":              $button-neutral-bg-idle,
  "neutral-bg-hover":             $button-neutral-bg-hover,
  "neutral-bg-press":             $button-neutral-bg-press,
  "neutral-bg-disabled":          $button-neutral-bg-disabled,
  "neutral-border-idle":          $button-neutral-border-idle,
  "neutral-border-hover":         $button-neutral-border-hover,
  "neutral-border-press":         $button-neutral-border-press,
  "neutral-border-disabled":      $button-neutral-border-disabled,
  // Danger
  "danger-fg-idle":               $button-danger-fg-idle,
  "danger-fg-hover":              $button-danger-fg-hover,
  "danger-fg-press":              $button-danger-fg-press,
  "danger-fg-disabled":           $button-danger-fg-disabled,
  "danger-bg-idle":               $button-danger-bg-idle,
  "danger-bg-hover":              $button-danger-bg-hover,
  "danger-bg-press":              $button-danger-bg-press,
  "danger-bg-disabled":           $button-danger-bg-disabled,
  "danger-border-idle":           $button-danger-border-idle,
  "danger-border-hover":          $button-danger-border-hover,
  "danger-border-press":          $button-danger-border-press,
  "danger-border-disabled":       $button-danger-border-disabled,
  // Success
  "success-fg-idle":              $button-success-fg-idle,
  "success-fg-hover":             $button-success-fg-hover,
  "success-fg-press":             $button-success-fg-press,
  "success-fg-disabled":          $button-success-fg-disabled,
  "success-bg-idle":              $button-success-bg-idle,
  "success-bg-hover":             $button-success-bg-hover,
  "success-bg-press":             $button-success-bg-press,
  "success-bg-disabled":          $button-success-bg-disabled,
  "success-border-idle":          $button-success-border-idle,
  "success-border-hover":         $button-success-border-hover,
  "success-border-press":         $button-success-border-press,
  "success-border-disabled":      $button-success-border-disabled,
  // Warning
  "warning-fg-idle":              $button-warning-fg-idle,
  "warning-fg-hover":             $button-warning-fg-hover,
  "warning-fg-press":             $button-warning-fg-press,
  "warning-fg-disabled":          $button-warning-fg-disabled,
  "warning-bg-idle":              $button-warning-bg-idle,
  "warning-bg-hover":             $button-warning-bg-hover,
  "warning-bg-press":             $button-warning-bg-press,
  "warning-bg-disabled":          $button-warning-bg-disabled,
  "warning-border-idle":          $button-warning-border-idle,
  "warning-border-hover":         $button-warning-border-hover,
  "warning-border-press":         $button-warning-border-press,
  "warning-border-disabled":      $button-warning-border-disabled,
  // Info
  "info-fg-idle":                 $button-info-fg-idle,
  "info-fg-hover":                $button-info-fg-hover,
  "info-fg-press":                $button-info-fg-press,
  "info-fg-disabled":             $button-info-fg-disabled,
  "info-bg-idle":                 $button-info-bg-idle,
  "info-bg-hover":                $button-info-bg-hover,
  "info-bg-press":                $button-info-bg-press,
  "info-bg-disabled":             $button-info-bg-disabled,
  "info-border-idle":             $button-info-border-idle,
  "info-border-hover":            $button-info-border-hover,
  "info-border-press":            $button-info-border-press,
  "info-border-disabled":         $button-info-border-disabled,
  // Black
  "black-fg-idle":                $button-black-fg-idle,
  "black-fg-hover":               $button-black-fg-hover,
  "black-fg-press":               $button-black-fg-press,
  "black-fg-disabled":            $button-black-fg-disabled,
  "black-bg-idle":                $button-black-bg-idle,
  "black-bg-hover":               $button-black-bg-hover,
  "black-bg-press":               $button-black-bg-press,
  "black-bg-disabled":            $button-black-bg-disabled,
  "black-border-idle":            $button-black-border-idle,
  "black-border-hover":           $button-black-border-hover,
  "black-border-press":           $button-black-border-press,
  "black-border-disabled":        $button-black-border-disabled,
  // White
  "white-fg-idle":                $button-white-fg-idle,
  "white-fg-hover":               $button-white-fg-hover,
  "white-fg-press":               $button-white-fg-press,
  "white-fg-disabled":            $button-white-fg-disabled,
  "white-bg-idle":                $button-white-bg-idle,
  "white-bg-hover":               $button-white-bg-hover,
  "white-bg-press":               $button-white-bg-press,
  "white-bg-disabled":            $button-white-bg-disabled,
  "white-border-idle":            $button-white-border-idle,
  "white-border-hover":           $button-white-border-hover,
  "white-border-press":           $button-white-border-press,
  "white-border-disabled":        $button-white-border-disabled,
);

Design tokens

This component consumes design tokens from Chassis Tokens with the $cx- prefix. — See the design tokens page.

$button-medium-font:                      $cx-font-button-medium;
$button-large-font:                       $cx-font-button-large;
$button-small-font:                       $cx-font-button-small;

$button-medium-min-size:                 $cx-size-button-medium-main;
$button-medium-padding-y:                 $cx-space-button-medium-padding-y;
$button-medium-padding-x:                 $cx-space-button-medium-padding-x;
$button-medium-gap:                       $cx-space-button-medium-gap;
$button-medium-nudge:                      $cx-space-button-medium-nudge;

$button-large-min-size:                  $cx-size-button-large-main;
$button-large-padding-y:                  $cx-space-button-large-padding-y;
$button-large-padding-x:                  $cx-space-button-large-padding-x;
$button-large-gap:                        $cx-space-button-large-gap;
$button-large-nudge:                       $cx-space-button-large-nudge;

$button-small-min-size:                  $cx-size-button-small-main;
$button-small-padding-y:                  $cx-space-button-small-padding-y;
$button-small-padding-x:                  $cx-space-button-small-padding-x;
$button-small-gap:                        $cx-space-button-small-gap;
$button-small-nudge:                       $cx-space-button-small-nudge;

$button-medium-icon-size:                 $cx-size-button-medium-icon;
$button-large-icon-size:                  $cx-size-button-large-icon;
$button-small-icon-size:                  $cx-size-button-small-icon;

$button-caret-icon:                       $cx-icon-button-caret;
$button-medium-caret-size:                $cx-size-button-medium-caret;
$button-large-caret-size:                 $cx-size-button-large-caret;
$button-small-caret-size:                 $cx-size-button-small-caret;

$button-border-width:                     $cx-border-width-button-main;
$button-medium-border-radius:             $cx-border-radius-button-medium;
$button-large-border-radius:              $cx-border-radius-button-large;
$button-small-border-radius:              $cx-border-radius-button-small;
$button-default-fg-idle:                  $cx-color-button-default-fg-idle;
$button-default-fg-hover:                 $cx-color-button-default-fg-hover;
$button-default-fg-press:                 $cx-color-button-default-fg-press;
$button-default-fg-disabled:              $cx-color-button-default-fg-disabled;
$button-default-bg-idle:                  $cx-color-button-default-bg-idle;
$button-default-bg-hover:                 $cx-color-button-default-bg-hover;
$button-default-bg-press:                 $cx-color-button-default-bg-press;
$button-default-bg-disabled:              $cx-color-button-default-bg-disabled;
$button-default-border-idle:              $cx-color-button-default-border-idle;
$button-default-border-hover:             $cx-color-button-default-border-hover;
$button-default-border-press:             $cx-color-button-default-border-press;
$button-default-border-disabled:          $cx-color-button-default-border-disabled;

$button-alternate-fg-idle:                $cx-color-button-alternate-fg-idle;
$button-alternate-fg-hover:               $cx-color-button-alternate-fg-hover;
$button-alternate-fg-press:               $cx-color-button-alternate-fg-press;
$button-alternate-fg-disabled:            $cx-color-button-alternate-fg-disabled;
$button-alternate-bg-idle:                $cx-color-button-alternate-bg-idle;
$button-alternate-bg-hover:               $cx-color-button-alternate-bg-hover;
$button-alternate-bg-press:               $cx-color-button-alternate-bg-press;
$button-alternate-bg-disabled:            $cx-color-button-alternate-bg-disabled;
$button-alternate-border-idle:            $cx-color-button-alternate-border-idle;
$button-alternate-border-hover:           $cx-color-button-alternate-border-hover;
$button-alternate-border-press:           $cx-color-button-alternate-border-press;
$button-alternate-border-disabled:        $cx-color-button-alternate-border-disabled;

$button-primary-fg-idle:                  $cx-color-button-primary-fg-idle;
$button-primary-fg-hover:                 $cx-color-button-primary-fg-hover;
$button-primary-fg-press:                 $cx-color-button-primary-fg-press;
$button-primary-fg-disabled:              $cx-color-button-primary-fg-disabled;
$button-primary-bg-idle:                  $cx-color-button-primary-bg-idle;
$button-primary-bg-hover:                 $cx-color-button-primary-bg-hover;
$button-primary-bg-press:                 $cx-color-button-primary-bg-press;
$button-primary-bg-disabled:              $cx-color-button-primary-bg-disabled;
$button-primary-border-idle:              $cx-color-button-primary-border-idle;
$button-primary-border-hover:             $cx-color-button-primary-border-hover;
$button-primary-border-press:             $cx-color-button-primary-border-press;
$button-primary-border-disabled:          $cx-color-button-primary-border-disabled;

$button-secondary-fg-idle:                $cx-color-button-secondary-fg-idle;
$button-secondary-fg-hover:               $cx-color-button-secondary-fg-hover;
$button-secondary-fg-press:               $cx-color-button-secondary-fg-press;
$button-secondary-fg-disabled:            $cx-color-button-secondary-fg-disabled;
$button-secondary-bg-idle:                $cx-color-button-secondary-bg-idle;
$button-secondary-bg-hover:               $cx-color-button-secondary-bg-hover;
$button-secondary-bg-press:               $cx-color-button-secondary-bg-press;
$button-secondary-bg-disabled:            $cx-color-button-secondary-bg-disabled;
$button-secondary-border-idle:            $cx-color-button-secondary-border-idle;
$button-secondary-border-hover:           $cx-color-button-secondary-border-hover;
$button-secondary-border-press:           $cx-color-button-secondary-border-press;
$button-secondary-border-disabled:        $cx-color-button-secondary-border-disabled;

$button-neutral-fg-idle:                  $cx-color-button-neutral-fg-idle;
$button-neutral-fg-hover:                 $cx-color-button-neutral-fg-hover;
$button-neutral-fg-press:                 $cx-color-button-neutral-fg-press;
$button-neutral-fg-disabled:              $cx-color-button-neutral-fg-disabled;
$button-neutral-bg-idle:                  $cx-color-button-neutral-bg-idle;
$button-neutral-bg-hover:                 $cx-color-button-neutral-bg-hover;
$button-neutral-bg-press:                 $cx-color-button-neutral-bg-press;
$button-neutral-bg-disabled:              $cx-color-button-neutral-bg-disabled;
$button-neutral-border-idle:              $cx-color-button-neutral-border-idle;
$button-neutral-border-hover:             $cx-color-button-neutral-border-hover;
$button-neutral-border-press:             $cx-color-button-neutral-border-press;
$button-neutral-border-disabled:          $cx-color-button-neutral-border-disabled;

$button-danger-fg-idle:                   $cx-color-button-danger-fg-idle;
$button-danger-fg-hover:                  $cx-color-button-danger-fg-hover;
$button-danger-fg-press:                  $cx-color-button-danger-fg-press;
$button-danger-fg-disabled:               $cx-color-button-danger-fg-disabled;
$button-danger-bg-idle:                   $cx-color-button-danger-bg-idle;
$button-danger-bg-hover:                  $cx-color-button-danger-bg-hover;
$button-danger-bg-press:                  $cx-color-button-danger-bg-press;
$button-danger-bg-disabled:               $cx-color-button-danger-bg-disabled;
$button-danger-border-idle:               $cx-color-button-danger-border-idle;
$button-danger-border-hover:              $cx-color-button-danger-border-hover;
$button-danger-border-press:              $cx-color-button-danger-border-press;
$button-danger-border-disabled:           $cx-color-button-danger-border-disabled;

$button-success-fg-idle:                  $cx-color-button-success-fg-idle;
$button-success-fg-hover:                 $cx-color-button-success-fg-hover;
$button-success-fg-press:                 $cx-color-button-success-fg-press;
$button-success-fg-disabled:              $cx-color-button-success-fg-disabled;
$button-success-bg-idle:                  $cx-color-button-success-bg-idle;
$button-success-bg-hover:                 $cx-color-button-success-bg-hover;
$button-success-bg-press:                 $cx-color-button-success-bg-press;
$button-success-bg-disabled:              $cx-color-button-success-bg-disabled;
$button-success-border-idle:              $cx-color-button-success-border-idle;
$button-success-border-hover:             $cx-color-button-success-border-hover;
$button-success-border-press:             $cx-color-button-success-border-press;
$button-success-border-disabled:          $cx-color-button-success-border-disabled;

$button-warning-fg-idle:                  $cx-color-button-warning-fg-idle;
$button-warning-fg-hover:                 $cx-color-button-warning-fg-hover;
$button-warning-fg-press:                 $cx-color-button-warning-fg-press;
$button-warning-fg-disabled:              $cx-color-button-warning-fg-disabled;
$button-warning-bg-idle:                  $cx-color-button-warning-bg-idle;
$button-warning-bg-hover:                 $cx-color-button-warning-bg-hover;
$button-warning-bg-press:                 $cx-color-button-warning-bg-press;
$button-warning-bg-disabled:              $cx-color-button-warning-bg-disabled;
$button-warning-border-idle:              $cx-color-button-warning-border-idle;
$button-warning-border-hover:             $cx-color-button-warning-border-hover;
$button-warning-border-press:             $cx-color-button-warning-border-press;
$button-warning-border-disabled:          $cx-color-button-warning-border-disabled;

$button-info-fg-idle:                     $cx-color-button-info-fg-idle;
$button-info-fg-hover:                    $cx-color-button-info-fg-hover;
$button-info-fg-press:                    $cx-color-button-info-fg-press;
$button-info-fg-disabled:                 $cx-color-button-info-fg-disabled;
$button-info-bg-idle:                     $cx-color-button-info-bg-idle;
$button-info-bg-hover:                    $cx-color-button-info-bg-hover;
$button-info-bg-press:                    $cx-color-button-info-bg-press;
$button-info-bg-disabled:                 $cx-color-button-info-bg-disabled;
$button-info-border-idle:                 $cx-color-button-info-border-idle;
$button-info-border-hover:                $cx-color-button-info-border-hover;
$button-info-border-press:                $cx-color-button-info-border-press;
$button-info-border-disabled:             $cx-color-button-info-border-disabled;

$button-black-fg-idle:                    $cx-color-button-black-fg-idle;
$button-black-fg-hover:                   $cx-color-button-black-fg-hover;
$button-black-fg-press:                   $cx-color-button-black-fg-press;
$button-black-fg-disabled:                $cx-color-button-black-fg-disabled;
$button-black-bg-idle:                    $cx-color-button-black-bg-idle;
$button-black-bg-hover:                   $cx-color-button-black-bg-hover;
$button-black-bg-press:                   $cx-color-button-black-bg-press;
$button-black-bg-disabled:                $cx-color-button-black-bg-disabled;
$button-black-border-idle:                $cx-color-button-black-border-idle;
$button-black-border-hover:               $cx-color-button-black-border-hover;
$button-black-border-press:               $cx-color-button-black-border-press;
$button-black-border-disabled:            $cx-color-button-black-border-disabled;

$button-white-fg-idle:                    $cx-color-button-white-fg-idle;
$button-white-fg-hover:                   $cx-color-button-white-fg-hover;
$button-white-fg-press:                   $cx-color-button-white-fg-press;
$button-white-fg-disabled:                $cx-color-button-white-fg-disabled;
$button-white-bg-idle:                    $cx-color-button-white-bg-idle;
$button-white-bg-hover:                   $cx-color-button-white-bg-hover;
$button-white-bg-press:                   $cx-color-button-white-bg-press;
$button-white-bg-disabled:                $cx-color-button-white-bg-disabled;
$button-white-border-idle:                $cx-color-button-white-border-idle;
$button-white-border-hover:               $cx-color-button-white-border-hover;
$button-white-border-press:               $cx-color-button-white-border-press;
$button-white-border-disabled:            $cx-color-button-white-border-disabled;