function _colorizer_rewrite_stylesheet in Colorizer 7
Rewrites the stylesheet to match the colors in the palette.
1 call to _colorizer_rewrite_stylesheet()
- colorizer_update_stylesheet in ./
colorizer.module - Create a new stylesheet by replacing color variables Basic filehandling copied from Color module Returns full path to new css file
File
- ./
colorizer.module, line 269 - Colorize your theme
Code
function _colorizer_rewrite_stylesheet($palette, $style) {
// loop through all color variables and perform string replacement in css
foreach ($palette as $key => $value) {
$style = preg_replace('/@' . $key . '\\b/', $value, $style);
}
return $style;
}