Next.js Discord

Discord Forum

Sanity styling option won't update Tailwind styling in Next.js project

Unanswered
Eurasian Hobby posted this in #help-forum
Open in Discord
Eurasian HobbyOP
Hi!

I'm working on a Next.js project with sanity. I have a schema for my component that has options with values that appear in a dropdown on the sanity dashboard. This particular dropdown allows for the user to choose how they want their layout to look, ie: image above copy with a value of flex-col or image below copy with a value of flex-col-reverse and so on for the right and left but with flex-row.

Then I use that value when I map over my schema data and plug it into the classname. The issue is it doesn't want to style it for some reason. The string will be in the classname and show up in the html in dev tools, but it's like Tailwind doesn't recognize it. All the other styling is applied except for that dynamic value.

Any clue why this might be happening? Is it not loaded fast enough for the render? Seems strange. Any advice appreciated 🙂

0 Replies