CSS
Last updated
Last updated
Critical CSS is a technique that extracts the CSS for above-the-fold content in order to render content to the user as fast as possible. Above-the-fold is all the content a viewer sees on page load, before scrolling.
Every kind of pages (ex: home, category, single..) has different CSS. You can find it's name by view the page source:
The critical CSS files are located in directory wp-content/uploads/critical-css
This hook helps you to insert stuffs before critical CSS or determine whether there are critical css or not.
You can share the same CSS between the pages, so you don't need to generate duplicate CSS for those pages.
To edit the content of critical CSS, you have 2 ways: by editing CSS file directly OR via hook:
Some Inline CSS on the page can load resources such as background image, font-face. So we will extract the CSS code that contains resources & group all of them in a separate tag named <style media="not all"
. This technical called lazy CSS, help to reduce the page load time. Now, You can modify this lazy CSS by using the code like this: