# Bit.Balette theme variables
Every value of the default theme is a CSS custom property on `:root` in `_content/Bit.Balette/bit-balette.css` -
a stylesheet the host page links itself, it is not injected. Restyle the palette by overriding these, never by
overriding the library's selectors:
| Where | Reaches | Example |
| --- | --- | --- |
| `:root` in your stylesheet, linked after the library's | the whole app: the dialog, `BaletteTrigger` and every `BaletteShortcutHint` | `:root { --bit-balette-accent: #0f766e; }` |
| `dialog[data-balette="dialog"]` | the palette dialog alone | `dialog[data-balette="dialog"] { --bit-balette-width: 760px; }` |
| the `Style` parameter | that one palette, inline, ahead of every rule | `` |
| the `Theme` parameter | which column applies to that dialog: `auto` (the default, from `options.Theme`), `light` or `dark` | `` |
The dark column applies under `prefers-color-scheme: dark` (unless ``), under
``, and on a dialog whose `Theme` is `dark`; a dialog whose `Theme` is `light` gets the light
column back on a dark page. To change a dark value, override it under the same selectors the stylesheet uses:
`:root[data-theme="dark"], dialog[data-balette="dialog"][data-theme="dark"]`, and inside `@media (prefers-color-scheme: dark)` on
`:root:not([data-theme="light"])`. A value in the last column is set somewhere else as well, and where the component
writes it inline from an option, the option is the only thing that changes it for the elements under that element.
## Layout
| Variable | Light (default) | Dark | Also set by |
| --- | --- | --- | --- |
| `--bit-balette-width` | `640px` | same | `.bit-balette-dialog[data-has-detail="true"]`: `920px` |
| `--bit-balette-max-height` | `min(70vh, 560px)` | same | |
| `--bit-balette-radius` | `14px` | same | |
| `--bit-balette-row-height` | `44px` | same | `.bit-balette-dialog[data-density="compact"]`: `34px`; inline on `[data-balette="list"]` from `BaletteOptions.RowHeight` while `Virtualize` is on, so set the option then |
| `--bit-balette-gap` | `8px` | same | |
| `--bit-balette-font` | `ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif` | same | |
| `--bit-balette-font-size` | `14px` | same | `.bit-balette-dialog[data-density="compact"]`: `13px` |
| `--bit-balette-mono` | `ui-monospace, SFMono-Regular, Menlo, Consolas, monospace` | same | |
| `--bit-balette-z` | `1000` | same | |
| `--bit-balette-top` | `12vh` | same | |
| `--bit-balette-input-height` | `56px` | same | `.bit-balette-dialog[data-density="compact"]`: `44px` |
| `--bit-balette-input-font-size` | `16px` | same | `.bit-balette-dialog[data-density="compact"]`: `14px` |
| `--bit-balette-item-radius` | `8px` | same | |
| `--bit-balette-item-padding` | `6px 10px` | same | `.bit-balette-dialog[data-density="compact"]`: `3px 8px` |
| `--bit-balette-item-gap` | `12px` | same | `.bit-balette-dialog[data-density="compact"]`: `10px` |
| `--bit-balette-heading-font-size` | `11px` | same | |
| `--bit-balette-footer-height` | `40px` | same | `.bit-balette-dialog[data-density="compact"]`: `32px` |
| `--bit-balette-detail-width` | `40%` | same | |
| `--bit-balette-backdrop-blur` | `2px` | same | |
| `--bit-balette-duration` | `140ms` | same | |
## Light palette
| Variable | Light (default) | Dark | Also set by |
| --- | --- | --- | --- |
| `--bit-balette-bg` | `#ffffff` | `#17181c` | |
| `--bit-balette-bg-elevated` | `#f6f7f9` | `#1f2126` | |
| `--bit-balette-fg` | `#111318` | `#f3f4f6` | |
| `--bit-balette-fg-muted` | `#5f6673` | `#a1a1aa` | |
| `--bit-balette-fg-subtle` | `#6b7280` | `#8b8b94` | |
| `--bit-balette-border` | `rgba(17, 19, 24, 0.08)` | `rgba(255, 255, 255, 0.08)` | |
| `--bit-balette-accent` | `#4f46e5` | `#818cf8` | |
| `--bit-balette-accent-fg` | `#ffffff` | `#0b0c10` | |
| `--bit-balette-accent-soft` | `rgba(79, 70, 229, 0.10)` | `rgba(129, 140, 248, 0.16)` | |
| `--bit-balette-active-bg` | `rgba(17, 19, 24, 0.06)` | `rgba(255, 255, 255, 0.07)` | |
| `--bit-balette-danger` | `#c81e1e` | `#f87171` | |
| `--bit-balette-danger-soft` | `rgba(200, 30, 30, 0.10)` | `rgba(248, 113, 113, 0.14)` | |
| `--bit-balette-mark-bg` | `rgba(79, 70, 229, 0.18)` | `rgba(129, 140, 248, 0.28)` | |
| `--bit-balette-kbd-bg` | `#f3f4f6` | `#26282e` | |
| `--bit-balette-kbd-fg` | `#374151` | `#d4d4d8` | |
| `--bit-balette-kbd-border` | `rgba(17, 19, 24, 0.12)` | `rgba(255, 255, 255, 0.12)` | |
| `--bit-balette-backdrop` | `rgba(17, 19, 24, 0.45)` | `rgba(0, 0, 0, 0.6)` | |
| `--bit-balette-shadow` | `0 24px 64px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04)` | `0 24px 64px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06)` | |
| `--bit-balette-scrollbar` | `rgba(17, 19, 24, 0.2)` | `rgba(255, 255, 255, 0.2)` | |
## Unstyled: the data-balette hooks
`Unstyled="true"` drops the `bit-balette-dialog` class every dialog rule is scoped to, so none of them applies and
the markup is yours to style - through these attributes, which are also the stable hooks for tests. The rows
carry their state as attributes: style `[data-balette="item"][data-active="true"]`, not a class. An `ItemTemplate`
replaces what is inside a row; the row element itself, with these attributes, stays the palette's.
| `data-balette` | Element | Default class | State attributes | Rendered by |
| --- | --- | --- | --- | --- |
| `sequence` | `