Excession is a project mainly written in Ruby, it's free.
A library for modifying CSS files
A library for modifying CSS files.
Currently only supports global hue rotation.
Look at Excession::CssRegexHueMod:
str = <<-CSS
body {
background-color: #ff0000;
}
CSS
Excession::CssRegexHueMod.new.rotate_hue(120, str)
# => "body {
# background-color: #00ff00;
#}
This will recolour declarations of the form:
It does not recolour named colours, because without doing a full parse I can't tell with just a regular expression what is a colour and what is part of a selector.
There is a CSS parser in Excession::Parser::CssParser. This interface is incomplete because it is very slow (8 minutes to parse a 3500-line CSS file). There's a big TODO over this.
Alex Young [email protected]