Carry Sass variables through the Assets Pipeline, Rails 3.1 rc1

后端 未结 2 1853
-上瘾入骨i
-上瘾入骨i 2021-02-02 13:09

I recently branched one of my Rails 3.0 projects with the 3.1 rc1 to try the new assets pipeline. I\'ve been using Sass in the project before going 3.1 so I\'ve been setting up

相关标签:
2条回答
  • 2021-02-02 13:35

    Sass supports Partials. That way you can include your separate configuration in __configuration.sass_ and reference it with

    @import "configuration";
    

    from your main sass-file.

    0 讨论(0)
  • 2021-02-02 13:45

    Unfortunately I found out that SASS variables are be page specific.

    If you want to carry your variables across all files, remove the *= require_tree . line from your application.css.scss file and replace it with the @import "layout.css.scss"; directive to manually import each sass file.

    Yes you have to @import each file

    0 讨论(0)
提交回复
热议问题