Dark mode
Dark mode changes the relationship between surfaces, text and accents while preserving content and interface hierarchy. It suits low-light environments and tasks where content needs to stand out against a quiet background.
Reading comfort
Avoid excessive contrast across large surfaces, bright borders and uniformly saturated accents. Light text on a completely black background alone does not guarantee comfort. Check sustained reading, dense tables, secondary labels and selected states in their surroundings.
Preserving hierarchy
Reading order, action placement and the meaning of statuses stay the same. Card surfaces, the page background and popups should remain distinguishable without a strong shadow. Required information must remain visible when secondary colours are subdued.
Colour and surfaces
Palettes adapt to their background: simply inverting RGB values does not preserve perceived brightness or relationships between hues. Use semantic design tokens such as colorText, colorBgContainer, colorBgElevated and colorBorder. Pair error colour with a message and selected states with a recognisable selection indicator.
- colorPrimaryBg
#15325b- colorPrimaryBorder
#15325b- colorPrimaryHover
#3c89e8- colorPrimary
#1668dc- colorPrimaryActive
#1554ad- colorText
rgba(255,255,255,0.85)- colorTextSecondary
rgba(255,255,255,0.65)- colorBgContainer
#141414
red
#2a12151#4314182#58181c3#791a1f4#a61d245#d320296#e847497#f373708#f89f9a9#fac8c310
volcano
#2b16111#441d122#5927163#7c31184#aa3e195#d84a1b6#e870407#f3956a8#f8b6929#fad4bc10
orange
#2b1d111#442a112#5938153#7c4a154#aa62155#d87a166#e89a3c7#f3b7658#f8cf8d9#fae3b710
gold
#2b21111#4431112#5942143#7c59144#aa77145#d896146#e8b3397#f3cc628#f8df8b9#faedb510
yellow
#2b26111#443b112#5950143#7c6e144#aa95145#d8bd146#e8d6397#f3ea628#f8f48b9#fafab510
lime
#1f26111#2e3c102#3e4f133#536d134#6f94125#8bbb116#a9d1347#c9e75d8#e4f88b9#f0fab510
green
#1623121#1d37122#2749163#3063174#3c86185#49aa196#6abe397#8fd4608#b2e58b9#d5f2bb10
cyan
#1121231#1135362#1448483#1462624#1385855#13a8a86#33bcb77#58d1c98#84e2d89#b2f1e810
blue
#111a2c1#1125452#15325b3#15417e4#1554ad5#1668dc6#3c89e87#65a9f38#8dc5f89#b7dcfa10
geekblue
#1316291#161d402#1c27553#2031754#263ea05#2b4acb6#5273e07#7f9ef38#a8c1f89#d2e0fa10
purple
#1a13251#24163a2#301c4d3#3e20694#51258f5#642ab56#854eca7#ab7ae08#cda8f09#ebd7fa10
magenta
#2913211#40162f2#551c3b3#75204f4#a026695#cb2b836#e0529c7#f37fb78#f8a8cc9#fad2e310
Colour roles and palettes
ColorPicker changes the primary colour; public tokens show semantic roles and twelve base palettes.
PaletteExample.svelte<script lang="ts"> import { Button, ColorPicker, ConfigProvider, theme } from '@woodger/antd'; import PaletteReadout from './PaletteReadout.svelte'; let { dark = false }: { dark?: boolean } = $props(); let primary = $state('#1677ff'); </script> <div class="controls"> <span id="design-primary-label">{("Palette primary colour")}</span> <ColorPicker aria-labelledby="design-primary-label" value={primary} showText disabledAlpha onChange={(_, css) => { primary = css; }} /> <Button onclick={() => { primary = '#1677ff'; }}>{("Reset palette colour")}</Button> </div> <ConfigProvider theme={{ ...(dark ? { mode: 'dark', algorithm: theme.darkAlgorithm } : {}), token: { colorPrimary: primary } }}> <PaletteReadout /> </ConfigProvider> <style> .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; } </style>PaletteReadout.svelte<script lang="ts"> import { theme } from '@woodger/antd'; const current = theme.useToken(); const colors = [ 'red', 'volcano', 'orange', 'gold', 'yellow', 'lime', 'green', 'cyan', 'blue', 'geekblue', 'purple', 'magenta' ] as const; const levels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as const; const roles = [ 'colorPrimaryBg', 'colorPrimaryBorder', 'colorPrimaryHover', 'colorPrimary', 'colorPrimaryActive', 'colorText', 'colorTextSecondary', 'colorBgContainer' ] as const; </script> <div class="surface"> <dl aria-label={("Semantic palette roles")}> {#each roles as role (role)} <div class="role"><dt>{role}</dt><dd><span class="swatch" style:background={current .token[role]} aria-hidden="true"></span><code>{current.token[role]}</code></dd></div> {/each} </dl> <div class="palettes" aria-label={("Base theme palettes")}> {#each colors as color (color)} <section aria-label={color}> <h4>{color}</h4> <ol> {#each levels as level (level)} <li><span class="swatch" style:background={current.token[`${color}${level}`]} aria-hidden="true" ></span><code>{current.token[`${color}${level}`]}</code><small>{level}</small></li> {/each} </ol> </section> {/each} </div> </div> <style> .surface { padding: 16px; background: var(--ant-color-bg-container); color: var(--ant-color-text); border-radius: 6px; } dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px 24px; margin: 0 0 24px; } dt { overflow-wrap: anywhere; font-size: 12px; } dd { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; } .palettes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 24px; } h4 { margin: 0 0 8px; font-size: 14px; font-weight: 500; } ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; } li { display: flex; align-items: center; gap: 8px; min-width: 0; } .swatch { flex: none; width: 24px; height: 20px; border: 1px solid var(--ant-color-border-secondary); border-radius: 3px; } code { font-size: 11px; overflow-wrap: anywhere; } small { margin-inline-start: auto; color: var(--ant-color-text-secondary); font-size: 11px; } </style>
Theming in @woodger/antd
Switch the theme in the header settings and compare this page with the component examples. The theme guide demonstrates an independent ConfigProvider scope and reactive token access. Custom surfaces should obtain their colours from the same theme.
Images and states
Check icons, charts, photographs and transparent images separately. An illustration can retain its own light background when that background is part of the material. In forms, check focus, hover, disabled, error and loading states; theme changes should preserve entered data and focus.
Adapted from the guide by Ant Design. MIT.