Chassis UI Documentation
website·Indexed 30 days ago
https://chassis-ui.com/A CSS framework providing a comprehensive set of components, utilities, and helpers. Features include a Sass-based Utility API, fluid sizing, and a wide array of UI components such as Carousels, Drawers, Popovers, Tooltips, and Steppers, all designed with WCAG 2.2 compliance and accessibility in mind.
What's inside Chassis UI
- Chassis UI Tokens is a system designed for complex multi-brand organizations to manage multiple brand identities, themes, and platforms from a single repository. It uses a Git-based version control system to track token changes and review diffs via pull requests. The system is W3C Design Tokens Community Group (DTCG) compliant and platform-agnostic, supporting web, iOS, and Android outputs.
Overview of the Chassis design system architecture
Chassis is a design system infrastructure that solves the problem of design drift and scattered decisions across multiple platforms, brands, and teams. Unlike traditional systems that start with components, Chassis uses design tokens as the single source of truth. It eliminates the 'translation layer' between design and code by generating Figma variables, web styles, and native iOS/Android code from the same token source. This ensures that a design decision (e.g., a color name or value) remains identical across all implementations without manual re-implementation or approximation.Overview of Grid Gutters
Gutters are the gaps between column content in a flexbox grid. The.rowcomponent defines two CSS custom properties that columns consume:--gutter-x(controllingpadding-inlineon columns) and--gutter-y(controllingmargin-block-start). Gutter classes override these properties at the row level. The default horizontal gutter is1.5rem($grid-gutter-x), and the default vertical gutter is0($grid-gutter-y).Overview of the Chassis CSS ecosystem
Chassis CSS is a design-system-first framework designed to keep Figma and code in sync across multiple brands and platforms. It relies on a single source of truth called Chassis Tokens, which are authored in Figma via Tokens Studio, stored as JSON, and processed by Style Dictionary into platform-specific outputs (SCSS for web, Swift for iOS, XML for Android).
The ecosystem consists of three main parts:
- Chassis Tokens: The source of truth for all visual values (colors, spacing, typography).
- Chassis CSS: Consumes tokens to generate a CSS framework including color systems, layout utilities, and component styles.
- Chassis Icons: An icon library (SVG sprites and icon fonts) governed by the same token system.
Overview of Fluid Sizing in Chassis CSS
Chassis CSS uses native CSSclamp()to scale font sizes and spacing values smoothly between a minimum and maximum viewport width. This eliminates the need for breakpoints or extra classes for fluid transitions. By default, values interpolate linearly between 360px (minimum) and 1280px (maximum)./* Example compiled output for a 4rem font size */ font-size: clamp(3.4rem, 3.165rem + 1.043vw, 4rem);Overview of the Chassis design system toolkit
Chassis is an open-source design system toolkit designed for products spanning multiple brands and platforms. It is composed of several independent projects under the MIT license, centered around a core set of design tokens that all other projects build upon.Overview of Chassis CSS integration paths
Chassis CSS offers three primary ways to integrate the framework depending on the project's needs and lifespan:
- Quick Start (CDN): Load compiled CSS from a CDN into a single HTML file. This is intended for evaluation or rapid prototyping and requires no npm, bundler, or configuration.
- Installation (npm Dependency): Install
@chassis-ui/cssand its peer dependency@chassis-ui/tokensvia pnpm or npm. This is the standard setup for most projects. - Clone and Customize (Forking): For teams building a long-lived design system, the recommended path is to fork the Chassis repository, point the
_vendor.scssimport to a custom token build, and own the CSS build entirely.
Integrate Chassis CSS with Tailwind CSS v4
Chassis CSS provides a specific entry point for Tailwind CSS v4 (version 4.1+ required) that exposes Chassis components (e.g.,.button.outline,.card) and utilities (e.g.,fg-primary) as Tailwind@utilityrules. This allows the use of Tailwind variants likedark:,lg:, andhover:on Chassis classes. To avoid collisions with Tailwind's own theme keys, Chassis requires a custom-property prefixing step usingchassisPrefix({ tailwind: true })from@chassis-ui/css/postcssbefore the CSS reaches the Tailwind compiler.Use overlays inside Modals
Tooltips, popovers, toasts, and menus are fully compatible inside modal dialogs. They are automatically scoped to the dialog element for correct top-layer positioning and are dismissed automatically when the modal closes.Understand the Chassis UI architecture and package ecosystem
Chassis is a design system foundation consisting of five core MIT-licensed packages that connect Figma design decisions to production code. These packages are independently useful and can be adopted individually or together to build a custom design system across multiple platforms. The ecosystem includes:
chassis-tokens: Design tokens and transformerschassis-css: CSS frameworkchassis-react: React componentschassis-figma: Figma component librarychassis-icons: Icon library and spriteschassis-assets: Asset distributionchassis-website: Documentation and site source
Understand the Chassis CSS architectural data flow
Chassis CSS follows a specific data flow to translate design decisions from Figma into rendered components. This architecture allows for multi-brand and multi-theme builds by layering tokens and variables. The flow is as follows:
- Chassis Tokens (Figma): The single source of truth for visual decisions.
- CSS Variables: Tokens surface as
--cx-*-{step}custom properties. - Context Palettes: Color tokens are grouped into palettes (one per context color), surfaced as
--cx-{ctx}-{tok}. - Body Variables: The
.contextclass re-aims the active palette's tokens onto canonical body variables (e.g.,--cx-fg-main,--cx-bg-main). - Components: Components (e.g.,
.button,.notification) read these body variables or use component-scoped variables (e.g.,--cx-button-padding-y) that alias back to the canonical names.
Chassis Tokens → CSS variables → Context palettes → Body variables → Components (Figma) (--cx-*-{step}) (--cx-{ctx}-{tok}) (--cx-{tok}) (.button, .notification, …)Understand component-level CSS variables
Chassis CSS assigns variables at the base component level (e.g.,.navbar) to prevent style leakage into nested elements and to allow restyling after Sass compilation. This approach is used in Navbars, the CSS grid system (primarily for gutters), and Tables.