Yes: load the deployed site, try brand colors live, then set --vp-c-brand-1 to -3
How to preview a color palette on a VitePress site
To preview a color palette on a VitePress site, paste the deployed site's address into Recolor (recolor.page), press Space, and the site repaints live in a new palette. You can judge a brand color on your real documentation pages before you set --vp-c-brand-1 in your code. VitePress's default theme takes its colors from CSS variables in the page, which Recolor reads directly. You can test public pages right away in the Recolor app.
Last updated
| What you have | What Recolor shows | What to do |
|---|---|---|
| A deployed VitePress site | The site repainted; on vite.dev, a dark and mostly gray page, 30% of the elements | Paste the address, press Space |
| The default theme's brand color | --vp-c-brand-1 to -3 and every color that reads them | Pick the swatch you want as the brand |
| Scripts on | Seven of vite.dev's module scripts cannot load, so its hero diagram stays empty | Scripts off gives the same colors |
| The colors you chose | Each swatch's hex and its contrast with black and white | Set them in .vitepress/theme/custom.css |
Getting a VitePress site into Recolor
Any deployed VitePress page loads by its address. Paste the address into the address field, press Load, then press Space. On October 8, 2026 Recolor's site matrix tested vite.dev, a VitePress site, which was ready in 1.2 seconds with its scripts and 1.3 seconds without, and Recolor found 18 colors.
The dev server's localhost address is refused, since Recolor loads public addresses. Deploy a preview build to a public web address, or upload a saved page with its asset base URL.
What repaints on vite.dev
vite.dev is a dark page, almost all gray. The palette reached 30% of its elements: the grays took a light tint of the first swatch and the few colored parts followed the palette. Its banner and a button border are images and keep their colors. On Tint a dark gray site shows a palette less than a colorful one. The brand color is the part to judge.
With scripts on, seven of its module scripts cannot load in the preview, so the hero diagram they draw stays empty. With scripts off, the colors are the same. The documentation page on what loads lists every tested site.
Which color goes where
VitePress's default theme stylesheet, vars.css, gives each brand variable a job. --vp-c-brand-1 is the most
solid color, used mainly for colored text. --vp-c-brand-2 is the hover color of a button. --vp-c-brand-3
is the solid background, such as a button's, and must keep white text on it readable. --vp-c-brand-soft is a
semi-transparent background for containers and badges. The home page's hero name reads --vp-c-brand-1
through --vp-home-hero-name-color.
Recolor shows each swatch's contrast with black and white text, marked for 4.5:1, the WCAG AA level. Pick the
swatch whose white mark passes for --vp-c-brand-3, and check --vp-c-brand-1 as text with the black or
white text guide.
Setting it in .vitepress/theme
VitePress's docs on Extending the default theme say the default theme is customized by overriding root level CSS variables. Make a theme entry that extends the default theme and imports a stylesheet:
// .vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme'
import './custom.css'
export default DefaultThemeThen set the variables in that stylesheet, as the docs' own example does:
/* .vitepress/theme/custom.css */
:root {
--vp-c-brand-1: #646cff;
--vp-c-brand-2: #747bff;
}Put your palette's hex codes in place of the example's values.
In vars.css the brand variables read a palette of colors that .dark changes for dark mode. A hex you set on
:root holds in both modes, so set the brand variables again under .dark where dark mode needs a lighter
color. The exports feature copies the palette as hex codes or CSS variables.
Common questions
Does Recolor change my VitePress project?
No. Recolor fetches the published page and repaints a copy in your browser; your repository and your host are not touched.
Can I preview the dev server's localhost address?
No. Recolor loads public addresses; deploy a preview, or upload the page as a file.
Does vite.dev look exactly right in the preview?
No, mostly: with scripts on, its hero diagram stays empty because seven module scripts cannot load in the preview. The colors are the same either way.
Do I need to set all the brand variables?
No. The docs' example sets two, but the button background is --vp-c-brand-3, so set it too if buttons should follow.
Does a color set on :root apply in dark mode?
Yes, unless you set the variable again under .dark.
Is it free?
Yes. Loading a site, generating palettes and every export format are free, without an account, as listed on the pricing page.
Sources
- VitePress's docs, Extending the default theme vitepress.dev
- VitePress's default theme stylesheet, vars.css github.com
- Recolor's site matrix recolor.page