peroxide icon indicating copy to clipboard operation
peroxide copied to clipboard

Stylesheet order and CSS caching support

Open randomblast opened this issue 14 years ago • 0 comments

Hi,

I've been having issues with the order my generated files get inserted into $styles, as well as all the generated CSS disappearing when I enable CSS compression/aggregation in Drupal.

I think the best fix is to use the stylesheets[] array in the theme info to supply source files, and process them individually using hook_css_alter. Unfortunately that hook isn't available to theme engines, so you'd have to put a 1-liner in your theme's template.php to get that to work.

I can add the necessary functions if you'll accept a patch.

I'm suggesting adding _peroxide_process_sass()/_peroxide_process_less() functions, and a peroxide_css_alter() implementation which passes any file in stylesheets[] with a scss/sass/less extension to the appropriate function.

You'd just need to put in the theme's template.php function THEME_css_alter(&$css) {peroxide_css_alter($css);}

Could maybe put it in oxygen's template.php as well, to keep it clean.

Caveat: this obviously only works on D7.

randomblast avatar Apr 01 '11 11:04 randomblast