@airframeui/tokens
v0.5.0
Published
Airframe UI Tokens, CSS variables, JSON, and typed exports used by @airframeui/core
Maintainers
Readme
@airframeui/tokens
Airframe UI Tokens — CSS variables, JSON, and a typed JavaScript export.
Most apps should install @airframeui/core, which depends on this package and loads the tokens stylesheet for you. Install tokens directly when you need the token map in tooling, or want tokens without the full core CSS.
npm install @airframeui/core
# or, tokens only:
npm install @airframeui/tokensUsage
With @airframeui/core (recommended)
@import '@airframeui/core/core.css';No separate tokens import is required.
Tokens stylesheet only
@import '@airframeui/tokens/tokens.css';Programmatic access
import { tokens } from '@airframeui/tokens';
// tokens.primitives, tokens.semantic, tokens.breakpoints, …JSON map for tooling: @airframeui/tokens/tokens.json
Token catalog (name, per-mode defaults, descriptions) for docs, VS Code, and AI:
import { catalog } from '@airframeui/tokens';Also: @airframeui/tokens/catalog.json
Themes
Light is the default. Switch color scheme with data-theme or the .dark class. Switch brand palettes with data-brand (composes with scheme). Lock a subtree to the catalog light or dark canvas with .af-force-light / .af-force-dark (surfaces and text; intents still follow the brand):
<html data-theme="dark" data-brand="delta">
…
</html>document.documentElement.setAttribute('data-theme', 'dark');
document.documentElement.setAttribute('data-brand', 'delta');Customize
Override variables in your own CSS — no rebuild of this package:
:root {
--af-base-primary: #018183;
--af-space-md: 1rem;
}See Theming and Tokens (Figma Variables export is on the roadmap).
Token model
- Primitives — literal values (colors, space, type scale, breakpoints)
- Semantic tokens — aliases that patterns and components consume
- Themes — light, dark, and high-contrast mappings included in
tokens.css
Related
@airframeui/core— structure, shells, patterns, utilities- Documentation
- Changelog
License
MIT
