Skip to main content
  1. Docs
  2. Guides
  3. 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.

scheme-choice.tsx
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:

panel.html
<!-- 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.

regions.html
<!-- A dense table, a roomier form: on any element. -->
<section data-qx-density="compact">…</section>
<form data-qx-density="comfortable">…</form>
DensityControl lgmdsmTable rowForm gap
compact32px28px24px32px12px
default40px32px28px40px16px
comfortable44px36px32px48px20px

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.

tenant.css
/* 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);
  }
}
Next — GuidesAccessibility