0

I am running this SASS code in my Rails app (3.2.17):

@each $text, $foreground, $background in (submitted, white, grey),
                                        (partially_paid, white, orange),
                                        (paid, white, green),
                                        (accepted, white, blue),
                                        (declined, red, black),
                                        (waitinglist, black, grey),
                                        (lastminute, white, pink),
                                        (out, white, red),
                                        (blacklist, white, black) {
    .label-#{$text},
    .badge-#{$text} {
        background-color: #{$background} !important;
        color: #{$foreground};
    }
}

I tried to validate it with Sassmeister, and it seems to work http://sassmeister.com/gist/7144802

However Rails throws me an error like this:

Sass::SyntaxError - Invalid CSS after "@each $text": expected "in", was ", $foreground, ..."

What am I doing wrong?

danieldekay
  • 123
  • 10
  • 3
    Check your version of Sass. Sassmeister uses Sass 3.3.x. – cimmanon May 03 '14 at 14:34
  • 2
    @each with maps is Sass 3.3 functionality. If you are using an older version there are a couple of solutions here: http://stackoverflow.com/questions/6572588/sass-each-with-multiple-variables –  May 03 '14 at 15:38

0 Answers0