Open stewcam opened 11 months ago
Hey @camedgell the THEME_KEY
needs to go before the command you wanna run. You can pass THEME_KEY
with the dev
or build
commands like THEME_KEY=purpleheart astro build/dev
to change the color theme being used.
Thanks but the suggested syntax does not work at my end (running on Windows 11). Error code is EINVALIDTAGNAME with error message Invalid tag name "THEME_KEY=purpleheart" of package "THEME_KEY=purpleheart": Tags may not have any characters that encodeURIComponent encodes.
You should be able to pass it direct in the package.json
eg.
"scripts": {
"dev": "THEME_KEY=indigone astro dev",
"build": "astro build",
"check": "astro check",
"postbuild": "node ./scripts/search/prepare-index.js",
"preview": "astro preview",
"check:type": "tsc --project tsconfig.json --pretty --noEmit",
"lint": "biome lint src",
"format": "biome format src --write",
"cz": "cz"
},
Thanks @lovettbarron but that does not work either. However, I have found that I can change the theme by direct edit of the default section of tailwind.theme.config.cjs, so will proceed with that.
I could not work out the correct syntax for adding the THEME_KEY parameter to npm dev or npx astro dev scripts (as suggested in the features list). I tried a few conventional ways including: npm run dev -- THEME_KEY=indigone npm run dev -- --THEME_KEY=indigone I was able to make the change by direct edit of the default section of tailwind.theme.config.cjs but how does it work through CLI?