summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2014-12-09 15:13:01 -0800
committerEevee (Alex Munroe) <eevee.git@veekun.com>2014-12-09 15:14:47 -0800
commita5b270bb8885925ad0758489e2b80ee76e7bd302 (patch)
treeb8564c0032adfb1e458725e600fa80ec735ca972
parent604ad49bc14de31a4e39c64c58b1cb04bf43f8ee (diff)
downloadpyscss-a5b270bb8885925ad0758489e2b80ee76e7bd302.tar.gz
Fix the fallback behavior of / and - on non-strings.
The default is to treat these like a single unit, so "a" - "b" produces "a"-"b". The code was neglecting to use String.unquoted, so the resulting string would have even more quotes around it, which was... incorrect. This mostly had an effect on using CSS syntax like top/1px inside a variable, where division is evaluated. The result was quoted, which changed the semantics.
-rw-r--r--scss/types.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scss/types.py b/scss/types.py
index 54345da..b844c92 100644
--- a/scss/types.py
+++ b/scss/types.py
@@ -87,10 +87,10 @@ class Value(object):
def __sub__(self, other):
# Default behavior is to treat the whole expression like one string
- return String(self.render() + "-" + other.render())
+ return String.unquoted(self.render() + "-" + other.render())
def __div__(self, other):
- return String(self.render() + "/" + other.render())
+ return String.unquoted(self.render() + "/" + other.render())
# Sass types have no notion of floor vs true division
def __truediv__(self, other):