Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

color-stop not recognized as builtin function #120

Closed
jodal opened this Issue Mar 26, 2013 · 2 comments

Comments

Projects
None yet
4 participants

jodal commented Mar 26, 2013

Given the following SCSS:

@mixin gradient-striped($color: #555, $angle: 45deg) {
  background-color: $color;
  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
  background-image: -webkit-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  background-image: -moz-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  background-image: -o-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  background-image: linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
}
body {
  @include gradient-striped();
}

pyScss v1.1.5 (20130215) prints the following errors because it doesn't know about the builtin color-stop function:

ERROR: Required function not found: color-stop:2 (<string '@mixin gradient-striped($color: #555, $angle: 45de...'>:10)
ERROR: Required function not found: color-stop:2 (<string '@mixin gradient-striped($color: #555, $angle: 45de...'>:10)
ERROR: Required function not found: color-stop:2 (<string '@mixin gradient-striped($color: #555, $angle: 45de...'>:10)
ERROR: Required function not found: color-stop:2 (<string '@mixin gradient-striped($color: #555, $angle: 45de...'>:10)
ERROR: Required function not found: color-stop:2 (<string '@mixin gradient-striped($color: #555, $angle: 45de...'>:10)
ERROR: Required function not found: color-stop:2 (<string '@mixin gradient-striped($color: #555, $angle: 45de...'>:10)
ERROR: Exception raised: 'NumberValue' object is not iterable in `linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent)' (<string '@mixin gradient-striped($color: #555, $angle: 45de...'>:10)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5533, in eval_expr
    results = P.goal(rule)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5288, in goal
    expr_lst = self.expr_lst(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5456, in expr_lst
    expr_slst = self.expr_slst(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5473, in expr_slst
    expr = self.expr(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5294, in expr
    and_test = self.and_test(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5303, in and_test
    not_test = self.not_test(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5314, in not_test
    comparison = self.comparison(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5332, in comparison
    a_expr = self.a_expr(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5363, in a_expr
    m_expr = self.m_expr(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5378, in m_expr
    u_expr = self.u_expr(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5403, in u_expr
    atom = self.atom(R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5428, in atom
    return call(FNCT, v, R)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 5013, in call
    node = fn(*_args, **_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 2594, in _linear_gradient
    _position(position_and_angle) if position_and_angle is not None else None,
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 3586, in _position
    return __position(False, p)
  File "/usr/local/lib/python2.7/dist-packages/scss/__init__.py", line 3555, in __position
    nums = [v for v in p if isinstance(v, NumberValue)]
TypeError: 'NumberValue' object is not iterable

The example mixin is taken from https://github.com/jlong/sass-twitter-bootstrap/blob/master/lib/_mixins.scss#L457

tachang commented Apr 17, 2013

Also running into this issue.

It works with commit cb32682 from git://github.com/eevee/pyScss.git

@eevee eevee closed this Jul 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment