NV / CSSOM

Unmaintained! ⚠️ CSS Object Model implemented in pure JavaScript. Also, a CSS parser.
https://nv.github.io/CSSOM/docs/parse.html
MIT License
751 stars 99 forks source link

should not remove spaces in calc() function #86

Closed jonkemp closed 7 years ago

jonkemp commented 7 years ago

Spaces are mandatory inside CSS calc() function, and should not be removed in inlining.

.foo {
  width: calc(100% - 80px);
}

gets parsed to this

.foo {width: calc(100%-80px);}

and that doesn't work in the browser.

linear-gradient also has the same issue.

linear-gradient(135deg, #00689b 0%, #00375a 90%, #00375a 90%, #003455 100%);

gets parsed to this

linear-gradient(135deg, #00689b0%, #00375a90%, #00375a90%, #003455100%);

NV commented 7 years ago

@jonkemp please verify if the issue is resolved now.

jonkemp commented 7 years ago

How do I verify this?

NV commented 7 years ago

http://nv.github.io/CSSOM/docs/parse.html#css=.foo%20%7B%0A%20%20width%3A%20calc(100%25%20-%2080px)%3B%0A%7D

jonkemp commented 7 years ago

Yeah looks good.