From 96c7ad1c11e4312cd55a11688500efc8d194acc2 Mon Sep 17 00:00:00 2001 From: "Eevee (Alex Munroe)" Date: Wed, 21 Aug 2013 17:53:19 -0700 Subject: Fix linear-gradient, yet again. --- scss/functions/compass/gradients.py | 4 ++-- scss/tests/files/kronuz/linear-gradient.css | 5 +++-- scss/types.py | 9 ++++++--- 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( -- cgit v1.2.1