【问题标题】:Variables in rails with compass not working带有指南针的导轨中的变量不起作用
【发布时间】:2012-06-16 04:45:05
【问题描述】:

我正在使用 Rails 管道和“指南针”GEM。

我想为我的链接设置样式并尝试了这个:

// 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;
    }
}

但它不会工作......

当我将变量转换为十六进制代码(“#123456”)或白色(“白色”)时,它可以工作。 它们停留在“标准”蓝色紫罗兰色模式中。

如果不是,我应该如何使用变量?

【问题讨论】:

    标签: ruby-on-rails variables asset-pipeline compass-sass sass


    【解决方案1】:

    您需要从"#97A5A3" 中删除"

    $grey: #97A5A3;
    

    在这个site你可以查看你的Sass代码生成的CSS,方便查找错误。

    希望能解决你的问题....

    【讨论】:

    • 非常感谢在此期间,我已经完成了 ---> #{$color} 但你的胜过一切......很多thanxx(感谢漂亮的酷链接)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-26
    • 1970-01-01
    • 1970-01-01
    • 2014-01-14
    • 2011-12-21
    • 2012-01-03
    相关资源
    最近更新 更多