Earlier quoted context omitted.
Wait until sites start rendering to canvas. You will yearn for the days of div soup.
why should they? this has been a worry for some time, but I don't see it happening
Modern CSS Code Snippets: Stop writing CSS like it's 2015
241–250 of 318 posts
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#242I hate how it's still not possible to properly style the numbers in ordered lists. I use them for code snippets with automatic line numbers, but it's literally impossible to space the numbers (relative to the code) while keeping them aligned to the right. ¯\_(ツ)_/¯ https://jsfiddle.net/89t1rd2u/
Try ::before and css-counters.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#243Earlier quoted context omitted.
Jumping up and down in the file is not much better and you still need to come up with names for classes. I want to look at an element and immediately know how it's styled.
From Tailwind's home page: [...] "immediately" is a stretch
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#244Earlier quoted context omitted.
The deadest horse in web development is the myth of “separation of concerns”
I was recently doing some very specific web scraping of some very public very static documents. About 25% of them use a soup of divs with hashes for class names. Not a or or in sight. I am fine with the idea of what tailwind does but like at least using semantic tags where appropriate could be a thing.
The most cited example of one that's clearly missing is for user-added content, but there are probably dozens we could add that could help deal with the div soup. By not adding any new elements, whatwg is essentially saying "You're not going to be able to use these the existing tags to fully add proper semantics anyway, so why try?"
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#245Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#246CSS 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.
HTML vs. CSS is a separation of technologies. If HTML was really only about the content and the CSS was only about styling, we wouldn't have to write div soups to style our websites (.container-wrapper .container .container-inner { /* "separation" */ }) and we wouldn't have to adjust our HTML when we change the layout.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#247Earlier quoted context omitted.
From Tailwind's home page: [...] "immediately" is a stretch
You can fold it, format it, and IDEs preview it. This is like me posting the equivalent CSS in one big line. But even without all that I still prefer this over dealing with cascading styles in stylesheets. Never again.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#248Probably half of it still doesn’t work in Safari.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#249Earlier 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 a reminder that different people learn at different paces.
I think overall the additional details expand and perhaps better the metaphor: a lot of people want to jump directly to the advanced CSS stuff and skip the fundamentals. For some people that works and may be a shortcut. Other people need to spend more time breaking their teeth on the fundamentals, getting them wrong, learning from their mistakes, and getting rock solid on the slower building blocks before trying to do anything advanced.
Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015
#250CSS 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.
With tailwind, I can guarantee that changing a style in one component will only change that component. With css, there is no such guarantee. So of course the (wrong) way many devs fix it that is to add a new class, probably doubly specific, sometimes with important, and then everyone is sad.