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:
// 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.
| Variable | Values | Description |
|---|---|---|
$enable-accordion-contexts | true (default) or false | Enables contextual styling for accordion components (primary, secondary, etc.) to match your design system colors. |
$enable-accordion-sizes | true (default) or false | Generates size variations for accordions (sm, md, lg), allowing for different visual weights in layouts. |
$enable-button-pointers | true (default) or false | Sets cursor: pointer on non-disabled buttons, providing visual feedback that elements are interactive. |
$enable-caret | true (default) or false | Adds a caret automatically to native select elements, comboboxes, and menu toggles. |
$enable-background-gradients | true 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-shadows | true (default) or false | Enables predefined decorative box-shadow styles on various components for depth. |
$enable-container-classes | true (default) or false | Generates CSS classes for layout containers (.container, .container.fluid, etc.). Disable to reduce CSS size if you're using custom containers. |
$enable-container-queries | true (default) or false | Generates 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-mode | true (default) or false | Implements dark mode support throughout the framework, with automatic detection and toggle capability. |
$enable-deprecation-messages | true (default) or false | Prints a Sass warning at compile time when the build uses a mixin or variable that is deprecated and scheduled for removal. |
$enable-display-scale | true 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-shadows | true (default) or false | Generates elevation-specific shadow utilities that create consistent layering effects based on design tokens. |
$enable-exclude-strokes | true (default), false, or list | Controls 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-system | true (default) or false | Generates 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-utilities | true (default) or false | Adds !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-margins | true (default) or false | Generates negative margin utilities like .-m-md, -mt-sm. Useful for precise layout adjustments. |
$enable-property-opacities | true (default) or false | Generates the opacity utilities of single properties: .fg-opacity-*, .bg-opacity-*, .border-opacity-*, .cue-opacity-*, and .text-decoration-opacity-*. |
$enable-prose-scale | true 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-motion | true (default) or false | Respects the prefers-reduced-motion media query, reducing or eliminating animations for users who prefer minimal motion. Critical for vestibular disorders. |
$enable-responsive-font-sizes | true (default) or false | Enables responsive size utility classes for locking font sizes to specific breakpoints. |
$enable-fluid-font-sizes | true (default) or false | Enables fluid sizing — font sizes scale smoothly between a minimum and maximum using clamp(). |
$enable-rounded-borders | true (default) or false | Applies border-radius styles to various components. Disabling will override all border-radius values, including those specified by design tokens. |
$enable-smooth-scroll | true (default) or false | Enables scroll-behavior: smooth for smoother page navigation, while respecting reduced motion preferences. |
$enable-table-active-border | true (default) or false | Adds 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-radius | true (default) or false | Applies consistent border-radius values to tables from design tokens, creating visually cohesive rounded corners that match other components. |
$enable-table-font-tokens | true (default) or false | Uses typography values from design tokens for table headers and cells, ensuring consistent text styling that adapts with your design system. |
$enable-transitions | true (default) or false | Enables smooth transition animations on interactive elements. Disable for instant state changes or to reduce CSS size. |
$enable-translucency | true (default) or false | Enables the frosted-glass effect of .translucent components (backdrop-filter over a semi-transparent background), which already steps aside for prefers-reduced-transparency. |
$enable-validation-icons | true (default) or false | Adds feedback icons within form elements for validation states (success, error), enhancing visual feedback for users. |
$enable-visited-links | true (default) or false | Applies 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): Thedata-cx-themeattribute and theprefers-color-schememedia query, as the colors of the framework do.data: Thedata-cx-themeattribute only.media-query: Theprefers-color-schememedia 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-shadowsfor a more minimal style, and leave$enable-background-gradientsoff, its default - Form features: Turn off
$enable-validation-iconsif you implement custom validation UI - Transitions: Set
$enable-transitions: falsefor a more minimal build
Runtime performance
For better rendering performance, especially on lower-powered devices:
- Fewer animations: Set
$enable-transitions: falseto eliminate transition animations - Simpler rendering: Disable
$enable-component-shadows, and leave$enable-background-gradientsoff, its default, to reduce GPU/CPU load - Typography: Consider
$enable-fluid-font-sizes: falseif you don't need responsive font scaling
Production builds
When deploying to production:
- Set
$enable-deprecation-messages: falseto keep the build output free of deprecation warnings - Consider
$enable-smooth-scroll: falseif you implement custom scroll behaviors - Audit your usage of dark mode with
$enable-dark-mode- disable if unused