One website, multiple themes

Posted 1 year ago by tiagomatosweb

Hi everyone, I'm stuck in a tricky situation. I have a website which has multiple domains and themes. Each domain has its own theme which is pretty much css files. To fetch a theme, I need to call the API sending the domain name as a parameter in order to get the theme colors. After that, I need to apply those colors in the current website css file.

The issue is, the website uses SASS and the css is already compiled with the default theme.

I also have an admin section which allows the administrator manage the websites (domain name, color, and other basic stuff).

So, I'm wondering what is the best way to handle that.

So far, the best approach I have got is once a new website is added in the admin, the API will compile a new css files for this domain. However, I can see a couple issues already such as: how do I compile SSAS to CSS via PHP (Laravel)? Each website will have its own css stored in the API which will make maintenance really hard. Frontenders will need to work on the api site to change SASS file and compile all the time. I don't like much that...

Any better approach?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.