-
Notifications
You must be signed in to change notification settings - Fork 707
[css-cascade-6] change lower boundary keyword for @scope to "until" #7943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A comment with the same idea from last September: https://css-tricks.com/early-days-for-css-scoping/#comment-1782132 |
Agenda+ to get group feedback on this. I don't have a strong leaning one way or the other. |
I agree that, intuitively, |
The CSS Working Group just discussed
The full IRC log of that discussion<fremy> miriam: this is a bikeshedding issue open for a while<fremy> miriam: the concern is that "scoped to" usually means "it's inside the scope" <fremy> miriam: so it might be confusing to also use "to" to say that the scope goes "from...to" <fantasai> wfm <fremy> miriam: I have no strong opinion on it <bramus> q+ <fremy> fremy: wfm too <astearns> ack bramus <TabAtkins> q+ <fremy> bramus: no hard feelings, but "to" sounded better to me, because as a non-native English speaker "until" is not very frequent <fremy> bramus: this might also be related to the next issue <astearns> ack TabAtkins <fremy> bramus: if we choose to include the boundaries, "to" might be better <fremy> TabAtkins: there is no clear English word that indicates exclusivity or inclusivity with clarity <fremy> TabAtkins: so I don't think the choice of term is not that important <fremy> TabAtkins: and therefore believe going with the shortest one makes the most sense <astearns> ack fantasai <fremy> fantasai: while I agree with TabAtkins that the inclusivity is not clear in either wording <TabAtkins> "range from 0 to 3" can easily mean [0,1,2,3] or [0,1,2] depending on context. Even sometimes [1,2]. <fremy> fantasai: that said, I can understand the other argument <fremy> fantasai: but maybe we could use something else than a word, like the > sign? <bramus> q+ <TabAtkins> I think we should avoid `>` next to selectors, due its context-specific meaning there. <fremy> fantasai: that would avoid the problems with the choice of an English word <astearns> ack bramus <fremy> bramus: the > sign is also a combinator <fremy> miriam: but scoping extends in the same direction as the combinator <fremy> miriam: so not a problem for me, though I still like "to" a bit better I guess <fantasai> s/other argument/other argument about how "scoped to the X element" means using X as the scoping root/ <fremy> astearns: there doesn't seem to be passionate comments for any of the comments <fremy> astearns: so maybe we should just leave things as they are, for lack of a huge reason to change <bramus> +1 <fremy> astearns: "to" is easier to spell, and not any more precise <fantasai> "thru", to use Tab's spelling :p <fremy> miriam: ok, let's propose to close no change <fremy> astearns: yes, and if someone has a stronger argument or more data etc we could revisit <TabAtkins> The only clear range-based english keywords I've ever really seen were in Lisp's LOOP macro - "0 to " was inclusive, "0 below 3" was exclusive. <fremy> fantasai: like a more compelling rationale or something <fremy> astearns: any objection? <fremy> RESOLVED: close the issue as no-change |
The other option that came up in the discussion was to use some symbol instead of a keyword, e.g. ">":
|
Closing for now - but it can always be re-opened if someone wants to make a stronger case for one of the alternatives. |
The current proposed syntax for
@scope
rules with a lower bound is:A smaller change that was proposed in #6577 but did not get explored further (as far as I know) was using the keyword
until
instead ofto
for an exclusive lower bound. I'd like to request that "until" be considered as a more suitable keyword.The above might require a bit of explanation: when discussing scope in other programming contexts (e.g. JavaScript) the statement "X is scoped to Y" designates Y as the container of X. A rule like
@scope (.x) to (.y)
does not have a similar meaning, despite looking superficially identical.When searching for examples I found this article by Raymond Chen on this exact subject. While his article is about Microsoft, the usage is common across the internet.
There are many more examples on MDN: https://developer.mozilla.org/en-US/search?q=%22scoped%20to%22
I recognize this issue is a bit "bikesheddy" but I think it's a big improvement in readability for what is going to be a high-profile feature.
The text was updated successfully, but these errors were encountered: