Live data from Hacker News

Old dogs, new CSS tricks

mxb.dev

101–108 of 108 posts

Re: Old dogs, new CSS tricks

#101

Earlier quoted context omitted.

We do have tools for that though, how would a build tool fit into a language specification? Aren't those different concerns?

Dead CSS code should ideally be a warning on the web platform. This should be in the spec. Browser can probably emit a warning in the console log if there are CSS selectors that are not used. Authors can choose to explicitly mark with a `ignore-unused`, delete them or move such selectors to separate style-sheets that are loaded by the pages that actually use them. With HTTP/3 this makes more sense (CSS modularization…

That'd definitely be a useful devtools feature! I don't see why it would need to go through the spec process though, browser vendors could build that independently and get it out much quicker.

Re: Old dogs, new CSS tricks

#102

CSS is becoming too complex. The syntax looks like it wants to be output by some compiler instead of being crafted by hand. Personally I also don't have any pleasure anymore writing CSS these days. Sass and BEM methodology works fantastically well. Naming things isn't that hard, but Tailwind/utility approach is also extremely useful. Those new features, besides container queries is just gibberish. Layer? WTF? The cas…

Is your complaint about the features, or the syntax? I think the syntax is good (getting better with nested selectors)

Who cares when Sass works so well and this is just a subset of what sass does.

Maybe in 10 years time we’ll finally get to what sass can already do today.

Re: Old dogs, new CSS tricks

#103

Earlier quoted context omitted.

Is your complaint about the features, or the syntax? I think the syntax is good (getting better with nested selectors)

Who cares when Sass works so well and this is just a subset of what sass does. Maybe in 10 years time we’ll finally get to what sass can already do today.

The merits and costs of a preprocessor are unrelated to this question.

Re: Old dogs, new CSS tricks

#104
post #14
post #5

Earlier quoted context omitted.

I’m unsure if you have specific feedback or just a general misunderstanding of the point of additions like layer to the spec. At the end of the day these are all more tools in our toolbelt. If you want you can keep writing CSS the same way you always have.

> At the end of the day these are all more tools in our toolbelt. If you want you can keep writing CSS the same way you always have. I don't really stand by GP's comment but I also don't think their concern can be dismissed this easily. We generally write CSS as teams. You'll have to read as much CSS as you'll have to write. Ideally you actually read more than you write so you can reuse existing rules and follow esta…

Good point, I didn't consider this.

I understand that feeling to some degree. At the same time, I think this is just how CSS has always been. Originally we had to style pages with tables and when flexbox/grid came out there were oodles of devs who refused to use them for a while. CSS is an ever-evolving toolset and I like that, but I do understand that change can feel unwarranted to some.

Re: Old dogs, new CSS tricks

#105
post #17

This is a bad article. > And while support for Container Queries is green in all modern browsers, people still seem reluctant to go all-in, fearing they could break something as fundamental as site layout in older browsers. Don't you know there are still a fuck ton of people that are still using the old iOS versions with their old phones? I have plenty of them, and they are long term supporters that I just can't shut…

Bit subjective. I thought it was a great article. Lot's of new properties I've never heard of.

Re: Old dogs, new CSS tricks

#106
post #17

This is a bad article. > And while support for Container Queries is green in all modern browsers, people still seem reluctant to go all-in, fearing they could break something as fundamental as site layout in older browsers. Don't you know there are still a fuck ton of people that are still using the old iOS versions with their old phones? I have plenty of them, and they are long term supporters that I just can't shut…

Bit subjective. I thought it was a great article. Lot's of new properties I've never heard of.

It is not hard to keep track of new css/js features, as the articles pop up very often, e.g: https://developer.chrome.com/blog/whats-new-css-ui-2023

Most of us just decide to ignore them, because a significant portion of our userbase stills stuck with old devices. People who agree with this article probably never get accessed to any website statistic dashboard.

Re: Old dogs, new CSS tricks

#107
post #106

Earlier quoted context omitted.

Bit subjective. I thought it was a great article. Lot's of new properties I've never heard of.

It is not hard to keep track of new css/js features, as the articles pop up very often, e.g: https://developer.chrome.com/blog/whats-new-css-ui-2023 Most of us just decide to ignore them, because a significant portion of our userbase stills stuck with old devices. People who agree with this article probably never get accessed to any website statistic dashboard.

For sure, I understand usage statistics and device targets, etc for your audiences. I don't think it diminishes the informative nature of the article. You can be still be excited about new features even if you can't use them for your particular product/audience/etc.

Re: Old dogs, new CSS tricks

#108

Earlier quoted context omitted.

If you want to use the normal non-& syntax, then you will need to use Safari 17.2, yes. I am referring to the fact that there are no browsers with native CSS nesting that support Windows < 10.

> If you want to use the normal non-& syntax, then you will need to use Safari 17.2, yes. Non-& is not “the normal syntax”. It was a late addition to the specification. Both with and without & are normal, but with & has better compatibility. Even if you don’t use the &, you can still write nested CSS and support older versions of Safari, like I said. Use PostCSS or Lightning CSS. There are normally several areas wher…

I guess we will have to disagree about what is normal or not. Perhaps it depends what tools one was using before going CSS native.

Obviously I'm talking here about direct serving of CSS assets without precompiling.

Post reply on HN