News for hackers. Stuff that matters.
Re:Native HTML elements with CSS superpowers by jjcm on Monday June 15, 2020 @10:26AM (#23527667)
It used to be. In modern engines it's really no longer the case. Just did a mini test running both attr and class name selectors on 10000 objects. In both instances the paint was fully complete in a single frame.

Agree with the rest of the stuff you've said though. I just don't see a place for this library.

Re:Native HTML elements with CSS superpowers by dubcanada on Monday June 15, 2020 @11:09AM (#23528081)
I mean you are right, but there are certainly selectors which are "faster" just the faster part is more on the 0.000001ms level than any measurable level.

Also I am fairly certain (been a while since I spent time in Webkit source) but class name and attribute selectors are implemented the same, if you want to do a proper benchmark you would want to do id, nested selectors, attributes, class, etc. And at that level you will find a significant difference.

Re:Native HTML elements with CSS superpowers by wilsonrocks on Monday June 15, 2020 @11:15AM (#23528153)
I could see the point in attribute selectors - when using react I find it messy to programmatically specify class names based on state/props, particularly when using BEM.

Setting some Booleans as attributes is much nicer. However, it is built into CSS already, so not sure a library would help...