Kronuz / pyScss

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

Unable to compile Zurb Founcation 5.2.3 #281

Closed PhilipGarnero closed 9 years ago

PhilipGarnero commented 10 years ago

Hello there !

I've tried using your module with django-pipeline in order to compile my assets. The problem is that it can't compile foundation which is essential for me. Firstly because of this : #260 and know I get a compiler error. Here's the traceback I get :

  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 438, in compile
    return self.Compilation(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 396, in Compilation
    self.parse_children()
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 489, in parse_children
    self.manage_children(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 548, in _manage_children_impl
    self._do_import(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 908, in _do_import
    self.manage_children(_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 548, in _manage_children_impl
    self._do_import(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 908, in _do_import
    self.manage_children(_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 561, in _manage_children_impl
    self._do_include(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 832, in _do_include
    self.manage_children(_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 565, in _manage_children_impl
    self._do_if(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 1042, in _do_if
    self.manage_children(inner_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 546, in _manage_children_impl
    self._do_content(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 842, in _do_content
    self.manage_children(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 565, in _manage_children_impl
    self._do_if(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 1042, in _do_if
    self.manage_children(inner_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 579, in _manage_children_impl
    self._nest_at_rules(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 1274, in _nest_at_rules
    self.manage_children(new_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 596, in _manage_children_impl
    self._nest_rules(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 1310, in _nest_rules
    self.manage_children(new_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 596, in _manage_children_impl
    self._nest_rules(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 1310, in _nest_rules
    self.manage_children(new_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 579, in _manage_children_impl
    self._nest_at_rules(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 1274, in _nest_at_rules
    self.manage_children(new_rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 505, in manage_children
    raise SassError(e, rule=rule)
scss.errors.SassError: Error parsing block:

507& > a {
508padding-#{$opposite-direction}: $topbar-link-padding + 20 !important;
509&:after {
510@include css-triangle($topbar-dropdown-toggle-size, rgba($topbar-dropdown-toggle-color, $topbar-dropdown-toggle-alpha), top);
511margin-top: -($topbar-dropdown-toggle-size / 2);
512top: $topbar-height / 2;
513}
514}
516

From /home/garner_p/Workplace/django-sites/base/base/uistatic/styles/scss/foundation/_functions.scss:505
...imported from /home/garner_p/Workplace/django-sites/base/base/uistatic/styles/scss/foundation/components/_top-bar.scss:8
...imported from /home/garner_p/Workplace/django-sites/base/base/uistatic/styles/scss/foundation.scss:2
...imported from app.scss:0
Traceback:
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 498, in manage_children
    self._manage_children_impl(rule, scope)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 596, in _manage_children_impl
    self._nest_rules(rule, scope, block)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/util.py", line 111, in wrapper
    return func(*args, **kwargs)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/__init__.py", line 1291, in _nest_rules
    new_ancestry = rule.ancestry.with_nested_selectors(c_selectors)
  File "/home/garner_p/Workplace/django-sites/base/base/.venv/local/lib/python2.7/site-packages/scss/rule.py", line 359, in with_nested_selectors
    raise ValueError("Can't use parent selector '&' in top-level rules")
ValueError: Can't use parent selector '&' in top-level rules

Thanks anyways for your efforts !

allofthesepeople commented 10 years ago

Came across similar. In my case it was due to the zurb code mixing px & rem values, was able to pix by wrapping px value in the rem-calc() function.

In this case, you might want to check the value of $topbar-height.

PhilipGarnero commented 9 years ago

Foundation can now compile without any errors except for #335.