How to support white label solutions in a single codebase with Tailwind CSS #11964
Unanswered
tictoc-kyle
asked this question in
Help
Replies: 2 comments 1 reply
-
@tictoc-kyle, I think you should add |
Beta Was this translation helpful? Give feedback.
0 replies
-
@tictoc-kyle sorry for the necro bump, but did you figure this out? We're looking for a similar setup for a white label product at $WORK as well. |
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
-
I'm trying to figure out the best way to support white label brands within a single codebase using Next.js and Tailwind CSS. What I've come up with so far is to have a predefined custom plugin for each brand, and conditionally swap this plugin based on
process.env.BRAND
env variable when building each instance of the app. Everything works great so far, brand themes are isolated and the correct fonts are included in each build, however the conditional logic of swapping plugins based on env variables seems to break the Tailwind Intellisense plugin.I'm just wondering if anyone has tried to achieve something similar, or would advise against my current solution? Any potential problems this might cause?
I've also tried to conditionally import
global.css
files (iebrandOne.css
orbrandTwo.css
), but Next.js doesn't support this.I'm aware Tailwind CSS has a
@config
directory, however this only seems to be useful for projects that need more than onetailwind.config.ts
file within the same build. ie. One config for admin routes, and another for public routes. I need entirely isolated builds, one for each brand (each with their respective theme/plugin).The current solution:
global.css
tailwind.config.ts
Beta Was this translation helpful? Give feedback.
All reactions