Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Sass #85

Closed
xzyfer opened this issue Apr 21, 2016 · 4 comments
Closed

Invalid Sass #85

xzyfer opened this issue Apr 21, 2016 · 4 comments

Comments

@xzyfer
Copy link
Collaborator

xzyfer commented Apr 21, 2016

The following is not valid Sass code

@if not(function-exists(compact)) {
  @function compact($vars...) {
    $list: ();
    @each $var in $vars {
        @if $var {
            $list: append($list, $var, comma);
        }
    }
    @return $list;
  }
}

From:

@if not(function-exists(compact)) {
@function compact($vars...) {
$list: ();
@each $var in $vars {
@if $var {
$list: append($list, $var, comma);
}
}
@return $list;
}
}

This code produces the following error in Sass

Error: Functions may not be defined within control directives or other mixins.
        on line 2 of test.scss
  Use --trace for backtrace.

This previously worked in Node Sass due to a bug in LibSass which has since been fixed. As a result this library no longer compiles.

@dclowd9901
Copy link

+1, got this error when node-sass updated to 3.5 from 3.4.2

xzyfer added a commit to xzyfer/compass-mixins that referenced this issue Apr 23, 2016
This implement of compact is functionally equivalent of the
unofficial native one that has been permanently removed from LibSass.
There is no risk in always using this version. The version of LibSass
that had a `compact` function is extremely difficult to obtain, and
is long unsupported.

More importantly defining function inside control structures is not
valid in Sass and produces errors for people using this library.

Fixes Igosuki#84
Fixes Igosuki#85
@xzyfer
Copy link
Collaborator Author

xzyfer commented Apr 23, 2016

Fix PR'd in #86

xzyfer added a commit to xzyfer/compass-mixins that referenced this issue May 4, 2016
This implement of compact is functionally equivalent of the
unofficial native one that has been permanently removed from LibSass.
There is no risk in always using this version. The version of LibSass
that had a `compact` function is extremely difficult to obtain, and
is long unsupported.

More importantly defining function inside control structures is not
valid in Sass and produces errors for people using this library.

Fixes Igosuki#84
Fixes Igosuki#85
xzyfer added a commit to xzyfer/compass-mixins that referenced this issue May 4, 2016
This implement of compact is functionally equivalent of the
unofficial native one that has been permanently removed from LibSass.
There is no risk in always using this version. The version of LibSass
that had a `compact` function is extremely difficult to obtain, and
is long unsupported.

More importantly defining function inside control structures is not
valid in Sass and produces errors for people using this library.

Fixes Igosuki#84
Fixes Igosuki#85
@xzyfer
Copy link
Collaborator Author

xzyfer commented May 14, 2016

Hello everyone, I've gotten in contact with @Igosuki and I'll now be helping out maintaining this project. This should prevent further breakages.

@xzyfer
Copy link
Collaborator Author

xzyfer commented May 14, 2016

compass-mixins@0.12.8 has been released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants