Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

CSS calc() gets confused by inconvertible units #268

Closed samastur closed 10 years ago

samastur commented 10 years ago

CSS' calc() allows mixing units that are not directly convertible so calc(100% - 10px) is valid value.

pyScss fails in such cases with a "can't reconcile unit" ValueError exception. I think the problem really is that it does not distinguish calc() from normal sass number operations and hence does not simply leave it alone.

eevee commented 10 years ago

Yeah, this is #192; needs some clever things done to the parser to treat this specially.

As a workaround, which should be compatible with Ruby Sass as well, you can do this:

unquote("calc(100% - 10px)")
samastur commented 10 years ago

Thanks, but this doesn't work because it still removes spaces around minus. They are optional only around / and *.

eevee commented 10 years ago

What do you mean? It comes out literally for me, as it should.

samastur commented 10 years ago

I think you're right. I'm using pyScss through web assets and it is probably they which strip whitespace out.