As someone who did webdev back in the 2000s and still does it now, I do not agree with this at all. Webdev is easy now. Especially with the development of simpler build systems (esbuild, vite, etc) in the couple of years.
Well you can still make websites with plain HTML and CSS today, and the layout modes (and other niceties like border-radius) that are available today so are much nicer than the ones that were available 20 years AND they work the same in every browser!
20 years ago you were cobbling together layout with tables and floats (you didn't even have `display: inline-block`). And people still wanted vaguely responsive layouts even though there weren't any media queries yet. Plus there were 3-4 major browser engines that you needed to test with, and there were often major differences in both feature support, bugs and layout between them. For example you had to deal with the fact that IE used what is now known as `box-sizing: border-box` while other browsers used `box-sizing: content-box`, and the fact that browsers didn't even parse HTML consistently you could easily end up with different node tree in different browsers.
That's because there's only one (alright, two) browsers.
Combine that with the fact that loops and objects don’t have fantastic support, if any, and it’s no wonder everyone and their mother has tried their hand at a templating framework. (WebComponents exist, but fall into a lot of the same traps; I didn’t like what I saw in the MDN tutorial.)
If you want to build something you build back in the 2000s, its so much easier than it was back then.
Web dev is way easier now, if all you're trying to do is the same stuff we tried to do in the early 2000s. All the stuff that makes it harder is because we can do some much more now.
If you use them, you'll need to show outdated browser warnings for basically all browsers older than September 2022. Your site will be horrifically broken without container query support.
I'm investigating if we want to even do that at my job. That's a pretty steep cost.
This might all be an acceptable trade off depending on one's user base, of course!
They’d also be pretty expensive on the client
<head>
...
<style>
.example {
container-type: inline-size;
}
@container (min-width: 200px) {
h1 {
font-size: 15cqw;
font-family: monospace;
}
}
</style>
</head>
<body>
<div class="example">
<h1>hello world</h1>
</div>
</body> <div class="c-newspaper__item display-flex gap-1rem">
<article class="c-card"></article>
</div>
.display-flex {
display: flex;
}
.gap-1rem {
gap: 1rem;
}That sounds like using a feature for the sake of using a feature. Couldn't the same be done with a class on the container?
That technique of using a style tag to set a CSS var (--horizontal) then using @container tags to shift the UI is really cool.
Also, as someone who learned CSS in the early 2000s, seeing grid layouts with `grid-template-columns:` etc make life so much easier. Web devs have it easier these days.