Bridge API (Adapters)
This page describes the adapter bridge API: a narrow seam intended for integrating Axiomatic Color into a host system that already owns its palette variables and chrome.
Most consumers should not use bridge exports directly. Prefer semantic classes and exported tokens.
See also
Section titled “See also”What the bridge exports are
Section titled “What the bridge exports are”Bridge exports are a small set of CSS custom properties in the --axm-bridge-* family that adapters may read.
They exist to avoid two bad outcomes:
- depending on engine internals (
--axm-*/--_axm-*), and - spreading host-specific overrides throughout authored components.
One-file rule
Section titled “One-file rule”All host-variable integration should live in a single adapter stylesheet (a “bridge file”). That file is the only place where host variables and bridge wiring belong.
Example mapping (conceptual)
Section titled “Example mapping (conceptual)”/* Adapter stylesheet (single boundary file) */:root { /* Map host palette variables into Axiomatic bridge exports */ --host-color-text: var(--axm-bridge-fg); --host-color-border: var(--axm-bridge-border-int); --host-color-hairline: var(--axm-bridge-border-dec);}Continuity constraints (non-negotiable)
Section titled “Continuity constraints (non-negotiable)”The bridge exports must not become a second animation driver.
- Do not transition
--axm-bridge-*. - Do not transition
border-colorin chrome while borders are bridge-routed. - Do not use
border: … currentColorfor chrome borders; route borders through bridge exports (for example--axm-bridge-border-int).
These rules prevent “popping” where some chrome regions update on different ticks than the engine-driven transition.