summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2013-08-21 17:53:19 -0700
committerEevee (Alex Munroe) <eevee.git@veekun.com>2013-08-21 17:53:19 -0700
commit96c7ad1c11e4312cd55a11688500efc8d194acc2 (patch)
tree1c71795ab98aa6e5e9b60158d76341cf675b9d7b
parent41fdc80a3d4867c03db10794f0d24e95acc8faa3 (diff)
downloadpyscss-96c7ad1c11e4312cd55a11688500efc8d194acc2.tar.gz
Fix linear-gradient, yet again.
-rw-r--r--scss/functions/compass/gradients.py4
-rw-r--r--scss/tests/files/kronuz/linear-gradient.css5
-rw-r--r--scss/types.py9
3 files changed, 11 insertions, 7 deletions
diff --git a/scss/functions/compass/gradients.py b/scss/functions/compass/gradients.py
index d7678b2..2a5cd32 100644
--- a/scss/functions/compass/gradients.py
+++ b/scss/functions/compass/gradients.py
@@ -178,7 +178,7 @@ def _get_gradient_position_and_angle(args):
'top', 'bottom',
'left', 'right',
):
- if seek in _arg:
+ if String(seek) in _arg:
return arg
return None
@@ -282,7 +282,7 @@ def linear_gradient(*args):
args = [
position(position_and_angle) if position_and_angle is not None else None,
]
- args.extend('%s %s' % (c, to_str(s)) for s, c in color_stops)
+ args.extend('%s %s' % (c.render(), s.render()) for s, c in color_stops)
to__s = 'linear-gradient(' + ', '.join(to_str(a) for a in args or [] if a is not None) + ')'
ret = String.unquoted(to__s)
diff --git a/scss/tests/files/kronuz/linear-gradient.css b/scss/tests/files/kronuz/linear-gradient.css
index f940354..bfed43f 100644
--- a/scss/tests/files/kronuz/linear-gradient.css
+++ b/scss/tests/files/kronuz/linear-gradient.css
@@ -1,3 +1,4 @@
div {
- background: linear-gradient(top, #4d4d4d 0%,#3f3f3f 50%,#333333 50%,#252525 100%);
-} \ No newline at end of file
+ background: linear-gradient(top, #4d4d4d 0%, #3f3f3f 50%, #333333 50%, #252525
+ 100%);
+}
diff --git a/scss/types.py b/scss/types.py
index 29b512d..a293d49 100644
--- a/scss/types.py
+++ b/scss/types.py
@@ -33,9 +33,6 @@ class Value(object):
# Py 2's name for __bool__
return self.__bool__()
- ### NOTE: From here on down, the operators are exposed to Sass code and
- ### thus should ONLY return Sass types
-
# All Sass scalars also act like one-element spaced lists
use_comma = False
@@ -51,6 +48,12 @@ class Value(object):
return self
+ def __contains__(self, item):
+ return self == item
+
+ ### NOTE: From here on down, the operators are exposed to Sass code and
+ ### thus should ONLY return Sass types
+
# Reasonable default for equality
def __eq__(self, other):
return Boolean(