News for hackers. Stuff that matters.
Re:Old Dogs, New CSS Tricks by _heimdall on Monday May 27, 2024 @02:07PM (#40493104)
We do have tools for that though, how would a build tool fit into a language specification? Aren't those different concerns?
Re:Old Dogs, New CSS Tricks by lenkite on Tuesday May 28, 2024 @07:05AM (#40499472)
Dead CSS code should ideally be a warning on the web platform. This should be in the spec. Browser can probably emit a warning in the console log if there are CSS selectors that are not used. Authors can choose to explicitly mark with a `ignore-unused`, delete them or move such selectors to separate style-sheets that are loaded by the pages that actually use them. With HTTP/3 this makes more sense (CSS modularization) rather than one single massive CSS for the whole site that just keeps growing over time.
Re:Old Dogs, New CSS Tricks by _heimdall on Tuesday May 28, 2024 @08:25AM (#40500033)
That'd definitely be a useful devtools feature! I don't see why it would need to go through the spec process though, browser vendors could build that independently and get it out much quicker.