updated 2026-11-26·2 min read
Extension CSS Variables
Scoped extension CSS conventions, dynamic React portal slot hosts, settings row tokens, and status bar tokens.
Standards and host CSS tokens for styling custom extension UI components, React portal slots, settings tabs, and status bar items.
1. Scoped Extension Styling
Scope extension stylesheets (styles.css, injected as <style id="noether-extension-style-<id>">) to an extension-specific class prefix and reference --noether-* host variables:
.noether-ext-word-counter {
background-color: var(--noether-bg-card);
border: 1px solid var(--noether-border-base);
border-radius: 6px;
padding: 8px 12px;
}
.noether-ext-word-counter .counter-badge {
color: var(--noether-text-secondary);
font-size: 0.85em;
}
2. Dynamic Portal Slot Containers
ExtensionPortalSlotHost mounts slots (workspace:root, editor:floating-toolbar, editor:minimap, editor:viewport-overlay, editor:subheader-actions, editor:content-overlay, editor:banner, editor:gutter) inside <div data-portal-slot="<slot>" className="pointer-events-none">. Interactive slot elements should enable pointer-events-auto and use standard surface/elevation tokens (--noether-bg-popover, --noether-border-base, --noether-shadow-2, --noether-shadow-3).
3. Settings Preferences Tokens
SettingCard, SettingItem, and SettingBuilder consume the core border and text tokens:
| Token | Dark Default | Light Default | Usage |
|---|---|---|---|
--noether-border-subtle | #202020 | #f0f0f2 | Divider between setting rows (noether-setting-item). |
--noether-text-primary | #ffffff | #09090b | SettingCard section heading color. |
--noether-text-secondary | #dcddde | #27272a | SettingItem title color. |
--noether-text-muted | #888888 | #52525b | SettingItem description text color. |
4. Status Bar Extension Items
Status bar widgets added via this.addStatusBarItem() render inside .noether-status-bar:
| Token | Dark Default | Light Default | Usage |
|---|---|---|---|
--noether-bg-statusbar | #1f1f1f | #f4f4f5 | Bottom status bar background. |
--noether-border-base | #292929 | #e4e4e7 | Status bar top/left border. |
--noether-text-muted | #888888 | #52525b | Default status bar text and icon color. |