independent-publisher icon indicating copy to clipboard operation
independent-publisher copied to clipboard

Output CSS generated by Customizer inline

Open raamdev opened this issue 3 years ago • 1 comments

Note: This is a work in progress.


The current method of outputting CSS generated by the theme options in the Customizer uses Admin AJAX. This is not compatible with caching and is an unnecessary performance bottleneck.

Instead of dynamically generating the needed CSS on-the-fly via Admin AJAX, let's store the generated CSS in a theme mod, then output the CSS inline via wp_add_inline_style().


Addresses #305.

raamdev avatar Oct 25 '21 17:10 raamdev

I've got a proof of concept working on https://raamdev.com/ but there's still something wrong with saving the theme mod when saving the customizer. I need to dig into that a bit more. I also need to work on a plan for backwards compatibility (i.e., upgrading from the previous version of the theme to this new approach should be seamless).

raamdev avatar Oct 25 '21 17:10 raamdev