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

var-statements inside calc(..) fail #57

Closed
lglowania opened this issue Feb 27, 2020 · 7 comments
Closed

var-statements inside calc(..) fail #57

lglowania opened this issue Feb 27, 2020 · 7 comments
Assignees
Labels

Comments

@lglowania
Copy link

Failing line is:

left: calc(50% - (600px / 2 + var(--page-column-padding-x)));
@phax phax self-assigned this Feb 27, 2020
@phax
Copy link
Owner

phax commented Feb 27, 2020

@lglowania I could successfully parse it with version 6.2.0.
What version are you using?

phax added a commit that referenced this issue Feb 27, 2020
@lglowania
Copy link
Author

I was using 6.1 which aborted parsing. I upgraded to 6.2 which tolerates such a statement, but it seems to just skip until closing brace:

05:46:38.031 [main] WARN  c.h.c.r.e.LoggingCSSParseErrorHandler:131 - [1076:31]-[1085:1] Encountered text '* var(' corresponding to token <FUNCTION>. Skipped until token }. Was expecting one of: <S>, ")", <S>

@lglowania
Copy link
Author

This is the full css-block:

.pageColumn > .center:before{
	content: '';
	position: absolute;
	left: calc(50% - (600px / 2 + var(--page-column-padding-x)));
	width: calc(600px + 2 * var(--page-column-padding-x));
	/* if inside a small contaier e.g. a card, do not exceed width */
	max-width: 100%;
	background: white;
	top: 0;
	min-height: 100%;
	flex: 1;
	bottom: 0px;
	z-index: 0;
}

@phax phax added bug and removed can't reproduce labels Feb 28, 2020
@phax
Copy link
Owner

phax commented Feb 28, 2020

It's a operator precendence issue... weird

@phax
Copy link
Owner

phax commented Feb 29, 2020

The problem was caused by supporting an old IE6 hack that allowed for * to be used as a prefix for function names (as in *var). By removing the possibility for this hack, it parses correctly

phax added a commit that referenced this issue Feb 29, 2020
@lglowania
Copy link
Author

Great! Thank you 👍

@phax
Copy link
Owner

phax commented Feb 29, 2020

Part of 6.2.1 release

@phax phax closed this as completed Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants