My divs are white ?
Answered
Barbary Lion posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Barbary LionOP
I'm currenty working on a personal project.
In localhost everything's fine but with vercel, my div are white...?
How can i fix this ?
Repo : https://github.com/bastianfbr/next-quiz
Site : https://nquiz.vercel.app/
In localhost everything's fine but with vercel, my div are white...?
How can i fix this ?
Repo : https://github.com/bastianfbr/next-quiz
Site : https://nquiz.vercel.app/
![Image](https://cdn.discordapp.com/attachments/1180906737218363464/1180906738229198978/image.png?ex=657f201a&is=656cab1a&hm=8f9ca26b65050d7245a949c1270b4abfa16903a2c3af1d977e677be0a5942c19&)
Answered by Ray
const colorMap = {
"red": "bg-red-500"
"orange": "bg-orange-500"
}
<div className={`flex flex-col items-center justify-center rounded-md p-8 mb-2 w-2/4 sm:w-80 mx-auto ${colorMap[color]}`}>
something like this
9 Replies
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
<div className={`flex flex-col items-center justify-center rounded-md p-8 mb-2 w-2/4 sm:w-80 mx-auto bg-${color}-500`}>
the color class cannot be dynamic
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Barbary LionOP
but it works in localhost...
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
try npm run build and npm run start
it won't work
tailwind doc has mention it
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Barbary LionOP
ah...
so what can i do ?
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
const colorMap = {
"red": "bg-red-500"
"orange": "bg-orange-500"
}
<div className={`flex flex-col items-center justify-center rounded-md p-8 mb-2 w-2/4 sm:w-80 mx-auto ${colorMap[color]}`}>
something like this
Answer