Hello,

Since your question is interesting, I have quickly written a very small Perl
script that extracts all properties from a given list of style sheets.

For this script I used the CSS parser Allen Day and Cal Henderson, which you
can find on the Comprehensive Perl Archive Network (aka CPAN).

URL : http://search.cpan.org/~iamcal/CSS-1.09/CSS.pm

This script takes all properties from a list of style sheets and generates a
JavaScript array, as I said in my previous mail.

*Usage : *

perl css2js.pl --help
Usage: perl css2js.pl (--help | --stylesheets=<list of style sheets>)

*Let's apply the script to BluePrint:*

perl css2js.pl --stylesheets='*forms.css*;*grid.css*;*ie.css*;*print.css*;*
reset.css*;*typography.css*'

This will create a JavaScrip array that contains all properties defined in
the style sheets.

# Total: 42
var cssProperties = new
array('font-style','border-right-width','background','padding-right','border','margin','border-right','height','margin-top','border-left-width','margin-right','color','width','position','display','padding-left','float','border-width','content','overflow-x','margin-left','border-bottom','border-color','border-style','background-color','font-family','padding','font','visibility','overflow','white-space','line-height','padding-top','margin-bottom','border-collapse','text-align','border-spacing','font-size','font-weight','clear','text-decoration','vertical-align');

OK. We have a quick and easy way to retrieve all the CSS properties to
remove.

The JavaScript code should be:

for (i=0; i<cssProperties.length; i++)
{ $('#item').css(cssProperties[i], '').find().css(cssProperties[i], ''); }

The code above should remove all CSS properties listed in the array, for the
element designed by its ID "item", and for all its children. I did not test
it, but this part of the work should be OK.

I join the Perl script to this email (css2js.pl).

In order to use it, make sure to install the two following Perl modules:

   - *CSS*: http://search.cpan.org/~iamcal/CSS-1.09/CSS.pm
   - *Getopt::Long*:
   http://search.cpan.org/~jv/Getopt-Long-2.38/lib/Getopt/Long.pm

Note: These modules can be installed automatically using the CPAN installer
(cpan -i CSS and (cpan -i Getopt::Long).

Regards,

Denis










2011/3/29 johnw <[email protected]>

> Denis, how would that clear something inherited from, say:
>
> body {line-height:1.5;background:white;}
>
> Which is based on tags and not classes and which Blueprint has in
> screen.css?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Blueprint CSS" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/blueprintcss?hl=en.

Attachment: css2js.pl
Description: Binary data

Reply via email to