News for hackers. Stuff that matters.
Re:Help pick a syntax for CSS nesting by lovasoa on Wednesday July 27, 2022 @06:25AM (#32248748)
So now we discuss web standards on chrome.com ? This looks like the beginning of the end of a free web governed standards established by an independent body. I would have expected such an article to be published on w3.org...
Re:Help pick a syntax for CSS nesting by rachelandrew on Wednesday July 27, 2022 @07:21AM (#32249142)
Things don't get a lot of eyeballs on them on w3.org which defeats the object of the post which is to get developer feedback. It's pretty normal for CSSWG members to ask for opinions via tweets, on their own blogs, or in other places. I've posted stuff to my personal blog in the past. This is something that will be worked on in the CSS Working Group, it happens to have people from Chrome working on it, however it will be discussed with the rest of the CSSWG who have a range of affiliations: https://www.w3.org/Style/CSS/members.en.php3
Re:Help pick a syntax for CSS nesting by lovasoa on Wednesday July 27, 2022 @10:43AM (#32250989)
The request for feedback could have been discussed at w3, and google could still have made a blog post about it saying something like "this is what we have been discussing at w3 so far, your feedback is welcome on w3.org"...

The post is on chrome.com and mentions the decision makers as "we".

Re:Help pick a syntax for CSS nesting by clairity on Wednesday July 27, 2022 @01:54PM (#32253933)
nesting will be nice when it lands, but i'm most excited by far for :has() support. i know chrome and safari have initial implementations in place and firefox just recently started. :has() will be the biggest advancement in css since grid, moreso than nesting or container queries, because of the power it puts in the stylists' hands. unfortunately trying to track its progress is a haphazard gander into an opaque maze of different sites and bug trackers.
Re:Help pick a syntax for CSS nesting by tannhaeuser on Wednesday July 27, 2022 @07:04AM (#32249003)
It also looks like asking the general public for a go to make CSS even more complicated, when we all know it's a one-way ticket to Chrome dominance, ie a rhetoric dictators have been using. Note the absence of the option to "do nothing" and keep good-damn CSS as it is already after 25+ years of tinkering that haven't solved its problems.

I mean even one of the long-term editors of the CSS spec has raised hands and warned against including ever more inessential and author-oriented features [1]. That was almost 14 years ago.

[1]: https://www.w3.org/People/Bos/CSS-variables

Re:Help pick a syntax for CSS nesting by tambourine_man on Wednesday July 27, 2022 @09:24AM (#32250096)
CSS has evolved tremendously. Variables are amazing, so is flex and grid.

Nesting is way overdue. But of course we shouldn’t be discussing it at Google’s site.

Re:Help pick a syntax for CSS nesting by account42 on Wednesday July 27, 2022 @10:28AM (#32250794)
Variables (since they are not just constants), flex and grid all allow doing things that were previously not possible or at least not reasonably. Nesting is a pure syntax change that is already solved via a preprocessing step. So yes, we should weight what this adds in convenience vs. the cost of the adding this to all browsers, maintaining support for it forwever, the impact it has on future additions as well as new websites using this not working on older browsers. Note the should - I'm perfectly aware that the web dev ecosystem already often ignores many of these.
Re:Help pick a syntax for CSS nesting by tambourine_man on Wednesday July 27, 2022 @02:09PM (#32254191)
We kind of had variables with preprocessing before. Or a simple sed ‘s/str/replace’.

But true support is convenient. One of the best places to write CSS is the browser’s dev tools. Having CSS variables work there is awesome.

If it can be parsed almost as fast, I say go for it.

Re:Help pick a syntax for CSS nesting by account42 on Thursday July 28, 2022 @03:04AM (#32261285)
Those are constants. CSS variables are more powerful than that since they can be changed at runtime which allows e.g. minesweeper in pure HTML and CSS: https://github.com/propjockey/css-sweeper
Re:Help pick a syntax for CSS nesting by dmitriid on Wednesday July 27, 2022 @12:32PM (#32252618)
Scoping and nesting are two things that would solve 99% of problems when it comes to organising CSS (and components). They should definitely be on the browser level and not "solved by preprocessors".
Re:Help pick a syntax for CSS nesting by tannhaeuser on Wednesday July 27, 2022 @01:07PM (#32253141)
I disagree. Given the enormous complexity browsers have aggregated already, we should strive to make browsers "player apps" (like MP3 players): a relatively simple front end with huge versatility in server apps and back ends, rather than, like, everything for everybody. I'm aware that ship has sailed a long time ago, but piling ever more not-so-well-motivated stuff onto browsers just means the next generation has to start over with a clean slate; actually I think this is inevitable already.

CSS nesting is clearly serving the use case of components in web apps, as opposed to mere content-driven web sites. IMO a sensible approach would be to give web app developers powerful ways to tie into rendering and layout programmatically (a la Houdini API) when those apps will require JavaScript, and in many cases use CSS-in-JS anyway, rather than burden browser cores with ever more questionable CSS features.

"Would solve 99% of use cases" also sounds like famous last words ;)

Re:Help pick a syntax for CSS nesting by dmitriid on Wednesday July 27, 2022 @05:19PM (#32257122)
> a relatively simple front end with huge versatility in server apps and back ends

Define "relatively simple"?

Nesting and scoping in CSS don't make frontend any more complex. CSS has had problems with it's flat top-level structure since the very beginning of its existence. Approaches like BEM didn't appear out of thin air.

> CSS nesting is clearly serving the use case of components in web apps, as opposed to mere content-driven web sites.

Even a content-driven web site has a plethora of repeating and/or complex elements that are a pain to define and maintain.

> Would solve 99% of use cases" also sounds like famous last words

Google has poured hundreds of millions of dollars into web components whose primary use case (that is, what they are being used for in reality) could've been solved by scoping and nesting.

Same goes for all the CSS-in-JS abominations.

Re:Help pick a syntax for CSS nesting by tambourine_man on Wednesday July 27, 2022 @02:12PM (#32254244)
AFAIK, this is just syntactic sugar. A shortcut.

It’s not scoping in the inheritance sense. The C in CSS is for cascading. Inheriting is the natural way to be for CSS

Re:Help pick a syntax for CSS nesting by dmitriid on Wednesday July 27, 2022 @05:15PM (#32257084)
Casacading !== inheritance. These are very different things. I wish we had inheritance (or traits) in CSS.
Re:Help pick a syntax for CSS nesting by tambourine_man on Thursday July 28, 2022 @08:18AM (#32263301)
Well tell me the difference then. We have cascading inheritance, that’s what CSS is all about.

Unless we’re using different definitions of the term

Re:Help pick a syntax for CSS nesting by dmitriid on Thursday July 28, 2022 @09:04AM (#32263727)
Casacading alpplies to all elements in the cascade. Whether you want it or not.

At the same time it's impossible to say "hey, I want to inherit from that particular style", and not have the cascade apply to it. For example, I want a button and I don't want anything in the hierarchy above overriding its borders, or colors, or fonts, or...

Re:Help pick a syntax for CSS nesting by tambourine_man on Thursday July 28, 2022 @11:06AM (#32265353)
Oh, I see. Arbitrary non hierarchical opt-in inheritance. Or perhaps a cascading inheritance opt-out, and you could add classes back as you please. That would be cool.

Not sure how it would impact browser parsing and drawing, but it sure would be useful.

Re:Help pick a syntax for CSS nesting by LocalPCGuy on Wednesday July 27, 2022 @11:21AM (#32251559)
I agree it shouldn't be on chrome's website, but nesting in native CSS is a very welcome and needed change, and one of the last things I consistently reach for SCSS for. It's been requested for years.

It does have the ability to be a foot-shotgun, but so do 3/4s of the features in CSS if you don't understand them. And people that want it would probably just do the same thing in SCSS anyways.

Re:Help pick a syntax for CSS nesting by mgdlbp on Wednesday July 27, 2022 @10:37AM (#32250898)
> asking the general public ... when we all know it's a one-way ticket ... a rhetoric dictators have been using. Note the absence of the option to "do nothing"

regrettably reminiscent of the Wikimedia Foundation

Re:Help pick a syntax for CSS nesting by aasasd on Wednesday July 27, 2022 @07:33AM (#32249233)
> That was almost 14 years ago.

Now that's a page that can be dated by its look.

Re:Help pick a syntax for CSS nesting by noSyncCloud on Wednesday July 27, 2022 @09:37AM (#32250238)
>The distribution is as you might expect, lots of very small files, very few large files:

> - Half the files is less then 7 lines. > - 90% is less than 163 lines. > - Only 0.6% is longer than 500 lines.

This part jumped out at me. Those were the days...

Re:Help pick a syntax for CSS nesting by geraldyo on Wednesday July 27, 2022 @09:26AM (#32250123)
"it hasn't been done before, so it can't be done now". 25 years ago isn't 14 years ago isn't now...
Re:Help pick a syntax for CSS nesting by jaywalk on Wednesday July 27, 2022 @11:20AM (#32251537)
Nobody's saying it can't be done. They're simply questioning whether it should be done, since we have tools that solve this problem already. It's not giving us anything we don't already have, and so the value proposition in making the syntax more complex is pretty shaky.
Re:Help pick a syntax for CSS nesting by jakelazaroff on Wednesday July 27, 2022 @11:33AM (#32251731)
Why should the tool be necessary? I'd much rather write plain CSS than use Sass, and nesting makes that significantly more readable and easier to maintain.
Re:Help pick a syntax for CSS nesting by jaywalk on Wednesday July 27, 2022 @12:36PM (#32252684)
Whether the tool should or should not be necessary is an entirely different question. The reason it is necessary is because it enabled writing "CSS" in a way that it was never meant to be written. And as evidenced by the blog post and all of the discussion here, adding the functionality to browsers isn't at all straightforward.

So a better question is why shouldn't the tool be necessary? It's all about writing the same CSS in a more developer-friendly way, not enabling CSS to do something it never could before (like variables and flex did). Why should browsers have to worry about this added complexity? Just write your stylesheets however you'd like, and then run a tool to compile them down to standard CSS.

Re:Help pick a syntax for CSS nesting by FinalBriefing on Wednesday July 27, 2022 @01:36PM (#32253629)
When I look at these proposals, I would still prefer using Sass over regular CSS. It's syntax is just cleaner.
Re:Help pick a syntax for CSS nesting by apatheticonion on Wednesday July 27, 2022 @07:37AM (#32249252)
I too am salty about this, but the W3C uses IRC for discussions and have no easy forum or boards for RFCs (like TC39 with their use of GitHub for ECMAScript proposals).

Contributing to web standards is not really accessible and that contributes to this Chromium-centric world.

Re:Help pick a syntax for CSS nesting by rachelandrew on Wednesday July 27, 2022 @07:47AM (#32249329)
The CSS Working Group uses GitHub primarily, and any minutes from IRC are added to the issue. Here: https://github.com/w3c/csswg-drafts/issues

You are very welcome to contribute!

Re:Help pick a syntax for CSS nesting by seba_dos1 on Wednesday July 27, 2022 @11:26AM (#32251607)
What kind of chat would be more accessible than IRC?
Re:Help pick a syntax for CSS nesting by frosted-flakes on Wednesday July 27, 2022 @12:11PM (#32252331)
What kind of chat wouldn't be more accessible than IRC?
Re:Help pick a syntax for CSS nesting by greggman3 on Wednesday July 27, 2022 @01:43PM (#32253755)
> Contributing to web standards is not really accessible

How so? AFAICT if you want to contribute just go contribute. It's open to all. Discussions are had on public mailing lists, github, etc...

Here's one place to start

https://github.com/w3c

Re:Help pick a syntax for CSS nesting by apatheticonion on Thursday August 04, 2022 @08:04PM (#32349897)
Where would one raise a proposal for something like adding a `sandbox` flag to `<script>` elements, the proposal of adding a feature like a "Context Menu API" for PWAs or discussions around pro-privacy features?
Re:Help pick a syntax for CSS nesting by the42thdoctor on Wednesday July 27, 2022 @07:45AM (#32249305)
Hey, I am just happy that survey is not on Google Forms requiring a G account.
Re:Help pick a syntax for CSS nesting by aasasd on Wednesday July 27, 2022 @07:30AM (#32249211)
Afaik browser devs are dictating the standard for many years already.

Also, the post ackshually refers to a W3C draft at https://www.w3.org/TR/css-nesting-1/

Re:Help pick a syntax for CSS nesting by mattgperry on Wednesday July 27, 2022 @06:37AM (#32248818)
Why didn't they publish one then?
Re:Help pick a syntax for CSS nesting by dmitriid on Wednesday July 27, 2022 @08:12AM (#32249510)
> This looks like the beginning of the end of a free web governed standards established by an independent body.

The end sailed us by a few years ago.

Chrome now dominates all standards bodies and pushes quite a few of its proposals forwards with utter disregard for anyone.

Re:Help pick a syntax for CSS nesting by oefrha on Wednesday July 27, 2022 @07:01AM (#32248977)
Any person can publish a blog post discussing web standards on the “free web”. You’re welcome to publish one yourself.
Re:Help pick a syntax for CSS nesting by echelon on Wednesday July 27, 2022 @07:30AM (#32249210)
Too many Google engineers working on this to keep up.