Skip to content

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.

LayerNameHolds
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.

defaulthoverpressedsupplprimaryjadeinfooceansuccessjadewarningambererrorcrimsonaccentterracotta
basepolarity
bg-pageL0 canvas
bg-panelL1 card
bg-modalL2 modal
bg-raisedL3 popover
bg-tooltiptooltip

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 #ffffff ink; dark mode flips --p-base-color to #000000 so luminous pastel fills (#63e2b7) carry crisp black text (7.4:1–13.4:1 AAA).
  • suppl anchor for fixed-white controls. Controls whose foreground is always white—such as an active Switch thumb or a solid Badge—read --p-seed-{role}-suppl (#2a947d in 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) to bg-panel (#18181c), bg-modal (#2c2c32) and bg-raised (#48484e) so popovers inside modals never blend into the backdrop.
  • Translucent color-mix() tints & press-dimming. Soft surfaces mix the role seed against transparent, 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 bordered Tag backgrounds drop to 0% (transparent).
  • Crisp focus ring vs. luminous glow. Focused fields draw a crisp 2px ring (0 0 0 2px) on #ffffff in light mode, and a borderless rgba(255, 255, 255, 0.1) slot with an 8px luminous glow (0 0 8px 0) and 10% 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.

css
.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:

surfacetintsurface-hoverhoversurface-pressedpresstag-borderedtagborder-subtlesubborderbdrborder-hoverhovfillseedfill-hoverhovfill-pressedpresstextaatext-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.

TokenValue (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.

info
Synced 2 minutes ago
success
Looks good
warning
Double-check this
error
Not a valid email

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.

pairneutralprimaryaccentinfosuccesswarningerror
text on bg-pageAa—Aa—Aa—Aa—Aa—Aa—Aa—
text on bg-panelAa—Aa—Aa—Aa—Aa—Aa—Aa—
text on surfaceAa—Aa—Aa—Aa—Aa—Aa—Aa—
text on surface-pressedAa—Aa—Aa—Aa—Aa—Aa—Aa—
text-strong on surfaceAa—Aa—Aa—Aa—Aa—Aa—Aa—
text-on-fill on fillAa—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):

tsx
<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:

tsx
<ConfigProvider themeOverrides={{ "--pw-alias-fill-primary": "var(--p-seed-accent)" }}>…</ConfigProvider>