Theming
Apply the Dashboard theme to the document and customize its shared tokens.
On this page
Apply the Dashboard theme
Use the registered stylesheet and semantic tokens. Put the theme on the document root so menus and dialogs inherit it.
File contents
MARKDOWN
# Apply the Dashboard theme
Install @interfaces-ds/dashboard-style using the project's registry configuration. It depends on the base styles. Load styles/ids-dashboard.css after styles/ids-styles.css in the application's global CSS; adjust the relative paths to match the installation.
```css
@import "../styles/ids-styles.css";
@import "../styles/ids-dashboard.css";
```
Put data-ids-theme="dashboard" on html so portaled dialogs, menus and selects inherit the same tokens. The dark theme uses the dark class on an ancestor, usually html. In an application that toggles color mode, let its existing theme provider manage that class.
```tsx
<html lang="en" data-ids-theme="dashboard">
```
## Change a theme role
Apply project overrides after the Dashboard stylesheet. This example adjusts the recessed surface in both color modes using existing semantic foreground and card values.
```css
[data-ids-theme="dashboard"] {
--ds-well: color-mix(in srgb, var(--foreground) 8%, var(--card));
}
```
Use --ds-panel and --ds-floating for card and overlay surfaces, --ds-edge for their borders, and --ds-control-sm, --ds-control-md and --ds-control-lg for adjacent controls. Keep the foreground readable in both modes. Check a disabled input, a focused button and a Select opened inside a Dialog. The downloadable dashboard-style registry item contains the complete stylesheet and its installation targets.Inspect the theme
Dashboard tokens and base tokens list the current values for light and dark mode.
Install the Dashboard theme to get the full CSS. The styling handbook shows how the rules apply to components.