Docs

CSS Variables Reference

6 min readUpdated October 31, 2026

Every colour, corner, font size and shadow in the portal comes from a CSS custom property whose name starts with --wap-. Change a variable and every part of the portal that uses it follows, in light and dark mode. This page lists them all, with their defaults and where they come from.

Where to set them#

Use WooCommerce > Account Portal > Appearance > Advanced CSS. It is printed last, after the plugin’s own styles, your theme style and the AI brand theme, so it wins over all of them. Pick the selector by what you want to change:

SelectorUse it for
.wap-portal-bodyBoth modes
.wap-portal-body.wap-mode-lightLight mode only
.wap-portal-body.wap-mode-darkDark mode only

The <body> of the portal always has wap-portal-body and wap-mode-light or wap-mode-dark. With the Auto mode, a small script sets the class to the mode the device uses before the page is drawn, so the two mode selectors cover Auto too.

/* Both modes: squarer corners. */
.wap-portal-body {
	--wap-radius-md: 6px;
	--wap-radius-lg: 8px;
	--wap-btn-radius: 6px;
}

/* Dark mode only: a deeper page background. */
.wap-portal-body.wap-mode-dark {
	--wap-bg: #0b0d12;
	--wap-card-bg: #141821;
}
Advanced CSS box on the Appearance tab with --wap- variables set for both modes and for dark mode
Tip

For brand colours, the logo height and the button shape, use the settings rather than CSS: the plugin works out the related shades for you. Use variables for what the settings do not cover.

The order the CSS is printed#

  1. assets/css/portal.css: the layout tokens and the built-in light and dark colours.
  2. The variables from your settings, on :root.
  3. The Theme style (Clean Light, Deep Dark or Full Custom) and the colours picked in Fine-tune colours.
  4. The button radius, and the phone layouts of the orders and downloads tables.
  5. The Brand theme with AI CSS, when that option is chosen.
  6. Advanced CSS.

From your settings#

The plugin prints these on :root from Appearance. Set them in CSS only if you need a value the settings cannot give.

VariableDefaultComes from
--wap-primary#3D3BF3Primary Color. Active menu item, primary buttons, focus rings, login brand panel
--wap-primary-rgb61,59,243The primary colour as R, G, B, for see-through tints
--wap-primary-lightPrimary mixed 35% with whiteActive menu text in dark mode
--wap-primary-darkPrimary mixed 25% with blackActive menu text in light mode
--wap-secondary#22C55ESecondary Color. Links in content, badges, accents
--wap-secondary-rgb34,197,94The secondary colour as R, G, B
--wap-secondary-lightSecondary mixed 35% with whiteNot used by the portal’s CSS; there for your own rules
--wap-secondary-darkSecondary mixed 25% with blackNot used by the portal’s CSS; there for your own rules
--wap-logo-max-h80pxLogo max height (24 to 240 px). The tallest the logo may be in the sidebar; the login brand panel shows it up to twice this height, and the small logo on the phone login screen stays at 48px or less (except in the minimal login layout)
--wap-btn-radius999pxButton Style: Rounded 999px, Slight 8px, Square 0px, or Custom with your Radius. Set on .wap-portal-body
Warning

If you change --wap-primary in CSS, change --wap-primary-rgb, --wap-primary-light and --wap-primary-dark too. They are printed as fixed values, so they do not follow a new primary colour by themselves.

Layout and type#

Defined on :root in portal.css, the same in both modes.

VariableDefaultUsed for
--wap-sidebar-w280pxSidebar width. 240px on screens from 769 to 1024px wide, 88px with the icon rail menu
--wap-radius-sm8pxSmall corners: inputs, menu items
--wap-radius-md12pxCards
--wap-radius-lg16pxLarge panels
--wap-radius-full100pxPills and round shapes
--wap-easecubic-bezier(0.2, 0, 0, 1)Animation easing
--wap-dur-s / --wap-dur-m / --wap-dur-l150ms / 250ms / 400msAnimation lengths
--wap-elev-1 / --wap-elev-2Two-layer shadowsRaised elements
--wap-fontThe device’s system fontEvery text in the portal. No web font is loaded
--wap-fs-xs0.75remSmallest text
--wap-fs-sm0.875remSmall text, meta lines
--wap-fs-base1remBody text
--wap-fs-md1.125remCard headings
--wap-fs-lg1.375remSection headings
--wap-fs-xl1.75remPage headings
--wap-fs-2xl2.25remThe largest headings

To use your own font, load it in your theme (self-hosted fonts are best for GDPR) and set:

:root {
	--wap-font: "Inter", system-ui, sans-serif;
}

Colours per mode#

