-
Notifications
You must be signed in to change notification settings - Fork 464
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
Incorrectly allowing functions to be defined in control directives or mixins #1550
Comments
Other notable cases where we should, but don't throw this error. @mixin foo() {
@function foo() {
@return 'foo';
}
} $i: 1;
@while $i == 1 {
@function foo() {
@return 'foo';
}
$i: $i + 1;
} @each $i in (1) {
@function foo() {
@return 'foo';
}
} @for $i from 1 through 2 {
@function foo() {
@return 'foo';
}
} |
Nice enhancement :) Closures, anyone? |
I like it, but it's not Sass :( |
Turns out this also affects mixins @mixin foo() {
@mixin bar() {
@return 'foo';
}
} |
Let's open an enhancement proposal :) |
Just ran into this with Igosuki/compass-mixins#34 / Igosuki/compass-mixins#67. It's trying to define Currently (as of b2a3d98) function definition is scoped to the control block, breaking this usage ( Current work-around is to just remove the if statement (since in my codebase I know we need it). Any suggestions on what compass-mixins can do, though? Maybe a function-if-not-exists directive? |
This PR activates specs for sass/libsass#1550
Originally reported on Twitter - https://twitter.com/kaelig/status/643584415789154304
Functions may not be defined within control directives or mixins but LibSass allows it i.e.
Should produce the following error but does not
The text was updated successfully, but these errors were encountered: