Custom Stylesheet instead of Inline CSS for WordPress Customizer API Overrides

However, the recommended mechanism for injecting the styles is really not cool. All guides I’ve read online and from WordPress recommend they be added inline to the Head of the document.

That’s how HTML works, no fault of WP’s. Dynamic stylesheets have always been a challenge since CSS is not dynamic language by nature.

There is number of options, which all can be implemented relatively neatly in WordPress, however all have drawbacks.

  1. Inline styles. Bloat page source size, but just work.
  2. PHP script serving CSS. Highly flexible, but serving extra PHP script is orders of magnitude slower than serving static CSS file.
  3. Compiling and serving static CSS files. Somewhat challenging to implement (especially in code for public use), but has least performance drawbacks.

Overall the way to go depends much more on your performance requirements and how will final product be used, than specific option. There is no winning one here.