Modern CSS Code Snippets: Stop writing CSS like it's 2015
101–110 of 318 posts
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#102Earlier quoted context omitted.
I’d somewhat agree with you there, but I usually use variables for uniformity. I do see arguments against tailwind but find anytime I’ve tried to do anything else it just feels like bikeshedding on internals for the same end result. Really what I want to see is beautiful TDD for CSS so that uniformity can be enforced, but I’m not sure that exists.
Variables are hugely helpful, I agreee. IDK about bikeshedding. I'm very used to writing React code that normally declares no styles for components at all, and having CSS that style components using 1-2 classes, specific to these components. Container components control margins, controls general things like fonts. It seems that what solves the problem is a good component library. "But I need red text here!" For what…
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#103Earlier quoted context omitted.
Colocation is a useful principle in component-based architecture.
In my lived experience, shared components just become another problem. Especially in a fledgling company, the iteration velocity is actually negatively affected by shared libs because there's always overhead to (not) break legacy. so shared components bloat to address every evolving need. And now with AI generated code i see so many wrapper patterns that forward endless props down, it's crazy! TLDR: i almost always e…
You’re right about DRY and code reuse very often being a premiere (wrong) abstraction, which is usually more of a problem than a few copy/pastes, because premature wrong abstractions become entrenched and harder to displace.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#104CSS in 2025: Let's write html inlined styles as if it was 2005 and separation of formatting/representation was never invented. I talk of tailwind, of course.
Yeah let's do that. You have everything related to your component on place instead of jumping between files.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#105Earlier quoted context omitted.
Another loser here to second you
I wrote these libraries like https://github.com/kristopolous/db.js and https://github.com/kristopolous/evda in the early 2010s. I spent months on them I was all in. I swore off touching front end in 2022. It's terrible now
I thought it was funny that you wrote this way back when:
>> I've often seen projects where I think "what talks to what and how? What is the separation of concerns and where does this code live?"
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#106Earlier quoted context omitted.
Is staying in one file supposed to be difficult or something?
this is grey text from tailwindcss.com, I wouldn't call it easy and readable. Because Tailwind is so low-level, it never encourages you to design the same site twice. Some of your favorite sites are built with Tailwind, and you probably had no idea.
Because Tailwind is so low-level, it never encourages you to design the same site twice. Some of your favorite sites are built with Tailwind, and you probably had no idea.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#107I dislike the examples here where the "old" way works in all browsers, but the "new" way only works in Chrome/Edge. IMO, it's irresponsible to include such examples, since it makes the Blink monoculture worse.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#108Earlier quoted context omitted.
this is grey text from tailwindcss.com, I wouldn't call it easy and readable. Because Tailwind is so low-level, it never encourages you to design the same site twice. Some of your favorite sites are built with Tailwind, and you probably had no idea.
That’s actually disgusting.
Check out the Netlify admin dashboard screenshot in my blog post
https://pdx.su/blog/2023-07-26-tailwind-and-the-death-of-cra...
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#109Earlier quoted context omitted.
Tailwind is a direct response to how the "C" in "CSS" actually sucks, so there's no surprise that it's so popular.
The "C" (Cascade) in CSS doesn't suck, the education about it sucks. People don't know how it works, then things go wrong so they learn to work around it. That's what led to things like div + class soup that you get with the BEM naming convention or Tailwind. The cascade is actually awesome, super powerful and if you know how to use it, it can greatly simplify your code. Education is the problem and the solution. ---…
It's not just css either. At a job I've worked, we had a VPN client that would get into a weird state, where it needed to be killed to restart. An incantation that made use of ps, grep, awk, and xargs was provided, instead of just using pkill
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#110Me: cool, let's be creative, I love 2026. Browsers: Yeah, but beware of limited availability, most of those creative examples are in the 40-50% browsers support range.