News for hackers. Stuff that matters.
Re:Ask HN: Simplest stack to build web apps in 2021? by tfehring on Monday November 22, 2021 @09:50PM (#29314087)
This is really interesting. Assuming I'm willing to trust the author's claim that semantic class names are the reason CSS is hard to maintain, what's the advantage of `<img class="w-32 h-32">` over `<img style="width: 32px; height: 32px;">`?
Re:Ask HN: Simplest stack to build web apps in 2021? by code_biologist on Tuesday November 23, 2021 @01:37AM (#29315154)
I'm willing to trust the author's claim that semantic class names are the reason CSS is hard to maintain

Here's a great talk on why he asserts that: https://www.youtube.com/watch?v=J_7_mnFSLDg

Not sure I 100% agree, but I appreciate the fresh look at oil patters.

Re:Ask HN: Simplest stack to build web apps in 2021? by mamcx on Tuesday November 23, 2021 @09:53AM (#29318447)
Think is like the most "functional" way to do CSS, in contrast with the "OO" way (like bootstrap).

Each class is applied in pipeline.

And ONLY to that tag. This is key. This leads to know, exactly, what are the effects on each tag, making the UI design very readable.

Then, you can customize it, and have a way to generate a VERY small CSS as result (another big advantage!) because the naming is normalized.

In short: Is the "same" but with more structure, predictability and tooling applied.

The more you need to customize, and the more pain you to "reverse" a CSS made by others, the more this make sense.

Re:Ask HN: Simplest stack to build web apps in 2021? by tga on Tuesday November 23, 2021 @09:32AM (#29318214)
Normally you wouldn't use `w-32` but rather something like `w-8`, that translates to `width: 2rem;`. Same with colors, you would use `bg-red-400`, that happens to translate to `rgba(248, 113, 113)`.

Half of TailwindCSS is a _way_ of using styles, but the other half is almost a theme: a set of margins, paddings, text sizes, colours, etc. that work well together.

Re:Ask HN: Simplest stack to build web apps in 2021? by mhoad on Tuesday November 23, 2021 @03:05AM (#29315639)
I like to think of Tailwind as CSS without the C.

Everything is now all at the same global namespace and all of the issues that people run into with specificity go away in the process.

It’s not my personal choice on how to solve that problem I think shadowDOM via web components are a much nicer option personally but Tailwind has a lot of very enthusiastic fans who seem to enjoy it.

Re:Ask HN: Simplest stack to build web apps in 2021? by slater on Tuesday November 23, 2021 @12:14AM (#29314817)
Less typing, less bandwidth (ab)used.
Re:Ask HN: Simplest stack to build web apps in 2021? by tfehring on Tuesday November 23, 2021 @12:59AM (#29314999)
I'd think the former would typically (depending on how many times the class is re-used) use more bandwidth, if anything, since it still requires the framework to define the `w-32 h-32` class attributes elsewhere using the more verbose identifiers. Plus the overhead for an additional request if that class definition happens in an external style sheet.
Re:Ask HN: Simplest stack to build web apps in 2021? by gls2ro on Tuesday November 23, 2021 @12:13AM (#29314814)
Media Queries