Live data from Hacker News

Styling with Classy CSS (2006)

thedailywtf.com

1–10 of 76 posts

Re: Styling with Classy CSS (2006)

#4
post #2

Back in the day we made fun of this nonsense, now we freakin glorify it with libraries like Tailwind & friends...

Why do you feel it's nonsense? I'm genuinely curios.

Personally I'm using Tailwind for 90% of the styling. If I keep repeating a certain combination of classes often, I'll group it with a custom class. (Edit: See colejohnson66's comment for an example)

Two advantages of tailwind that I didn't see before I started using it:

- It's often easier to find what I want in the tailwind documentation, and it comes with nice examples. MDN is great, but with Tailwind I get reasonable presets.

- TailwindUI: Saves me a lot of time and looks good without feeling as generic as bootstrap.

Re: Styling with Classy CSS (2006)

#6
post #4
post #2

Back in the day we made fun of this nonsense, now we freakin glorify it with libraries like Tailwind & friends...

Why do you feel it's nonsense? I'm genuinely curios. Personally I'm using Tailwind for 90% of the styling. If I keep repeating a certain combination of classes often, I'll group it with a custom class. (Edit: See colejohnson66's comment for an example) Two advantages of tailwind that I didn't see before I started using it: - It's often easier to find what I want in the tailwind documentation, and it comes with nice e…

[dead]

Re: Styling with Classy CSS (2006)

#7
post #4
post #2

Back in the day we made fun of this nonsense, now we freakin glorify it with libraries like Tailwind & friends...

Why do you feel it's nonsense? I'm genuinely curios. Personally I'm using Tailwind for 90% of the styling. If I keep repeating a certain combination of classes often, I'll group it with a custom class. (Edit: See colejohnson66's comment for an example) Two advantages of tailwind that I didn't see before I started using it: - It's often easier to find what I want in the tailwind documentation, and it comes with nice e…

My gripe with Tailwind is the redundancy of class definitions across elements that clearly would benefit from "normal" CSS. If I have a with a whole host of elements, those repeated class definitions become quite tedious.

Re: Styling with Classy CSS (2006)

#8
post #4

Earlier quoted context omitted.

Why do you feel it's nonsense? I'm genuinely curios. Personally I'm using Tailwind for 90% of the styling. If I keep repeating a certain combination of classes often, I'll group it with a custom class. (Edit: See colejohnson66's comment for an example) Two advantages of tailwind that I didn't see before I started using it: - It's often easier to find what I want in the tailwind documentation, and it comes with nice e…

My gripe with Tailwind is the redundancy of class definitions across elements that clearly would benefit from "normal" CSS. If I have a with a whole host of elements, those repeated class definitions become quite tedious.

Use PostCSS:

    .myFancyTable td {
        @apply p-4;
    }
The advantage of Tailwind, IMO, is that styles for one-off components (like a breadcrumb bar) can just be written inline instead of in a separate file. But reused components like table cells should be using CSS selectors.

Re: Styling with Classy CSS (2006)

#9
post #2

Back in the day we made fun of this nonsense, now we freakin glorify it with libraries like Tailwind & friends...

CSS is one of the places in web dev that never really reached consensus, even today. We might get WASM as the app platform of the web before this even happens.

Re: Styling with Classy CSS (2006)

#10

Earlier quoted context omitted.

My gripe with Tailwind is the redundancy of class definitions across elements that clearly would benefit from "normal" CSS. If I have a with a whole host of elements, those repeated class definitions become quite tedious.

Use PostCSS: .myFancyTable td { @apply p-4; } The advantage of Tailwind, IMO, is that styles for one-off components (like a breadcrumb bar) can just be written inline instead of in a separate file. But reused components like table cells should be using CSS selectors.

Cool. So @apply is basically a way to compose classes from other classes?
Post reply on HN