#Multi-tenant, same codebase, but different CSS style

12 messages ยท Page 1 of 1 (latest)

cerulean solar
#

Hi there ๐Ÿ˜Š

I'd like to use the Multi-Tenants feature and have the same Next Js code base for my front end. The idea is to easily duplicate the same site several times and just change the CSS (colors, CTA shape...) depending on the domain, while keeping the same collection structure and components across all sites. The idea is to have only one code to maintain. I've already looked at the example provided by Payload but I'm not sure what is the right logic to adopt?

Thanks for your help!

fresh galeBOT
hard bloom
#

Which provides you with an option to specify the path to custom style rules used for this payload instance

#

Would that work?

cerulean solar
#

Thanks for your reply and help! I was talking more about the style file linked to my app in the front end, not especially the back office ๐Ÿ™‚

hard bloom
#

Ahh

#

Hmm, you could maybe create a Global for "theme"

#

where you can specify the primary colors

#

and add custom rules

#

ah but pulling that from an API prob isnt ideal

cerulean solar
#

I thought about using a mono repo, deploy the same code for all the websites and just have a different .env file with a different database for each website, and add a global theme option with a text input to specify the css file needed for each website. Like that, when I deploy a new version of the code in my repo, it will be deployed on all the site but they keep their own theme settings stored in the db