Skip to content
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

[css-syntax-3] - !important diagram forgot to allow whitespaces before "!" #6335

Open
the-Arioch opened this issue Jun 1, 2021 · 4 comments

Comments

@the-Arioch
Copy link

the-Arioch commented Jun 1, 2021

https://www.w3.org/TR/css-syntax-3/#parser-diagrams

Chapter 5.1 - "!important" railroad diagram picture claims there can be no whitespace between property value and "!" character.

But there obviously can be, and actually there almost always exists at least one space.

It would be less counter-intuitive if "ws*" had been omitted all the way around values, including between "!" and "important".
But since "ws*" was inserted in some places but not another - it creates an impression that those places are intentionally different.

@Loirooriol
Copy link
Contributor

But the Component value before !important repeats itself. And a component value can be a preserved token like a a <whitespace-token>.

The ws* between <ident-token> and : can't be omitted since the explanation above doesn't apply, and it's possible to have whitespace there.

@the-Arioch
Copy link
Author

the-Arioch commented Jun 1, 2021

Even then, the present page shows that for values other than preserved tokens there is can be no whitespace.

More so the value as properties rules are drawn now can be bypassed altogether, so there would be totally nothing between ":" and "!", not a byte.

Since the "!important" schematics picture already includes "ws*" in all other places but the start, it would be better to make it uniform and to add leading "ws*" too.

The ws* between and : can't be omitted

Well, actually "ommited" whitespace still is valid "ws*" block - that is what asterisk means: "zero or any positive number of".

@Loirooriol
Copy link
Contributor

Even then, the present page shows that for values other than preserved tokens there is can be no whitespace

What's the problem? Is there any place not using ws* or a superset, but which needs to allow whitespace?

so there would be totally nothing between ":" and "!", not a byte.

Yeah, that seems a valid declaration, though then the grammar of most CSS properties will reject that. But --foo:!important should be valid if I understand #774 correctly.

asterisk means: "zero or any positive number of".

I mean that ws* can't be removed from the diagram. When writing CSS you may then use 0 or more spaces.

@the-Arioch
Copy link
Author

The situation is not that "zero whitespaces is valid too", the situation is, that schematics suggestes "only zero whitespaces is valid"

That is why "!important" picture better be made uniform and include "ws*" blocks in the beginning too, like it already does in other places. Or, alternatively, totally remove "ws*" form that picture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants