-
Notifications
You must be signed in to change notification settings - Fork 23
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
Incorrect parsing of calc operations without spaces in parentheses #86
Comments
We have just released a new tokenizer which should not have this issue : https://www.npmjs.com/package/@csstools/css-tokenizer example : https://runkit.com/romainmenke/calc-1-1-with-css-tokenizer |
FWIW I don't think the issue is that there are no spaces. I think the issue here is that |
Most browsers now support calc-style syntax in |
Adding a bit more info. The division operator But in Just pointing it out because |
I've just found a new instance of this: @TrySound Can you clarify whether this package is still being maintained? I note that there are no commits or releases in the past two years. |
When a multiplication operation exists within parentheses in a
calc()
expression and it doesn't have spaces around the*
(which it probably won't if the CSS has been minified),postcss-value-parser
parses the*
as though it's part of a word token with any adjacent numbers. Here's the simplest reproduction:(Live on RunKit)
This returns two nested
function
nodes which ultimately contain a singleword
node withvalue: "1*1"
. Since1*1
parses correctly at the root of thecalc()
expression, I'm guessing that the parser is forgetting that it's in acalc()
context upon descending into the parentheses... although it seems like even outside that context1*1
should parse as separate tokens, according to the CSS tokenizer algorithms.The text was updated successfully, but these errors were encountered: