Skip to main contentSkip to docs navigation

Chassis

Customize Chassis CSS with built-in variables to easily toggle global CSS preferences for controlling style, behavior, and optimizing your build.

Overview

Chassis CSS turns features on and off with $enable-* Sass variables. Each one is a switch for a part of the compiled CSS, so the options decide:

  • Bundle size: leave out the features your project does not use
  • Rendering cost: drop shadows, gradients, and transitions
  • Accessibility: keep or replace the framework's handling of reduced motion and reduced transparency
  • Visual style: rounded corners, shadows, carets, validation icons

How to customize settings

The options are !default variables of scss/config/_settings.scss. Configure them with @use … with (…) on the config module, before the module that loads the framework:

SCSS
// custom.scss
@use "@chassis-ui/css/scss/config" with (
  $enable-dark-mode: false,        // No dark mode
  $enable-validation-icons: false  // No icons in validated form fields
);

// Then load Chassis CSS
@use "@chassis-ui/css/scss/chassis";

Then recompile your CSS. A variable assigned in your file without with (…) belongs to your file and changes nothing in the framework — see Variable defaults.

Configuration options

Every option is in one table, in alphabetical order.

VariableValuesDescription
$enable-accordion-contextstrue (default) or falseEnables contextual styling for accordion components (primary, secondary, etc.) to match your design system colors.
$enable-accordion-sizestrue (default) or falseGenerates size variations for accordions (sm, md, lg), allowing for different visual weights in layouts.
$enable-button-pointerstrue (default) or falseSets cursor: pointer on non-disabled buttons, providing visual feedback that elements are interactive.
$enable-carettrue (default) or falseAdds a caret automatically to native select elements, comboboxes, and menu toggles.
$enable-background-gradientstrue or false (default)Applies subtle gradient backgrounds to various components via background-image. Off by default for a flat visual style and a smaller CSS file.
$enable-component-shadowstrue (default) or falseEnables predefined decorative box-shadow styles on various components for depth.
$enable-container-classestrue (default) or falseGenerates CSS classes for layout containers (.container, .container.fluid, etc.). Disable to reduce CSS size if you're using custom containers.
$enable-container-queriestrue (default) or falseGenerates the container variants under the @ prefix (.@md:col-span-6, .@md:d-flex) for the grid classes and for the utilities with container: true, and the .grid.contained modifier. Disable to reduce CSS size if you lay out by the viewport only.
$enable-dark-modetrue (default) or falseImplements dark mode support throughout the framework, with automatic detection and toggle capability.
$enable-deprecation-messagestrue (default) or falsePrints a Sass warning at compile time when the build uses a mixin or variable that is deprecated and scheduled for removal.
$enable-display-scaletrue or false (default)Generates the size and line-height scale of the display family, which .font-display points the size utilities at. Off, .font-display sets the family and its weights only. Turn it on for a brand whose display typeface has sizes of its own.
$enable-elevation-shadowstrue (default) or falseGenerates elevation-specific shadow utilities that create consistent layering effects based on design tokens.
$enable-exclude-strokestrue (default), false, or listControls border width exclusion from padding for components. true applies to all components, false never applies, or provide a list like button, badge, form-control, notification for specific components.
$enable-grid-systemtrue (default) or falseGenerates the grid system: .grid, .grid-fill, the span, start, and end classes (.col-span-6, .md:col-start-3), and the grid utilities (grid-cols-*, grid-rows-*, grid-flow-*, auto-cols-*, auto-rows-*). Disable for a components-only build with a layout of its own; the containers, the gap utilities, and the fraction widths stay. Named $enable-cssgrid until v0.7.0.
$enable-important-utilitiestrue (default) or falseAdds !important to the declarations of the utility placeholders (%font, %font-size, %fg-color, %bg-color, %border-color, %icon-color, %link-color) for a project that extends them. The utility classes take !important one by one, with the important option of the utility API.
$enable-negative-marginstrue (default) or falseGenerates negative margin utilities like .-m-md, -mt-sm. Useful for precise layout adjustments.
$enable-property-opacitiestrue (default) or falseGenerates the opacity utilities of single properties: .fg-opacity-*, .bg-opacity-*, .border-opacity-*, .cue-opacity-*, and .text-decoration-opacity-*.
$enable-prose-scaletrue or false (default)Generates the size and line-height scale of the prose family, which .font-prose points the size utilities at. Off, .font-prose sets the family and its weights only. Turn it on for a brand whose reading typeface has sizes of its own.
$enable-reduced-motiontrue (default) or falseRespects the prefers-reduced-motion media query, reducing or eliminating animations for users who prefer minimal motion. Critical for vestibular disorders.
$enable-responsive-font-sizestrue (default) or falseEnables responsive size utility classes for locking font sizes to specific breakpoints.
$enable-fluid-font-sizestrue (default) or falseEnables fluid sizing — font sizes scale smoothly between a minimum and maximum using clamp().
$enable-rounded-borderstrue (default) or falseApplies border-radius styles to various components. Disabling will override all border-radius values, including those specified by design tokens.
$enable-smooth-scrolltrue (default) or falseEnables scroll-behavior: smooth for smoother page navigation, while respecting reduced motion preferences.
$enable-table-active-bordertrue (default) or falseAdds a prominent colored border indicator to active table rows or cells, matching the visual treatment in your design system. Improves focus indication.
$enable-table-border-radiustrue (default) or falseApplies consistent border-radius values to tables from design tokens, creating visually cohesive rounded corners that match other components.
$enable-table-font-tokenstrue (default) or falseUses typography values from design tokens for table headers and cells, ensuring consistent text styling that adapts with your design system.
$enable-transitionstrue (default) or falseEnables smooth transition animations on interactive elements. Disable for instant state changes or to reduce CSS size.
$enable-translucencytrue (default) or falseEnables the frosted-glass effect of .translucent components (backdrop-filter over a semi-transparent background), which already steps aside for prefers-reduced-transparency.
$enable-validation-iconstrue (default) or falseAdds feedback icons within form elements for validation states (success, error), enhancing visual feedback for users.
$enable-visited-linkstrue (default) or falseApplies distinct styling to visited links (a:visited), improving navigation by providing visual feedback about previously accessed content.

