DEV Community

Discussion on: 怐Step by Step怑How to implement Dark Mode with Tailwind CSS on React

Collapse
 
futureistaken profile image
R Z

This is fine, just an extra 2 MB of "CSS" code, extra work for the browser, and just making our components dependent on external CSS. In fact, this list should be longer!

Collapse
 
thedevdavid profile image
David

If you set up PostCSS and purge correctly, there won't be any problems with CSS size. You can easily set up inlining critical CSS too to help speed up loading and Lighthouse scores too.

Collapse
 
taishi profile image
Taishi

YeeeesšŸ‘

Collapse
 
thomasledoux1 profile image
Thomas Ledoux

You can easily purge the CSS from Tailwind. They have a whole doc section about it: tailwindcss.com/docs/controlling-f...

Collapse
 
futureistaken profile image
R Z

This approach has a dark side!

Thread Thread
 
thomasledoux1 profile image
Thomas Ledoux

How so?

Collapse
 
taishi profile image
Taishi

Yes, we can easily purge the CSS šŸ˜