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

SASS error when less than 5 params passed #7

Closed
grahambates opened this Issue May 1, 2012 · 0 comments

Comments

Projects
None yet
2 participants

Getting the following error when compiling SASS:

(Line 52 of mysite/sass/partials/_jquery.textshadow.scss: List index is 5 but list is only 4 items long for `nth')

Although the code checks the list's length first it seems that SASS is evaluating all parts of the 'if' statement even if the first evaluation is false. I'm not sure if this is intended behaviour for SASS as it seems unusual, but I'm using the latest version.

    @if $length == 5 and type-of(nth($shadow, 5)) == color {

Splitting this into two statements fixes the problem:

@if $length == 5 {
  @if type-of(nth($shadow, 5)) == color { $color: nth($shadow, 5); }
}

@heygrady heygrady closed this in e07adb7 May 1, 2012

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