I am working on a multi tenant app where I’d like each Tenant to control the colors of specific elements. For example, I’d imaging have a form w/ color pickers where users could control items such as site background color, navbar colors, etc.
I have a baseline SASS(.scss) file which sets the default color scheme. My questions are:
- How would I then load the “dynamic” theme .scss file?
- If I had model fields like Tenant.nav_bar_link_color, how would I load those values into the SASS theme file?
- Would I be able to/should I somehow precompile the Tenant specific themes into the asset pipeline?
After some research, I think the method outline here makes most sense:
User generated custom css
Basically i’ll store the Tenant controlled CSS values in the DB, and then render them out in the head as overrides against my default SASS file….