I just use a .cfm as my dynamic stylesheets and use <cfcontent
type="text/css" reset="yes" /> at the top. Then you just call it the same
way you would a normal .css

<link rel="stylesheet" type="text/css" href="dynamicStyles.cfm" />

You can use all the CF you want in it now. It will be up to you to decide
what is global and 'static' though for performance sake.

I would have a main.css that has all the style info that is global and
static then use the .cfm method only for those dynamic needs and use a
separate <link ..> when that dynamic info is needed If it is just a couple
classes/IDs then I would just put them all in a static style and use CF to
decide which class to call.

<cfif whatever>
  <cfset thisClass = "class1" />
<cfelse>
  <cfset thisClass = "class2" />
</cfif>

<div class="#thisClass#"></div>

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

-----Original Message-----
From: Bruce Sorge [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 10, 2007 1:00 PM
To: CF-Talk
Subject: "Dynamic" CSS

Good morning everyone.
I have a question. I am working on our school's websites and rather than
have 12 different style sheets, I would like to have one style sheet that
has three classes where the background-color attribute is dynamic. So how
would I go about doing this? Now I can create a css.cfm page and load the
colors into the database, making sure that the proper school ID is
associated with their respective colors, but I thought that I might be able
to use the .css page instead.


Thanks,

--
Bruce




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288126
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to