2 Replies Latest reply on Apr 17, 2007 11:28 PM by Newsgroup_User

    Dynamic CSS Stylesheets

      I have a template site that allows the individual users to control the content and certain design elements of their instance of the website through a backend administration interface. I would like to give them more control over the design by allowing them to change colors in the stylesheet.

      I'm thinking about storing the variables in a table and and then generating the stylesheet as a file from the table. I'm not sure this is the best way to go about this so I would entertain any ideas you might have.

      Has anyone had any experience with this? If so, how did you approach it?
        • 1. Re: Dynamic CSS Stylesheets
          Sojovi Level 1
          I think the better way to handle this, could be, keep in a .css file the classes and design elements that keeps unchanged, and generate in a <style>..</style> inside the page with the classes and design elements that the user can control. I think generate a .css file each time is not a good idea.
          • 2. Re: Dynamic CSS Stylesheets
            Level 7
            i agree. it will be a lot easier for you to create a cfm file with css
            elements users can change from the table that stores the values and
            cfinclude that file on each page then to actually create a .css file
            every time your user changes style preferences...

            you could even call the fields in the table that stores the css values
            same as the css entity the value belongs to, then in one query of that
            table you could populated the whole stylesheet with name/value pairs...

            Azadi Saryev