Reputation: 7334
let me share my problem with you. To begin with I'm a junior-mid level web developer currently implementing a travel site. To deliver this I have a task in which I cannot find an efficient solution. This travel site will be provided in different hotels. For each hotel, the main theme for the app will be different for example the background images, the colors of some buttons etc. My first suggestion would be to have the CSS files for each hotel and by reading the name of the hotel from the state to import the according css. But the hotels will be many and by using so many files my bundle file will be enormous which I don't need. Another solution would be sending all the colors and images from the server but this will have a use impact in my code and I will have to refactor it in so many places. The idea of the server is fine I think But I want to use some theme template to makes these changes according to the server. Do you know something about that?
Upvotes: 1
Views: 1378
Reputation: 12374
I think there is no need to send all the colors and images from the server. You can store all of it on a frontend part and get only a type
from the server and apply different styles based on this type
. Maybe this library can help you here.
Upvotes: 1