Skip to content

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.

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.

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.

/* 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);
}

The bridge exports must not become a second animation driver.

  • Do not transition --axm-bridge-*.
  • Do not transition border-color in chrome while borders are bridge-routed.
  • Do not use border: … currentColor for 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.