I know CSS quite well, as I've been working with it over 15 years. I've been surprised that new programmers hardly know it at all, and heavily lean on component libraries or css frameworks.
Can see why though, css has become very large and complex, and it's only getting worse.
The upside is that my simple fixes sometimes seem like a superpower to others.
Respectfully disagree. I think CSS is simpler than ever, and it’s only getting more streamlined and powerful. E.g. what used to be a complex blob of floats is now a simple grid layout.
It's getting more powerful than ever, and it's easier to do things that used to be hard (vertically centering, etc.), but it's also got a lot more capabilities that have a learning curve (custom properties, color functions, container queries, etc.).
I've been writing CSS since 1997, and I remember having to use invalid characters to fork CSS in the days of IE 6, and all the old school hacks involving floats, full-height content, etc. CSS in that era was hard, but it was hard in the sense of "there's stuff we just can't do in the browser, so let's design around that". Nowadays, it's hard in a different way, which is "oh, I guess there's an entire new hoard of CSS capabilities I've literally never heard of before, and I need to spend some time wrapping my brain around it, so I can add it to the massive and ever-growing pile of CSS things I need to know".
I used the parser inconsistencies myself. I created the first web app template that worked in IE 3/4 and Netscape 3/4 for a Fortune 500 back in the day.
The difficult part of CSS is that there is quite a lot of it, and that quite a lot of features have weird interactions, and browsers have real bugs surrounding all of that.
Take "position: sticky" for example; a fairly simple feature, and it simplifies stuff because previously folks were doing that with JS.
But also: there are tons of cases where it doesn't work, or where it works in unexpected ways. A few years ago I compiled a issues with position:sticky, and the number of caveats and bugs in both Firefox and Chrome was absolutely bewildering (I'm not sure if I still have the list somewhere).
This is the sort of thing that makes CSS difficult and complex. Originally HTML/CSS was just a simple text rendering system. So much stuff has been slowly bolted on, not always in the best way.
Other than that I do agree with you. "Just align stuff with flexbox" is kind-of my go-to way of doing CSS these days (I never really got around to looking at grid), and it's a massive time-saver over using hacky float stuff. And having one box model for all browsers also saves a lot of headaches. Hell, I read we're finally getting vertical alignment!
But also: there is a lot of complexity that can really bite you in the arse and make life difficult.
> what used to be a complex blob of floats is now a simple grid layout.
And what used to be relatively simple static layouts designed for a 4:3 screen are now layouts that must accommodate a screen of any arbitrary aspect ratio and physical size. This means that most of your components will now have at least 2 layout states, one for desktop and one for mobile, usually horizontal and vertical respectively, accomplished by switching random layout related properties on and off. Arguably anything related to CSS layout comes with a ton of quirks and flex/grid are no exception. It's those quirks that put most people off CSS, because they're sometimes far from intuitive, hard to debug, and are just things you have to know.
> And what used to be relatively simple static layouts designed for a 4:3 screen are now layouts that must accommodate a screen of any arbitrary aspect ratio and physical size.
You should, yeah – it’s not inherent to CSS, though. For example on Android, your app can be ran on phone or tablet. I’d argue that the tools CSS provides for this are pretty easy to use.
> accomplished by switching random layout related properties on and off
You don’t have to, but it’s easier to understand usually.
For example, you can make a sidebar layout without @media (or @container) queries but you have to understand flexbox pretty well: https://every-layout.dev/layouts/sidebar/
(Personally, I’d just use an @container query here.)
As a markup language I think it's getting more complex but there's a lot more functionality that makes it a lot easier to do things with it. Knowing when to use what functionality can be overwhelming and seem complex though.
There's a lot about it I like though. It seems like it's starting, or perhaps already has, made things like SASS obsolete.
I am working through now creating a Hugo theme for my blog using just CSS (no Sass, Tailwind, etc), trying to avoid needing to use Hugo extended.
Yup. Variables, imports, i think nested declarations are also available now, less browser specific prefixes, this semicolon ":" selectors, etc. CSS have only become easier and more powerful.
Easier to use well is not the same as easier to learn well.
In a sense it's easier to use if you follow the happy path, and have a good resource of what's on that happy path.
It's harder to use if working with legacy software, or don't have a good guide to stay on the happy path.
There are also more concepts overall to learn from box model and stacking context to flow layout, flex, grid, compositing, and isolation than there were 15 years ago. Some of these can replace previous concepts like float and table based layouts, but overall I'd say the barrier to expertise is higher.
I don't understand what people mean when they say things like CSS has gotten more complex. It's not like anyone is realistically expected to commit the entire spec to memory.
Documentation is plentiful when a person needs to use an unfamiliar feature, so it's not like it is even necessary to keep everything you use at the top of your mind. And just like anything else, if you use is often, you'll naturally learn it.
Plus, things like flex and grid have made having to remember a ton of old hacks unnecessary, so it has actually gotten markedly easier to use.
> I've been surprised that new programmers hardly know it at all
Not saying TW doesn't have some merits but probably the biggest reason for its adoption is people avoiding to learn CSS.
Reminds me of Mongo over a decade ago. There was a huge influx of devs getting into backend with Node who didn't want to learn SQL. So they went with Mongo because it was easier to get started. And for a couple of years now there's been a huge shift back into SQL with Postgres and SQLite.
I'm pretty sure we'll see the same with CSS in a couple of years. Heck, it might be already happening.
And native CSS is becoming so good that it will be impossible to ignore. With nesting and variables it made already SCSS unnecessary for most projects.
Tailwind doesn't prevent you from "learning css". It may prevent you from learning some legacy things which are best avoided these days, like float though.
You can't use tailwind without either understanding CSS or learning it as you use it. I have to wonder if people who claim otherwise haven't used tailwind.
Do you think that Iran would do any better given the opportunity? The very fact that you where able to freely learn of these attrocities commited committed by your own leaders, is only due to you living in a democratic country. Where you to live in Iran, or China, Russia or any other dictatorship for that matter, the situation would be very different.
No one should deny that that is plenty wrong with the western world and it's actions, but to suggest that a totalitarian regime, that engages in suppression of women and gruesome violence against protestors, is somehow equal or even superior is just plain wrong.
"Given"? Who do you think took the opportunity from the Iranian people in 1953? You have a very distorted idea of how it is to live in what you consider dictatorships. In fact, in most of those countries, people have a better idea of what's going on both in their own countries and in the world. They have access to two opposing points of view, unlike most people living in the west.
Nobody claimed Iran, Iranians or whatever they are doing is superior. I'm just sick and tired of the righteousness expressed in this forum. No matter how backwards is Iran and its government and atrocities committed by them against their own people, it pales in comparison to what the west has done just in the past two decades. They keep their shit to themselves so to speak. The Americans in this forum would do well to follow suit.
It is worth mentioning that those same backwards people are also one of the top producers of knowledge not just in the middle east[1], but the world[2], in many fields outproducing most middle tier European countries. Your idea of the world is comical, as such you do not understand it as it is.
The above are coming from a liberal Iranian who lives in the west, so take it for what you would.
Yes, I've got a shopping/todo/whatever list app that I made for myself and my girlfriend. So far it has multiplayer editing, offline mode, suggestions when adding, scraping ingredients from a recipe site we use. I love that I can just add random things that I need like that last one. I hate the multiplayer syncing, it's kinda brittle. I guess I spent around 20 hours on it.
Interesting how Google first decided to "borrow" knowledge from other pages and display it directly on their own site, but now they are also directly blamed if it's wrong.
If it was just a link, people would just think that site was wrong, now they think that Google is wrong.
They don't think Google is wrong, Google is wrong period. They are not obligated to answer questions. But if they do, they are responsible for the answer. LLMs are great for creative work or translations, but one of their weak point is sense of truth. It's simply a very bad technology choice for Google to use them to power this feature.
True, I can recommend hotwire turbo as an alternate similar to htmx, it has a js framework called Stimulus that integrates nicely for those instances where you need some custom interactivity.
Can see why though, css has become very large and complex, and it's only getting worse.
The upside is that my simple fixes sometimes seem like a superpower to others.