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

Calc: The + and - operators must always be surrounded by whitespace #71

Closed
yoavf opened this issue May 16, 2016 · 0 comments
Closed

Calc: The + and - operators must always be surrounded by whitespace #71

yoavf opened this issue May 16, 2016 · 0 comments
Labels

Comments

@yoavf
Copy link

yoavf commented May 16, 2016

Currently, rtlcss will convert background-position: calc(100% - 10px) center; to background-position: calc(100%-(100% - 10px)) center; which is mostly correct, except for the missing whitespace around the added -.

With Chrome 52, this cause misalignment. Manually adding the whitespace fixes the visual problem.

From mdn:

The + and - operators must always be surrounded by whitespace. The operand of calc(50% -8px) for instance will be parsed as a percentage followed by a negative length, an invalid expression, while the operand of calc(50% - 8px) is a percentage followed by a minus sign and a length. Even further, calc(8px + -50%) is treated as a length followed by a plus sign and a negative percentage.
The * and / operators do not require whitespace, but adding it for consistency is allowed, and recommended.

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