Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2013 (Bloomington, MN) with:

Minor CSSRule.cfc ColdFusion CSS Parser Update

By Ben Nadel on
Tags: ColdFusion

As part of my ColdFusion custom tag solution for generating Microsoft Excel files, I am going to be using my CSSRule.cfc ColdFusion component to allow users to use CSS-like styling to format the Excel document. To make the CSSRule.cfc more useful, I have added the support of the Color property (not sure how I missed that one before) and I have added three new methods:

AppendCSSRule( CSSRule )

This takes one CSSRule.cfc instance and adds its properties to the current CSSRule.cfc instance. It will only overwrite properties that have a value (it will not copy over empty string values). This gives the passed-in instance a higher cascading precedence.

GetRuleString( [IncludeEmptyValues] )

Converts the CSSRule.cfc property map into style-type attribute values (Ex: property = value ; property = value ;). By default, it will not include empty property values in the resultant string unless explicitly asked to do so via the IncludeEmptyValues argument.

PrependCSSRule( CSSRule )

This is a lot like the AppendCSSRule() method, but it treats the style cascading in a reverse fashion. This takes one CSSRule.cfc instance and adds its properties to the current CSSRule.cfc instance, but, it only adds the new property value if that property is not already defined in the current property map. This gives the current instance a higher cascading precedence.

The new download for this has been placed in the CSSRule.cfc project page. Going forward on the POI project, I am going to break off a new version of the CSSRule.cfc and make it tailored for applying CSS style values to a POI HSSFCell style object.




Reader Comments

Post A Comment

You — Get Out Of My Dreams, Get Into My Comments
Live in the Now
Oops!
Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.