Change Theme / CSS based on user

前端 未结 8 1929
说谎
说谎 2021-01-02 06:10

I am building a product that we are eventually going to white-label. Right now I am trying to figure out the best way to facilitate these requirements programmatically so th

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-02 06:40

    I've been there some months ago. While using dynamic CSS generated by a dedicated handler / servlet has been the first solution, to improve performances a customized CSS is now produced on file overrinding the basic elements of the standard CSS:

    
    
    ...
    
    

    Each custom CSS will have its own URL, so you can make the browser caching them.

    This will make you saving for each request the users will make:

    1. traffic from the database to the application layer
    2. traffic from the application layer to the browser
    3. some computing at the application layer

    I'll second the idea the user should have to fill out a web-form detailing what customizations they want to make.

提交回复
热议问题