Skip to main content
Inspiring
April 17, 2007
Question

Dynamic CSS Stylesheets

  • April 17, 2007
  • 2 replies
  • 377 views
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?
This topic has been closed for replies.

2 replies

Inspiring
April 18, 2007
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
Sabai-dee.com
http://www.sabai-dee.com
Inspiring
April 18, 2007
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.
Regards