Ctools has a useful framework for on-demand CSS generation, I think that this module should leverage it. At the moment this module requires an administrator to go to the settings form and submit before the new CSS file is generated. This means that it can be quite hard to update sites using this module, as there is an extra step after updating the variable by some other means.
If this module used the ctools CSS generation stuff, then you could build the CSS file on the fly (if needed) and thus if the contents of the variable (or hooks) changed, then the new CSS would automatically be generated. Because this would have a negative impact on performance, maybe storing the file-path or similar in the general cache table would be a good idea, so on a general cache wipe the CSS would possibly be re-generated.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | css3pie-1361328-ctools-css.patch | 3.16 KB | steven jones |
Comments
Comment #1
iler commentedHave to take look at this one but as you said it needs to be cached or something similar.
Comment #2
iler commentedThis is now implemented in the 7.x-2.x-dev branch. So when the cache gets cleared it will also trigger the regeneration of this css file. The css file is changed to use ctools css cache instead of files/css3pie/css3pie.css.
Comment #3
iler commentedAnd because of this ctools module is now also required for css3pie module to work.
Comment #4
steven jones commentedWe can actually go further and remove the hook_init (a great thing) and allow the CSS to be built on demand rather than trying to pre-empt needing it.
Attached is a patch that does the following:
Removes the hook init.
Changes
_css3pie_build_css3pie_cssto only build the CSS if really needed.Comment #5
iler commentedThanks for the improvements. Patch is now applied to the 7.x-2.x-dev branch.