| ▲ | jamienk 9 hours ago | |
Still can't tree shake. It's what makes my old css files grow into monsters. I feel like everyone has given up on this. | ||
| ▲ | robertwpearce 8 hours ago | parent | next [-] | |
For small-scale projects, I use a server-side helper for an HTML page to include only certain CSS, SVG, and JS on a page. Each JS file is tiny, progressive, vanilla JS; SVGs are predefined and generate an SVG sprite that I then consume; CSS pulls in a `base.css`, the page's CSS file, and any component ones pull in their own. It's hand-rolled per project (pre-AI being decent), but I'm proud of it, and it keeps every page tiny. HTTP/2 multiplexing is pretty good and downloads the files more or less in parallel. | ||
| ▲ | afavour 9 hours ago | parent | prev [-] | |
CSS modules ought to make it possible. But it’s more or less impossible with regular CSS, you have no idea when a class/ID might be used. | ||