Theming
-axxy- ships interaction and accessibility behavior without requiring any stylesheet. Because it operates directly on standard HTML and W3C ARIA states in light DOM, any Design System can layer its visual identity onto standard selectors such as [role="tablist"], [aria-selected="true"], and [aria-expanded]. For projects that want a clean, accessible starting point out of the box, axxy-theming (located in packages/axxy-theming/) provides a standalone, non-opinionated default theme built around CSS custom properties and cascade layers.
Using the default theme
Import the full bundle to load both design tokens and component styles, or import individual pieces:
/* Full default theme */
import 'axxy-theming';
/* Or import tokens, components, and optional presets separately */
@import 'axxy-theming/tokens.css';
@import 'axxy-theming/components.css';
@import 'axxy-theming/themes/dark.css';
@import 'axxy-theming/themes/warm.css';
All rules in axxy-theming live inside CSS Cascade Layers (@layer axxy-tokens, axxy-theme). Any ordinary, unlayered CSS in your application automatically overrides the default theme without specificity battles or !important.
Design tokens
Every component in axxy-theming reads from --axxy-* custom properties defined on :root:
| Token | Default | Purpose |
|---|---|---|
--axxy-bg | #fff | Primary page and control background |
--axxy-surface | #f4f7f7 | Subtle container surfaces (toolbars, menubars, inactive tabs, table headers) |
--axxy-surface-hover | #ebfaf9 | Hover background for interactive items |
--axxy-surface-active | #d5fffb | Selected and pressed control surfaces |
--axxy-border | #9abcb9 | Primary control and container borders |
--axxy-border-subtle | #c5d9d7 | Secondary dividers, table cells, and subtle outlines |
--axxy-text | #202124 | Primary foreground text |
--axxy-text-muted | #4b5a5f | Secondary labels, hints, and inactive icons |
--axxy-accent | #0f615a | Active indicators, links, checked controls, and accents |
--axxy-accent-contrast | #fff | Text/icon color rendered on top of --axxy-accent |
--axxy-focus | #6840b5 | Visible keyboard focus ring (:focus-visible) |
--axxy-danger | #a61c1c | Invalid input borders and error messages |
--axxy-radius | .35rem | Shared corner radius for buttons, inputs, tabs, and popovers |
--axxy-shadow | 0 6px 18px rgb(0 0 0 / .14) | Elevation shadow for floating menus, tooltips, and popovers |
Overriding tokens and creating custom themes
Override tokens globally on :root, or scope multiple themes with data-axxy-theme. You can switch the entire documentation site between Default, Dark, and Warm using the Theme selector in the site header.
/* Override the default theme globally */
:root {
--axxy-accent: #1d4ed8;
--axxy-surface-active: #dbeafe;
--axxy-radius: .5rem;
}
/* Or define a named theme selectable via data-axxy-theme="ocean" */
[data-axxy-theme="ocean"] {
--axxy-bg: #f8fafc;
--axxy-surface: #e2e8f0;
--axxy-surface-hover: #dbeafe;
--axxy-surface-active: #bfdbfe;
--axxy-border: #64748b;
--axxy-accent: #0369a1;
--axxy-focus: #7c3aed;
}
Interactive theme customizer
Try switching presets or tweaking tokens below. Changes apply live to the preview container and generate a ready-to-paste CSS snippet.
All controls inside this preview inherit your live --axxy-* token overrides.
Override any subset of tokens on :root or a scoped container.
Unlayered CSS overrides @layer axxy-theme cleanly without !important.
/* Adjust any token above to generate a custom theme override. */