Next.js Discord

Discord Forum

Server side theming

Unanswered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
Hello, i have a website that has special themes based on the specific page and as such they can be determined at runtime.

i wanna apply this theming from my layout without having to act on the specific pages, or at least override some specific parts of the css only in that page.

currently i have some logic to determine the theme based on the route path and i apply the colors using tailwind variables and some client side js to set the variables, tho i found that this approach means i have some milliseconds where the page has the default theme and gets themed later on.

is there a way to make this "static" and apply the theming from the server?

0 Replies