News for hackers. Stuff that matters.
Re:Ask HN: Good resource on writing web app with plain JavaS... by alwillis on Thursday November 17, 2022 @02:58AM (#33636146)
For layout/design, there’s open props [1].

I like the MDN for quick reference but the actual HTML spec is actually quite well written and has lots of useful examples [2].

[1]: https://open-props.style/

[2]: https://html.spec.whatwg.org/

Re:Ask HN: Good resource on writing web app with plain JavaS... by sdze on Thursday November 17, 2022 @03:58AM (#33636496)
Number 1 lags when scrolling on a 2018 MacBook Pro. Not a good advertisement of a product.
Re:Ask HN: Good resource on writing web app with plain JavaS... by shadeslayer_ on Thursday November 17, 2022 @04:02AM (#33636520)
Lags while scrolling on a 2021 MBP as well.
Re:Ask HN: Good resource on writing web app with plain JavaS... by aaaaarg on Thursday November 17, 2022 @05:09AM (#33636942)
hmmm it's good in my 12+ year old laptop in firefox.
Re:Ask HN: Good resource on writing web app with plain JavaS... by i_am_proteus on Thursday November 17, 2022 @05:19AM (#33637001)
Fine on a 2015 Thinkpad running Firefox on Fedora.

A product is poorly-advertised indeed, but which product?

Re:Ask HN: Good resource on writing web app with plain JavaS... by ExtremisAndy on Thursday November 17, 2022 @08:22AM (#33638471)
Yeah, I have to wonder if something else is going on with your machine/browser. Runs absolutely perfectly on my 2015 MacBook Pro.
Re:Ask HN: Good resource on writing web app with plain JavaS... by sdze on Thursday November 17, 2022 @06:34PM (#33647550)
I bet you don't use the Safari Browser. I checked again with Firefox on Mac and I didn't notice any performance issues.
Re:Ask HN: Good resource on writing web app with plain JavaS... by everythingabili on Thursday November 17, 2022 @01:18PM (#33643198)
[2] crashed Chrome 3 times. Mac Monterey.
Re:Ask HN: Good resource on writing web app with plain JavaS... by chrismorgan on Thursday November 17, 2022 @10:32PM (#33649763)
I don’t like Open Props on technical grounds: it’s pointlessly inefficient, largely an abuse of Custom Properties, to my mind, shipping a completely superfluous layer of indirection to every client, rather than flattening almost all of the properties at compile time as could and should be done. If you’re using something like Sass, you’d use variables for this sort of thing except where you do want to change values dynamically (e.g. different values in light/dark mode). Using Custom Properties for everything is just wasteful if you’re not going to have anything subsequently using the definitions themselves.

As an example, on their site, they’re sending about 68/12KB gzipped of styles. Some are already unused and could be removed by straightforward dead code removal. Inlining variables that are set only once and removing their definitions (which incidentally encompasses that dead code removal) reduces it to 40/8KB which will both transfer and evaluate faster. (A further 20% of the styles are also unused and possibly sanely removable.)