title: Multi tenancy UI customization
body: <p>I am facing an architectural problem with designing the UI customization solution for a multi tenant application, the application architecture is as follows</p>
  
  <p>Our is a single page application.</p>
  
  <p>We have two servers Server A and Server B</p>
  
  <p>Server A is responsible for serving the HTML and other static assets like css, images etc.</p>
  
  <p>Server B is the backend api server.</p>
  
  <p>Current Front end build process, works on the front end server, on every git commit, we trigger a build process which does the job of compilation of scss to css files.</p>
  
  <p>The bottleneck here is that we need to manually add the custom variables.scss file for every new tenant to be able to generate the tenant specific css.</p>
  
  <p>We want to automate this process such that we can upload a new variables.scss file and have it included in the build process for generating tenant specific css.</p>
  
  <p>So basically looking for ideas on how to achieve this efficiently.</p>
  
  <p>Let me know if further details are required.</p>
  
  <p><strong>UPDATE</strong>
  In our index.html we are dynamically loading tenant specific css file based on the subdomain present in the url.</p>
  
  <p>We use a grunt based build task for sass compilation, here's how it works.</p>
  
  <p>we have a sass folder which contains  main.scss in the root and a tenants folder inside the sass folder which further contains a subfolder for every tenant, each sub folder contains a variables.scss. We have written a grunt task which does the job of dynamically generating the css file for every tenant( by merging main.scss and variables.scss ) in the dist folder.</p>