Best way to include dynamic CSS?

tyteen4a03

Well-known member
What is the best way to include dynamic CSS in pages? I have a CSS file that is constantly changing due to new data and such, and I have cached it in DataRegistry. I want to serve it via css.php but I'm not sure if I want to bother insert the CSS into the template system.
 
...implemented as a XF CSS template and called via css.php? The CSS can be cached, so don't use conditions in the CSS templates.

Maybe I should clarify a bit more... I'm using some database-stored data to generate a CSS stylesheet, I'm not sure whether I should write the final stylesheet to a template and <xen:require> the template, or use some hackery to put the CSS in <head> instead.
 
Maybe I should clarify a bit more... I'm using some database-stored data to generate a CSS stylesheet, I'm not sure whether I should write the final stylesheet to a template and <xen:require> the template, or use some hackery to put the CSS in <head> instead.

xen:require inside of the content template is the normal method. Either way results in a CSS resource in the head though, and that can be cached. Hence no conditions in the CSS.
 
Top Bottom