User generated custom css

前端 未结 4 2000
忘掉有多难
忘掉有多难 2021-01-06 21:36

Hey, anyone have any idea what the best way to allow users to save custom css would be? Specifically, there are about 4 color values that I would like to allow a user to ch

4条回答
  •  孤城傲影
    2021-01-06 22:37

    and then using dom:loaded with prototype

    Awww, don't do that! That won't work when JavaScript is turned off.

    Approach 1: Static stylesheet, dynamic values in document head

    For the sake of not having to work with a dynamically created style sheet, have a separate, static CSS file with all the definitions that won't change.

     
    
    

    All the definitions that will change, you could put into the head of the HTML document, fetching the user-changeable values from a database.