Colors
Pika colors come in three layers, following Naive UI’s Jade Green token architecture. Components never name a raw color: they ask for a purpose, such as “the fill of a primary button” or “error text”, and each theme derives every surface, border and ink from a compact set of semantic seeds.
| Layer | Name | Holds |
|---|---|---|
| Seeds & Surfaces | --p-seed-{role}, --p-base-color, --p-neutral-* | Six semantic roles × four state seeds (default, hover, pressed, suppl), solid ink polarity, and Z-elevation surfaces |
| Alias | --pw-alias-{property}-{state}-{role} | Purpose tokens derived via native CSS color-mix(in srgb, ...) |
| Component | --pl-{component}-* | A component’s own slots; read only aliases |
#Palette
Instead of static 12-step ramps, each of the six semantic roles (primary, info, success, warning, error, accent) defines four state seeds: default, hover, pressed, and suppl. Light mode anchors crisp Jade Green (#18a058) on #ffffff cards and a #f6f7f9 canvas; dark mode shifts to desaturated Mint Jade (#63e2b7) over a four-tier Obsidian Z-elevation hierarchy (#101014 → #18181c → #2c2c32 → #48484e). Switch the mode at the top of the page to inspect every resolved value.
#Asymmetric light and dark rules
Dark mode is not an inverted light scale. Five asymmetric rules keep dark surfaces calm, legible and layered:
- Solid polarity flip (
--p-base-color). Light mode pairs saturated role fills (#18a058) with#ffffffink; dark mode flips--p-base-colorto#000000so luminous pastel fills (#63e2b7) carry crisp black text (7.4:1–13.4:1 AAA). supplanchor for fixed-white controls. Controls whose foreground is always white—such as an activeSwitchthumb or a solidBadge—read--p-seed-{role}-suppl(#2a947din dark mode) instead of the pastel fill so white edges never wash out.- Four-tier Z-elevation. Light mode separates white cards, modals and popovers with three directional shadows; dark mode steps surface luminance upward from
bg-page(#101014) tobg-panel(#18181c),bg-modal(#2c2c32) andbg-raised(#48484e) so popovers inside modals never blend into the backdrop. - Translucent
color-mix()tints & press-dimming. Soft surfaces mix the role seed againsttransparent, adapting cleanly over any Z-tier. In light mode tints deepen on hover and press (12% → 17% → 22%); in dark mode hover brightens and press dims (16% → 20% → 12%), while borderedTagbackgrounds drop to0%(transparent). - Crisp focus ring vs. luminous glow. Focused fields draw a crisp
2pxring (0 0 0 2px) on#ffffffin light mode, and a borderlessrgba(255, 255, 255, 0.1)slot with an8pxluminous glow (0 0 8px 0) and10%tinted ground in dark mode.
#Aliases
Names follow how-to-style: property first, then state, then the role last, so a component maps every type by changing only the last segment.
.p-button {
&&--error-type {
--pl-button-family-fill: var(--pw-alias-fill-error);
--pl-button-family-fill-hover: var(--pw-alias-fill-hover-error);
--pl-button-family-fill-pressed: var(--pw-alias-fill-pressed-error);
--pl-button-family-text: var(--pw-alias-text-error);
}
}The seven roles and their live color-mix() alias slots:
| surfacetint | surface-hoverhover | surface-pressedpress | tag-borderedtag | border-subtlesub | borderbdr | border-hoverhov | fillseed | fill-hoverhov | fill-pressedpress | textaa | text-on-fillbase | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| neutralslate | ||||||||||||
| primaryjade | ||||||||||||
| accentterracotta | ||||||||||||
| infoocean | ||||||||||||
| successjade | ||||||||||||
| warningamber | ||||||||||||
| errorcrimson |
Neutral text and elevation surfaces have dedicated names: --pw-alias-bg-page (L0 canvas), --pw-alias-bg-panel (L1 card), --pw-alias-bg-modal (L2 modal and drawer), --pw-alias-bg-raised (L3 popover, select menu and active segment), --pw-alias-bg-tooltip, --pw-alias-label-primary / -secondary / -tertiary / -disabled, --pw-alias-border-strong and --pw-alias-border-focus. --pw-static-white and --pw-static-black never change.
#Feedback
Validation states (info, success, warning, error) read --pw-feedback-{property}-{role}, derived directly from the same semantic role seeds so an error Input, Tag and Alert always speak in one voice.
| Token | Value (light and dark) |
|---|---|
--pw-feedback-text-{role} | --pw-alias-text-{role} (shaded to pass WCAG AA 4.5:1 in light mode, pastel seed in dark mode) |
--pw-feedback-border-{role} | --p-seed-{role} (-hover on :hover) |
--pw-feedback-shadow-{role} | 0 0 0 2px 20% ring in light mode; 0 0 8px 0 30% glow in dark mode |
Click into any field below and switch the theme mode at the top of the page to compare light rings and dark glows.
#Contrast
Measured live from the active theme in the browser, compositing translucent color-mix() surfaces over bg-page and bg-panel. Every colored text alias passes WCAG AA (4.5:1) in both modes; solid fills preserve pure white brand ink in light mode and flip to #000000 in dark mode for AAA contrast.
| pair | neutral | primary | accent | info | success | warning | error |
|---|---|---|---|---|---|---|---|
| text on bg-page | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— |
| text on bg-panel | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— |
| text on surface | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— |
| text on surface-pressed | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— |
| text-strong on surface | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— |
| text-on-fill on fill | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— | Aa— |
#Changing colors
Override a role’s seeds to recolor every color-mix() surface, border, text shade and focus ring derived from it, in the whole page or inside one ConfigProvider (success keeps its own Jade Green seed independently):
<ConfigProvider
themeOverrides={{
"--p-seed-primary": "#2080f0",
"--p-seed-primary-hover": "#4098fc",
"--p-seed-primary-pressed": "#1060c9",
"--p-seed-primary-suppl": "#4098fc",
}}
>
…
</ConfigProvider>Override an alias to change what one purpose uses without touching the seeds:
<ConfigProvider themeOverrides={{ "--pw-alias-fill-primary": "var(--p-seed-accent)" }}>…</ConfigProvider>