- Docs
- Guides
- Theming
Theming
Three things change: the scheme, the density, and a tenant's brand. The rest is Qeetrix.
- Schemes
- 2Light and dark, or the system's
- Densities
- 3Compact, default, comfortable
01 — Colour scheme
One provider owns it.
QeetrixProvider with defaultColorScheme or colorScheme sets data-qx-color-scheme on <html>, following the system while it's "system". useColorScheme reads and changes it. Each framework guide sets it before the first paint.
import { Toggle, ToggleGroup, useColorScheme } from "@qeetrix/react";
export function SchemeChoice() {
const { colorScheme, setColorScheme } = useColorScheme();
return (
<ToggleGroup aria-label="Colour scheme" value={[colorScheme]} onValueChange={([next]) => next && setColorScheme(next)}>
<Toggle value="light">Light</Toggle>
<Toggle value="dark">Dark</Toggle>
<Toggle value="system">System</Toggle>
</ToggleGroup>
);
}The attribute works on any element, for a subtree:
<!-- A dark panel on a light page: the attribute switches everything inside. -->
<aside data-qx-color-scheme="dark">…</aside>02 — Density
Control heights and rows, by region.
data-qx-density changes the size tokens beneath it; consoles are compact, through AppShell's density.
<!-- A dense table, a roomier form: on any element. -->
<section data-qx-density="compact">…</section>
<form data-qx-density="comfortable">…</form>| Density | Control lg | md | sm | Table row | Form gap |
|---|---|---|---|---|---|
compact | 32px | 28px | 24px | 32px | 12px |
default | 40px | 32px | 28px | 40px | 16px |
comfortable | 44px | 36px | 32px | 48px | 20px |
03 — A tenant's brand
Seven tokens, in your layer.
A tenant's colour replaces Ember on their pages; Qeet's own chrome stays Qeet's. Try it on Brand.
/* A tenant's brand colour, on the region that shows their product. In your own layer, after
Qeetrix's, so it wins without !important. Check the pairs meet AA in both schemes. */
@layer app {
[data-tenant="globex"] {
--qx-color-bg-brand-bold: oklch(0.52 0.16 255);
--qx-color-bg-brand-bold-hover: oklch(0.47 0.16 255);
--qx-color-text-on-brand: oklch(1 0 0);
--qx-color-text-brand: oklch(0.5 0.16 255);
--qx-color-bg-brand-subtle: oklch(0.95 0.03 255);
--qx-color-text-link: oklch(0.5 0.16 255);
--qx-color-border-focus: oklch(0.55 0.16 255);
}
}