Go to Optimize, then CSS. Find the Critical and unused CSS card.
Step 1: Generate
Click Generate. Your browser opens some pages of your site, like a visitor. It finds the CSS each kind of page uses.
This happens in your own browser. Nothing is sent anywhere.
Step 2: Turn on what you want
- Show the first screen sooner (critical CSS). The top of the page shows sooner. May break: a short flash below the top of the page.
- Remove unused CSS (under Advanced). Each page gets only the CSS it uses. The full CSS loads when the visitor scrolls or taps. May break: things that scripts add later.
Something looks wrong? Add part of its CSS name under Always keep these. Then generate again.
After you change your theme
The card asks you to generate again. Until you do, pages keep their normal CSS. So nothing breaks.