A2UI bridge

A stylesheet that maps the A2UI v0.9 basic-catalog CSS variables onto cortex tokens.

@flexpixels/cortex/a2ui-bridge.css is a static CSS file shipped alongside the engine. It maps the core --a2ui-* variables of A2UI’s basic catalog (colours, spacing, type, borders) and a few component variables onto cortex --fp-* tokens. Most component variables it does not set fall back to those core variables. Load it on a page that renders the basic catalog (Text, Button, Card, TextField, Checkbox, ChoicePicker, Icon, Image, Modal, Row, Column, List, Tabs, Divider, Slider, DateTimeInput, Video, AudioPlayer) and those components take your cortex theme.

What it covers

A2UI variablesCortex tokens
--a2ui-color-primary, -secondary, -hover, on-*--fp-primary-9 / -10, --fp-secondary-9 / -10, and their -9-contrast
Surface, input and border colours--fp-surface-app, --fp-surface-element, --fp-neutral-12 (text), --fp-neutral-6 (borders)
Spacing xs / s / m / l--fp-s-2, --fp-s-3, --fp-s-4, --fp-s-6
Font family, sizes xs … 2xl, line heights, labels--fp-font-family-display, --fp-text-{caption,body,body-lg,title,headline,display}-font-size, --fp-line-height-{normal,snug}, --fp-text-label-*
Border width, radius--fp-border-1, --fp-corner-control
Card and modal overrides--fp-surface-element, --fp-elevation-rest, --fp-corner-{surface,overlay}, --fp-s-5 / -6, --fp-neutral-a5 (backdrop)
Button, text field and tab overrides--fp-elevation-rest, --fp-corner-control, --fp-s-3 / -5, --fp-focus-ring-color, --fp-surface-element, --fp-neutral-12
--a2ui-border, --a2ui-icon-color--fp-border-1 solid --fp-neutral-6; currentcolor

Every token it reads is in the default (lean) cortex stylesheet.

With settings.schemes: "both" (the default), cortex colour tokens are light-dark() pairs, so A2UI surfaces follow light and dark mode with no extra wiring.

Usage

ts
// JS / TS entry — anywhere your bundler treats .css imports as side-effects
import "@flexpixels/cortex/a2ui-bridge.css";
html
<!-- Or via a link tag -->
<link rel="stylesheet" href="/node_modules/@flexpixels/cortex/dist/a2ui-bridge.css" />

Load it alongside the theme CSS you generate with cortex (generateThemeCSS) — the bridge only forwards variables, it does not declare any --fp-* values itself.

Specificity contract

The bridge uses a bare :root { ... } selector (specificity 0,0,1,0) on purpose. @a2ui/web_core’s injectBasicCatalogStyles ships its defaults under :where(:root) / :where(.a2ui-dark) / :where(.a2ui-light) — all zero specificity. If the bridge also used :where(:root) it would tie A2UI’s runtime-injected stylesheet on specificity and lose on load order.

Your own overrides still win: a variable set on an element below the root (a region, a component host, an inline style) is what that subtree inherits, so re-binding one for part of the page is a normal CSS rule:

css
.sidebar {
  --a2ui-color-surface: var(--fp-surface-subtle);
}

Version compatibility

The current bridge targets A2UI v0.9 / @a2ui/lit v0.10. The file ships with @flexpixels/cortex and changes with it; its header comment names the A2UI version it targets.

The basic catalog’s source upstream, on the main branch: github.com/google/A2UI/tree/main/typescript/web_core/src/universal/basic_catalog.