Styling
The Baseera stylesheet, its CSS variables, and how color schemes are pinned with data-baseera-scheme.
The UI kit is styled by one stylesheet. Import it once:
import "@baseera/ui/baseera.css";@baseera/ui/styles.css is the same file. Every rule is a baseera-* class, and every color is a CSS variable, so you can restyle the kit without touching its components.
Override variables
The variables live on :root for light and on .dark for dark. Override them in your own stylesheet, after you import the kit's:
:root {
--baseera-primary: #0b5fff;
--baseera-primary-fg: #ffffff;
--baseera-radius: 10px;
}
.dark {
--baseera-primary: #6b9bff;
}For a per-instance change, use the theme prop. It sets the matching variables on the component's root. See Theming.
Variables
| Variable | What it paints |
|---|---|
--baseera-primary, --baseera-primary-fg | The main action and the text on it. |
--baseera-secondary, --baseera-secondary-fg | A secondary action. |
--baseera-accent, --baseera-accent-fg | Focus rings and progress. |
--baseera-card, --baseera-card-fg, --baseera-card-muted | The card the content sits on, its text and its secondary text. |
--baseera-card-soft, --baseera-card-line | The soft fill and the hairline on the card. |
--baseera-frame, --baseera-frame-fg, --baseera-frame-muted | The frame around the card: header and input row. |
--baseera-crit-solid, --baseera-crit-bg, --baseera-crit-fg | Critical, or blocking, state. |
--baseera-warn-solid, --baseera-warn-bg, --baseera-warn-pill, --baseera-warn-fg | Warning state. |
--baseera-ok-solid, --baseera-ok-bg, --baseera-ok-pill, --baseera-ok-fg | Success state. |
--baseera-info-solid, --baseera-info-bg, --baseera-info-fg | Information state. |
--baseera-live-solid, --baseera-live-bg, --baseera-live-fg | Live activity. |
--baseera-shadow | The panel's shadow. |
--baseera-font | The font stack. The default covers Arabic. |
--baseera-font-display | The display font. Defaults to --baseera-font. |
--baseera-radius | The corner radius of bubbles and cards. Not set on :root: the stylesheet falls back to 16px. |
The stylesheet defines more variables than these, for tones derived from them. Open @baseera/ui/baseera.css to see the full list.
State colors can also be set through the theme prop, with one color each. The soft background and the readable text are then derived for you so they keep a 4.5 to 1 contrast. See Theming.
Color schemes and data-baseera-scheme
The light palette is defined on :root and on any element with data-baseera-scheme="light". The dark palette is defined on .dark and on any element with data-baseera-scheme="dark".
The components set data-baseera-scheme on their own root, from their theme. That pins the palette to the component, so a .dark class that your page toggles on <html> does not repaint a component that asked for light, and the reverse.
<div data-baseera-root data-baseera-scheme="light">
{/* kit components */}
</div>If you place plain components such as ApprovalCard and ToolStatus in your own markup, wrap them in an element with data-baseera-root and data-baseera-scheme, as above, so they pick up the font and the palette. Set dir on that wrapper for right to left.
Direction
All rules use CSS logical properties, so right to left needs no extra CSS. Set dir on the component or let it read <html dir>.
Content Security Policy
The logo the console publishes is shown from a blob: URL, so a CSP needs img-src blob: for it. The client talks to your runtime URL, so allow it in connect-src.
Reduced motion
Under prefers-reduced-motion the panel has no geometry transition, only a 150 ms fade, and the approval card and tool status show no animation.