News for hackers. Stuff that matters.
Re:State of CSS by arrow7000 on Friday October 21, 2022 @01:08PM (#33290462)
No. If you have to write styling in JS I can guarantee that it will be far more brittle, less performant, and way more susceptible to FOUCs, reflows, jank, and potentially deadlocks of conflicting resizing elements than the equivalent in CSS.
Re:State of CSS by nwienert on Friday October 21, 2022 @01:48PM (#33290909)
Or you can author styles in JS and have them compiled to CSS. Then it's actually less brittle (fully typed), no fuoc, jank or deadlocks.

https://vanilla-extract.style

https://tamagui.dev

Re:State of CSS by activitypea on Friday October 21, 2022 @03:21PM (#33292020)
All of which is preferable to an ever-growing spec whose pace makes it impossible for a newcomer to enter the browser space.
Re:State of CSS by alvarlagerlof on Friday October 21, 2022 @03:43PM (#33292252)
JavaScript simply shouldn't handle a lot of layout. It's not running in sync with the layout engine in css.
Re:State of CSS by Sesse__ on Friday October 21, 2022 @05:40PM (#33293338)
There has been some movement to handle CSS layout in JavaScript (running in a service worker, so that it cannot have state, but otherwise fully in sync with the layout), as part of the “Houdini” effort: https://www.w3.org/TR/css-layout-api-1/

(Disclosure: I work on the style team in Chromium)