Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Brackets are removed within CSS calc statements #313

Open
CedricReichenbach opened this issue Aug 7, 2017 · 2 comments
Open

Brackets are removed within CSS calc statements #313

CedricReichenbach opened this issue Aug 7, 2017 · 2 comments

Comments

@CedricReichenbach
Copy link

Brackets within calc() statements in CSS should not be touched by the compiler, but are currently removed.

Example source code:

.foo {
  width: calc(2 * (3px + 4px));
}

Expected output:

.foo {
  width: calc(2 * (3px + 4px)); /* -> 14px */
}

Actual output:

.foo {
  width: calc(2 * 3px + 4px); /* -> 10px */
}

This is especially painful because it leads to subtle, hard to detect errors in layouts.

@saivan
Copy link

saivan commented Sep 21, 2017

I'm having the same problem, this behaviour isn't sensible.

@daPhantom
Copy link

daPhantom commented Oct 4, 2017

Can confirm this.

This

.logo {
    margin-left: calc(((100vw - 104px) / 2) - 40px);
}

results in this broken CSS snippet within the compiled CSS

.logo {
    margin-left: calc(100vw - 104px/ 2- 40px);
}

Please fix this behavior since it is really misleading when working with SASS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants