• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Dynamic CSS Stylesheets

Explorer ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

336

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 17, 2007 Apr 17, 2007

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation