Replies: 1 comment 1 reply
-
You can use the legacy javascript-based config using the You can use it by removing all color definitions from your const brandColorName = import.meta.env.VITE_BRAND_COLOR || "blue";
const colors = {
white: "#fff",
black: "#000",
blue: {
"50": "#f1f6fd",
"100": "#dfebfa",
"200": "#c6dbf7",
"300": "#9ec5f2",
"400": "#70a5ea",
"500": "#4f85e2",
"600": "#3867d6",
DEFAULT: "#3867d6",
"700": "#3155c4",
"800": "#2d46a0",
"900": "#293e7f",
"950": "#1d274e",
},
// ... other colors
};
export default {
theme: {
colors:
{
...colors,
brand: colors[brandColorName]
},
},
} And in the @config "../tailwind.config.js"; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So in the prior version of tailwindcss, I used to have config file which helped me to set a custom theme for the entire app based on the value of an env variable.
But ever since the tailwind config was deprecated in favor of .css way of doing things, I am unable to do this. Even including the config file in the css file doesn't seem to work. Basically I just want to be able to use the
clientTheme
as the color utility classes but the value has to be taken from the env file. I am at a loss on how to do this.Beta Was this translation helpful? Give feedback.
All reactions