Archived topic
Using Hook Elements for Critical CSS
4 replies · Started by Anthony on July 31, 2020
I want to know if this is a good idea before I get too crazy with it.
Currently, I have some pages that just perform a lot better when certain styles are loaded in the <head>.
But, in an effort to keep every page having only the code it requires I began using hook elements and their display rules to conditionally place CSS in the <head> sections of specific pages.
Is this a good idea for the long run?
I know I read somewhere on the forum that you guys were working on making it ok to have a plethora of hooks/elements (not that I have many. I only have about 10 and 3 of them are <head> CSS).
Thoughts on this?
Thanks again!
-Anthony
Hi there,
yes, hook elements are great for adding inline CSS to the Head. Can't see any issues as long as you don't intend to add LOTS of them which could be a maintenance headache.
Great news.
Thanks, David!
Best
You're welcome
You're welcome