Color mode type

In addition to the $enable-* variables above, the $color-mode-type variable sets what the styles of the color-mode() mixin follow. It changes the mixin only: the colors of the framework always follow both the data-cx-theme attribute and the system preference.

  • auto (default): The data-cx-theme attribute and the prefers-color-scheme media query, as the colors of the framework do.
  • data: The data-cx-theme attribute only.
  • media-query: The prefers-color-scheme media query only.

Default configuration

Every option is on by default in scss/config/_settings.scss, and $color-mode-type is auto:

$enable-accordion-sizes:        true;
$enable-accordion-contexts:     true;
$enable-button-pointers:        true;
$enable-background-gradients:   false;
$enable-caret:                  true;
$enable-component-shadows:      true;
$enable-container-classes:      true;
$enable-container-queries:      true; // the `@md:` container-query variants of the grid classes and of the utilities with `container: true`, and `.grid.contained`
$enable-dark-mode:              true;
$enable-deprecation-messages:   true;
$enable-display-scale:          false; // the size and line-height scale of the `display` family, which `.font-display` points the size utilities at
$enable-elevation-shadows:      true;
$enable-exclude-strokes:        true; // true (always), false (never), or list of components that exclude border width from padding
$enable-grid-system:            true; // `.grid`, `.grid-fill`, their placement classes and the `grid-cols-*`, `grid-rows-*`, `grid-flow-*`, `auto-cols-*` and `auto-rows-*` utilities
$enable-important-utilities:    true;
$enable-negative-margins:       true;
$enable-property-opacities:     true;
$enable-prose-scale:            false; // the size and line-height scale of the `prose` family, which `.font-prose` points the size utilities at
$enable-reduced-motion:         true;
$enable-fluid-font-sizes:       true; // fluid typography using clamp() for font sizes
$enable-responsive-font-sizes:  true; // breakpoint-based responsive utilities for icon and font sizes
$enable-rounded-borders:        true;
$enable-smooth-scroll:          true;
$enable-table-active-border:    true;
$enable-table-border-radius:    true;
$enable-table-font-tokens:      true;
$enable-transitions:            true;
$enable-translucency:           true;
$enable-validation-icons:       true;
$enable-visited-links:          true;

// What the styles of the `color-mode()` mixin follow.
// `auto` follows the system preference and the `data-cx-theme` attribute, as
// the colors of the framework do.
// `data` follows the `[data-cx-theme="dark"]` attribute only.
// `media-query` follows the `(prefers-color-scheme: dark)` media query only.
$color-mode-type:               auto; // `auto`, `data` or `media-query`

Performance considerations

The options change the size of the CSS and the work the browser does to render it.

Reducing bundle size

For smaller CSS files, consider disabling:

  • Visual effects: Disable $enable-component-shadows for a more minimal style, and leave $enable-background-gradients off, its default
  • Form features: Turn off $enable-validation-icons if you implement custom validation UI
  • Transitions: Set $enable-transitions: false for a more minimal build

Runtime performance

For better rendering performance, especially on lower-powered devices:

  • Fewer animations: Set $enable-transitions: false to eliminate transition animations
  • Simpler rendering: Disable $enable-component-shadows, and leave $enable-background-gradients off, its default, to reduce GPU/CPU load
  • Typography: Consider $enable-fluid-font-sizes: false if you don't need responsive font scaling

Production builds

When deploying to production:

  • Set $enable-deprecation-messages: false to keep the build output free of deprecation warnings
  • Consider $enable-smooth-scroll: false if you implement custom scroll behaviors
  • Audit your usage of dark mode with $enable-dark-mode - disable if unused