CSS Variable Reference
Widgemo exposes CSS custom properties using the --widgemo-* prefix. This page lists the canonical variables intended for host-level theming and layout control.
For host stylesheet interactions with Widgemo table behavior, see Host CSS and Table Layout.
Scope and Precedence
| Scope | Pattern | Typical use |
|---|---|---|
| Global | :root { --widgemo-... } | App-wide defaults |
| Scoped container | .my-surface { --widgemo-... } | Per-widget or per-page overrides |
| Runtime theme/config | Theme provider and config theme layers | Token-level runtime theming |
When the same variable is defined in multiple scopes, normal CSS cascade and specificity rules apply.
Default Theme Palettes
Widgemo includes both default light and default dark palettes.
- Safety-net CSS variable fallbacks in
widgemo-theme.cssprovide light defaults. WidgemoThemeProviderapplies the default dark palette whentheme="dark".
Core Color Tokens (Light and Dark)
| Variable | Light default | Dark default |
|---|---|---|
--widgemo-color-primary | #0d6efd | #4d94ff |
--widgemo-color-background | #ffffff | #1e1e1e |
--widgemo-color-surfaceBg | #f8f9fa | #2d2d2d |
--widgemo-color-text | #212529 | #e0e0e0 |
--widgemo-color-textMuted | #6c757d | #adb5bd |
--widgemo-color-border | #dee2e6 | #3f454c |
--widgemo-color-success | #28a745 | #28a745 |
--widgemo-color-warning | #ffc107 | #ffc107 |
--widgemo-color-danger | #dc3545 | #dc3545 |
--widgemo-color-info | #17a2b8 | #17a2b8 |
Surface and Row Tokens (Light and Dark)
| Variable | Light default | Dark default |
|---|---|---|
--widgemo-color-tableBg | #ffffff | #1e1e1e |
--widgemo-color-tableHeaderBg | #f8f9fa | #252525 |
--widgemo-color-tableHeaderHoverBg | #e9ecef | #3f454c |
--widgemo-color-rowHoverBg | #ced4da | rgba(255, 255, 255, 0.16) |
--widgemo-color-rowAltBg | #e9ecef | rgba(255, 255, 255, 0.08) |
Action and Menu Tokens
| Variable | Default/fallback |
|---|---|
--widgemo-action-button-bg | var(--widgemo-color-actionButtonBg, transparent) |
--widgemo-action-button-color | var(--widgemo-color-actionButtonColor, #212529) |
--widgemo-action-button-border | 1px solid var(--widgemo-color-actionButtonBorder, #dee2e6) |
--widgemo-action-button-hover-bg | var(--widgemo-color-actionButtonHoverBg, rgba(0,0,0,0.05)) |
--widgemo-action-button-hover-border | var(--widgemo-color-actionButtonHoverBorder, #0d6efd) |
--widgemo-action-menu-bg | var(--widgemo-color-actionMenuBg, #ffffff) |
--widgemo-action-menu-color | var(--widgemo-color-actionMenuColor, #212529) |
--widgemo-action-menu-item-hover-bg | var(--widgemo-color-actionMenuItemHoverBg, #e9ecef) |
Layout and Spacing Tokens
| Variable | Default |
|---|---|
--widgemo-border-radius | 8px |
--widgemo-card-padding | 1rem |
--widgemo-zone-padding | 0.75rem 1rem |
--widgemo-container-padding | 0 |
--widgemo-zone-title-font-size | 1.25rem |
--widgemo-board-col-width | 280px |
--widgemo-board-swimlane-label-width | 110px |
Layering Tokens (z-index)
| Variable | Default | Purpose |
|---|---|---|
--widgemo-dropdown-z-index | 950 | Zone and table dropdown layers |
--widgemo-lightbox-z-index | 9000 | Lightbox/overlay layer |
--widgemo-dev-overlay-z-index | var(--widgemo-lightbox-z-index, 9000) | Dev overlay token |
Note: DevMode overlay rendering uses a hardcoded high z-index in runtime (10000001) to remain above host chrome.
Row State Tokens
| Variable | Source |
|---|---|
--widgemo-row-alt-bg | var(--widgemo-color-rowAltBg, #e9ecef) |
--widgemo-row-hover-bg | var(--widgemo-color-rowHoverBg, #ced4da) |
These row-state tokens are mapped into table behavior (including sticky and hover handling) and can be overridden globally or in a scoped container.
Override Patterns
Global override:
:root {
--widgemo-color-primary: #2563eb;
--widgemo-dropdown-z-index: 1200;
--widgemo-border-radius: 10px;
}
Scoped override:
.finance-widget-surface {
--widgemo-color-background: #ffffff;
--widgemo-color-border: #dbe3ef;
--widgemo-action-menu-bg: #f8fbff;
--widgemo-board-col-width: 320px;
}
Dropdown Positioning Contract
In table contexts, dropdown menus render through a portal at document.body with fixed positioning so they remain visible even when parent containers clip overflow.
In non-table contexts, menus use absolute positioning in local flow.