News for hackers. Stuff that matters.
Re:Show HN: Vanilla CSS Tailwind alternative in 16 lines by alexpetros on Wednesday October 04, 2023 @02:55PM (#37769904)
<style scoped> was a good idea. It's frustrating that the spec didn't end up officially supporting it, but a key feature of the web platform is that you can extend it and demonstrate the value that official support would bring. This is very cool, hope it gets some traction.
Re:Show HN: Vanilla CSS Tailwind alternative in 16 lines by miragecraft on Friday October 06, 2023 @09:34AM (#37790580)
It’s coming back with @scope at-rule: https://www.w3.org/TR/css-cascade-6/#scope-limits

> If no <scope-start> is specified, the scoping root is the parent element of the owner node of the stylesheet where the @scope rule is defined.

It also comes with the ability to set scoping limit.

Re:Show HN: Vanilla CSS Tailwind alternative in 16 lines by moritzwarhier on Wednesday October 04, 2023 @03:22PM (#37770272)
Previous discussion:

https://news.ycombinator.com/item?id=37715703

Nice idea, I'd still like to see some Lighthouse benchmarks for this compared to regular CSS (sorry, would love to contribute as the idea is lovely, but workday was enough time at the large computer for me today)

OTOH, this looks to me like it could invite yank and FOUC, OTOH the repo says performance is good and no flickering. I mean, it's certainly doable to make this performant and unnoticeable.

Kudos for this great idea.

Re:Show HN: Vanilla CSS Tailwind alternative in 16 lines by dandrew5 on Wednesday October 04, 2023 @06:49PM (#37772820)
Another one from 26 days ago: https://news.ycombinator.com/item?id=37435530

Three posts for the same offering in less than 30 days which makes me consider resubmitting my own things more often. Does HN have a limit on how often reposting is allowed? I know there's https://news.ycombinator.com/newsfaq.html that mentions not more than a year in between but maybe that's just a suggestion?

Interesting idea btw!

Re:Show HN: Vanilla CSS Tailwind alternative in 16 lines by jacobn on Wednesday October 04, 2023 @11:16PM (#37774564)
I believe there’s a vote threshold where HN blocks resubmission.
Re:Show HN: Vanilla CSS Tailwind alternative in 16 lines by stallmanwasrigh on Wednesday October 04, 2023 @03:42PM (#37770532)
Hope this inspires scoped <style> to come back to the standard! Seems like the perfect time with the advent of nested CSS support
Re:Show HN: Vanilla CSS Tailwind alternative in 16 lines by gitgud on Saturday October 07, 2023 @12:52PM (#37803332)
Very cool, I like the idea, reminds me of css modules in react, but easier. Or svelte/vue css.

Its weird to compare this to tailwind and say it’s a simpler abstraction though. This requires JS on the client, whereas tailwind does not. This modifies the css styles you write at runtime, tailwind does not.

> Tailwind verbosity goes up with more child elements

True, but in component-driven design this does not happen in source code at least. The tailwind classes are only defined in each component, not the usages.

> No chance of deprecations. 16 lines is infinitely maintainable.

Ridiculous claim, sorry. Those 16 lines aren’t trivial, aren’t tested, aren’t formatted (would be more like 30-40 lines I would think)

Anyway, I’m impressed with the idea and concept behind it. Good work on implementing it!