Defined in portal.css for each mode. Clean Light and Deep Dark use a few slightly different values for their own mode, and Fine-tune colours > Pick colours overrides --wap-surface, --wap-surface-2, --wap-bg, --wap-on-s, --wap-on-s2, --wap-nav-hover, --wap-nav-active, --wap-nav-color, --wap-card-bg and --wap-outline.

VariableLightDarkUsed for
--wap-bg#f4f4fb#0f0f13Page background (main content area)
--wap-surface#ffffff#1a1a22Sidebar and top bar
--wap-surface-2#f0f0f8#22222eRaised areas: hover rows, switches, tabs
--wap-surface-3#e6e6f2#2a2a3aHighest areas: chips, table headers
--wap-card-bg#ffffff#1f1f2aCards, tables, forms
--wap-card-brrgba(0,0,0,.07)rgba(255,255,255,.06)Card borders
--wap-outlinergba(0,0,0,.09)rgba(255,255,255,.10)Dividers and borders
--wap-outline-vrgba(0,0,0,.04)rgba(255,255,255,.05)Very faint dividers
--wap-on-bg#111118#e8e8f0Headings and main text
--wap-on-s#2a2a3a#cacacfMenu text and body text
--wap-on-s2#606070#9898a0Secondary text
--wap-on-s3#6b6b7a#8a8a95Hints and meta text
--wap-placeholder#6b6b7a#9a9aa6Input placeholder text
--wap-linkSecondary, 60% mixed with black--wap-secondaryLinks in content
--wap-error#c62828#ff6b6bError messages, problem steps
--wap-success#15803d#4ade80Success messages
--wap-nav-hoverPrimary at 8%Primary at 12%Menu item hover background
--wap-nav-activePrimary at 12%Primary at 18%Active menu item background, badges
--wap-nav-color--wap-primary-dark--wap-primary-lightActive menu item text and icon
--wap-input-bg#f8f8ff#1e1e2aInput background
--wap-input-brrgba(0,0,0,.18)rgba(255,255,255,.15)Input border
--wap-scrollbarrgba(0,0,0,.15)rgba(255,255,255,.15)Scrollbar thumb

Optional variables#

These are not set by default: the portal uses the fallback shown until you (or the Brand theme with AI) set them.

VariableFallbackUsed for
--wap-on-primary#fffText and icons on the brand colour (buttons, login panel)
--wap-menu-bg--wap-surfaceEvery menu style: sidebar, top tabs, icon rail, phone top bar, bottom tab bar, floating dock
--wap-avatar-bg--wap-primaryThe customer’s initial circle (menu and profile card)
--wap-avatar-fg--wap-on-primaryThe initial on that circle
--wap-announce-bg--wap-primaryThe announcement bar in the brand colour style
--wap-announce-fg--wap-on-primaryText and icons on that bar
--wap-progress--wap-primaryOrder progress: finished steps and the line between them; the Getting started bar
--wap-warning#f59e0bTint of the amber announcement bar
--wap-dock-radius24pxCorners of the floating dock menu
--wap-dock-shadowA soft two-layer shadowShadow under the floating dock
--wap-tooltip-bg--wap-on-bgPage-name tooltip on the icon rail
--wap-tooltip-fg--wap-bgTooltip text
.wap-portal-body {
	--wap-menu-bg: #10172a;
	--wap-on-primary: #111111; /* dark text on a light brand colour */
}

Keep text readable: aim for at least 4.5:1 contrast between a text colour and the background it sits on.

Icon size#

Icons are inline SVGs sized by --wap-ic (20px when nothing sets it). The portal sets it per place, for example 20px for menu icons and 36px for the icons on empty pages. Set it on the element that holds the icon:

.wap-portal-body .wap-nav-icon {
	--wap-ic: 22px;
}

Use the variables in your own CSS#

Build your own elements, such as a custom Dashboard widget or a custom page, with the variables and they switch with the mode:

.wap-portal-body .my-notice {
	padding: 16px 18px;
	border: 1px solid var(--wap-card-br);
	border-radius: var(--wap-radius-md);
	background: var(--wap-card-bg);
	color: var(--wap-on-s);
	font-size: var(--wap-fs-sm);
}

Variables not to set#

--wap-ann-bg and --wap-ann-fg are worked out per announcement style from the variables above, and --wap-start-side and --wap-end-side handle right-to-left languages. Change the public variables instead.

The Account Nav Widget’s drawer, which can appear on any page of your site, has its own variables: --wap-nw-primary, --wap-nw-secondary, --wap-nw-radius, --wap-nw-drawer-w (360px) and --wap-nw-icon-sz. The portal’s variables on this page do not apply to it.

Share:

Was this helpful?