Reply To: Why does GP stick a heap of inline css in my header?

Home Forums Support Why does GP stick a heap of inline css in my header? Reply To: Why does GP stick a heap of inline css in my header?

Home Forums Support Why does GP stick a heap of inline css in my header? Reply To: Why does GP stick a heap of inline css in my header?

#75967
Tom
Lead Developer
Lead Developer

Sure is.

The CSS in the <head> section of the site is generated by the options you choose in the Customizer.

CSS isn’t a dynamic language, so you can’t call the values from the Customizer to a regular stylesheet (I wish).

Options:

a) Use PHP to create a dynamic stylesheet and include it.

Positives: No inline style in the source
Negatives: Performance takes a pretty decent hit – the server has to create the dynamic stylesheet on every single page load, using server resources and causing longer load times.

b) Include the CSS in the <head>.

Positives: The CSS is read and cached by the browser. Browser doesn’t need to load an external stylesheet. Best option performance-wise.
Negatives: Makes the source look messy.

I figure overall performance is more important than code appearance, so I went with option b.

If a third option is revealed that allows me to add it to an external file and not hurt performance, I’ll absolutely make the switch 🙂