W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2018

Re: [csswg-drafts] [css-shadow-parts] decide on forwarding micro-syntax for partmap

From: fergald via GitHub <sysbot+gh@w3.org>
Date: Tue, 27 Mar 2018 00:28:09 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-376355487-1522110488-sysbot+gh@w3.org>
> If the arrow doesn't tell you the ordering, what the heck is the point of having the arrow at all?

There's 2 thing heres, a visual separator and the ordering.

Ordering first. The spec talks about the part map. Developers will have this map as a their mental model but in the current spec, have "a => b" meaning partmap["b"] = "a". This tripped me up first time I tried I tried to produce an example and I suspect it trips others up, it's basically "value => key". I would argue we should have "key => value" 

The second thing is whether it should be "key => value" or just "key value" or "key value value value" (I don't care about "=>" vs ":" but I'm going to stick with "=>" for examples). I'd argue that from a developer ergonomics POV, "key value1 value2 value2" is bad. It looks like a uniform list of tokens, there's is nothing to distinguish key from values. It's unclear that "a b" is different from "b a" and (if we allow it) that "a b c" and "b a c" have completely different meanings but that "a c b" and "a b c" are identical. "a => b c" makes it very clear that "a" is the key and "b" and "c" are a set of values.

So the question is not whether there is a parsing cost but whether it is worth the ergonomic benefit. If we used "a: b c" (so single-char instead of multi-char) it's hard to imagine that the parsing difference is going to be significant. Would it be crazy to make the : optional for those who want it?

GitHub Notification of comment by fergald
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2411#issuecomment-376355487 using your GitHub account
Received on Tuesday, 27 March 2018 00:28:18 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:26 UTC