Yes: a deployed Astro site loads by its address and repaints, live
How to preview a color palette on an Astro site
To preview a color palette on an Astro site, deploy the site, paste its address into Recolor (recolor.page), a website color changer, and press Space; the built site repaints in a new palette live, without touching the project. Astro's scoped styles end up as ordinary CSS rules in the page, which Recolor reads. On October 8, 2026 astro.build, Astro's own site, found 66 colors and changed 97% of its elements in the Recolor app.
Last updated
| What you have | What Recolor shows | What to do |
|---|---|---|
| A deployed Astro site | The site repainted: 97% of astro.build's elements with its scripts, 100% without | Paste the address, press Space |
| A site on your own computer | An error: Recolor loads public addresses | Deploy a preview, or upload the page as a file |
| Scoped styles in components | Repainted like any other rule | Nothing |
| A Starlight docs site | Its --sl-color-* variables, repainted | Paste the address, press Space |
| The colors you chose | CSS variables or a Tailwind @theme block in Export | A global stylesheet your layout imports |
Getting an Astro site into Recolor
Any deployed Astro page loads by its address: its own domain or the address of a preview deploy. Paste it into the address field, press Load, then press Space for a palette. On October 8, 2026 astro.build was ready in 1.1 seconds with its scripts and 0.7 seconds without.
A site that only runs on your own computer, the localhost address the dev server prints, is refused: Recolor loads public addresses. Deploy a preview, or save the page and upload it as a file with its asset base URL, as loading a page explains.
Astro's docs say a production build combines a site's CSS into chunks, links the larger ones as stylesheets and inlines the smaller ones in a style element. Recolor reads both kinds the same way.
What repaints on an Astro page
Astro's docs say scoped styles are compiled to selectors with a data-astro-cid-* attribute, so they apply
only inside their component. In the page they are ordinary rules, and Recolor reads and rewrites them like any
other rule; global styles too.
On astro.build the accents and gradients take the palette. Its purple hero glow is an image, and images keep their own colors; Grey images in the Mapping menu helps you judge the rest. With scripts on, five of its module scripts cannot load in the preview, so its interactive parts stay still; the colors are the same with scripts off.
Text stays readable: where a new color would make text hard to read, Recolor gives back part of the lightness change until it reads at 4.5:1, or as well as the page did where that was less, as explained in the mapping guide. What loads lists every tested site.
Setting the colors in your Astro project
Open Export and copy the CSS variables. Put them in a global stylesheet:
/* src/styles/global.css */
:root {
--color-1: #264653;
--color-2: #2a9d8f;
--color-3: #e9c46a;
--color-4: #f4a261;
--color-5: #e76f51;
--color-primary: var(--color-1);
--color-secondary: var(--color-2);
--color-accent: var(--color-3);
}Astro's docs say a common pattern is to import global CSS in a layout component, imported before your other imports so it has the lowest precedence:
// In the frontmatter of src/layouts/Layout.astro, before your other imports
import "../styles/global.css";Astro's docs say a component's style element can read any CSS variable on the page, so point your colors at
the variables: var(--color-primary). With Tailwind CSS, copy the Tailwind @theme format instead, as shown
in the Tailwind v4 @theme colors guide. The export formats
are listed in the exports docs.
A Starlight docs site
Starlight, Astro's documentation theme, takes its colors from --sl-color-* variables. Starlight's docs say
to put your own CSS in a file listed in customCss in astro.config.mjs, and that custom CSS outside a cascade
layer overrides Starlight's. Its color theme editor writes the dark values on :root and the light values on
:root[data-theme='light']:
/* src/styles/custom.css, listed in customCss in astro.config.mjs */
:root {
--sl-color-accent-low: #131e4f;
--sl-color-accent: #3447ff;
--sl-color-accent-high: #b3c7ff;
}
:root[data-theme='light'] {
--sl-color-accent-low: #c7d6ff;
--sl-color-accent: #364bff;
--sl-color-accent-high: #182775;
}Load the Starlight site by its address, find a palette you like, then copy its accent into the three accent variables: low, accent and high.
Common questions
Does Recolor change my Astro 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 an Astro site that runs on localhost?
No. Recolor loads public addresses; deploy a preview, or upload the page as a file.
Do scoped component styles repaint?
Yes. By the time the page is built they are ordinary CSS rules in the page, and Recolor reads them like any other.
Does it work with Starlight?
Yes. Starlight's colors are CSS variables in its stylesheet, and they repaint like the rest; set the ones you keep in your custom CSS.
Does the purple glow on astro.build change?
No. It is an image, and images keep their own colors.
Does it work with Tailwind CSS in Astro?
Yes. Tailwind's classes end up as CSS in the page, and Export has a Tailwind @theme format for the colors you keep.
Is it free?
Yes. Loading a site, generating palettes and every export format are free, without an account, as shown on pricing.
Sources
- Astro's docs, Styles and CSS docs.astro.build
- Starlight's docs, CSS and styling starlight.astro.build
- Recolor's site matrix recolor.page