Loading styles on the web is something that looks trivial at first. You just add a <link rel=stylesheet> to your page (or <style> for inline styles) and you’re done.

But if you wanted to load CSS fast, all of the sudden you run into trouble…

Assuming you have a traditional web app (or what the kids call Multi-Page App/MPA), you now need to make tradeoffs:

  • You most probably want the CSS that’s critical to the page the user is loading to block the rendering of that page, to avoid FOUC.
  • At the same time, you don’t want to load all the styles any page on your site may need, as that would delay that critical first load (and your FCP and LCP metrics on that page).
  • But, if you were to only load the critical CSS …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help