4 ms·
The Undeniable Utility of CSS:Has
- deleted 2y ago[deleted]
- dleeftink 2y ago> Browsers are really good at doing style recalculation. This isn't something we need to worry about. In the context of a static page, maybe not, but I found that combining :has with nested CSS can impact real-time UI interactions greatly. Refactoring styles back to non-nested CSS and specifying :has selectors to get as close as possible to their child elements enhanced performance of an Electron app greatly when it came to render blocking of many nested nodes where parent attributes would frequently change.
- Zekio 2y ago:has is still faster than the alternative that was using javascript to do the same from my experience, but I've mostly used it for small stuff