CSSRule.cfc - Parsing CSS Rules In ColdFusion

<!--- Create the CSS rule. --->
<cfset objCSS = CreateObject( "component", "CSSRule" ).Init() />
 
<!---
	Add CSS to test values to make sure that the appropriate
	properties are populating. The AddCSS() returns a reference
	to the CSS Rule so that you can chain these method calls
	for better readability. Also notice that I am using several
	short hands just as "Background" and "Font".
--->
<cfset objCSS
	.AddCSS( "background: ##000000 url( 'back.jpg' ) repeat-y ;" )
	.AddCSS( "border: 2px solid green ; " )
	.AddCSS( "border-bottom: 5px dotted ##FF0000 ;" )
	.AddCSS( "font: bold italic 11px verdana ;" )
	.AddCSS( "list-style: none ;" )
	.AddCSS( "margin: 0px ; padding: 20px 10px ;" )
	.AddCSS( "text-align: justify ; text-decoration: underline ;" )
	.AddCSS( "white-space: nowrap ; z-index: 500" )
	.AddCSS( "bottom: 5px ; top: 2px ; left: 1px ; right: 3px ;" )
	.AddCSS( "display: block ; position: relative ;" )
	.AddCSS( "white-space: nowrap ; width: 500px ;" )
	/>
 
<!--- Dump out CSS property map. --->
<cfdump
	var="#objCSS.GetPropertyMap()#"
	label="CSS Rule Property Map"
	/>

For Cut-and-Paste