Search code examples
ruby-on-railsvariablesasset-pipelinecompass-sasssass

Variables in rails with compass not working


I am playing around with The Rails Pipeline and the "Compass" GEM.

I wanna style my links and tried with this:

// File /assets/stylesheets/application.css.scss

$grey: "#97A5A3";

a {
    text-decoration: none;
    color: white;

    &:hover {
        color:$grey;
        text-decoration: underline;
    }
    &:visited {
        color: $grey;
    }
    &:active {
        color: $grey;
    }
    &:visited {
        color: $grey;
    }
}

But it wont work...

When I turn the variables into a HEX Code ("#123456") or an white ("white") it works. They stay in the "standard" blue, violett schema.

How should I use variables instead if not so?


Solution

  • You need to remove the " from "#97A5A3".

    $grey: #97A5A3;
    

    On this site you can check the CSS generated by your Sass code, which facilitate to find any error.

    I hope it solves your problem....