-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Function variables are changed when using numbers and underscores together #2462
Comments
Confirmed.
|
I think it is a difficult one - if keywords began with numbers then we cannot read
I think What do you think @seven-phases-max |
I think it's #2485, i.e. just missing Though now I can see the same issue applies to values like P.S. Doh! And then obviously the same applies to values like |
I'm in favour of saying its not a bug and adding a check whitespace function to the parser so it throws an error (perhaps mentioning, should this be a string?) |
You could always just have the parser accept only those strings that are defined as actual unit identifiers in the official CSS3 Values and Units Module, as literal dimensions. Those are the only units that have sane defined behavior in CSS anyway. And if a user really, really wants a 'custom unit' ... well; there's the Make this part of |
I still can't see why |
Hmm, curiously they actually directly allow this (not counting there's no such units currently): So purely nominally |
Not that curious, actually. An |
Underscores in property, class, keyword etc. etc. names are expected since those are identifiers... Units (e.g. |
The spec is actually surprisingly permissive for the purpose of consistency. So yes, a unit can be pretty much any identifier, for the reason that the parsing does not change as units are added. I don't think it's so much about being permissive to IE. CSS gives specific instructions on how things are to be parsed, so I think they considered that in forming the grammar. |
So just formally, despite of the original example, the following minimal example: @type: 5_large;
foo {
bar: @type; // -> now `5 _large` but should be `5_large`
} is about to be fixed even if we know for sure there's no such unit... is it? |
Fixed by #2485 |
Thanks for this! Seems to fix the issue! |
When placing numbers before underscores in function variables, these seem to be changed to include a space character between the two.
Take the following less snippet:
The output is as follows, notice the space between 5 and the underscore:
The text was updated successfully, but these errors were encountered: