开发者

scss style sheets issue rails 3.1

my projects.css.scss file l开发者_StackOverflow中文版ooks like the bellow one,

// Place all the styles related to the Projects controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

$right-container-background: #3BBFCE;
$right-container-padding: 2px;

.right-container{
    background-color: $right-container-background;
    color: white;
    padding-left: $right-container-padding;
    padding-right: $right-container-padding;
 }

It says that all styles will be automatically added to your application.css.

But I am not able to use it without importing to application.css i.e.

@charset "utf-8";
@import "projects.css.scss";
@import "partners.css.scss";

So, while i'm in the projects section of my view, is it not going to load all the .scss file imported in application.css ?


The default application.css in rails 3.1 contains the following lines:

/*
 * This is a manifest file that'll automatically include all the stylesheets available in this directory
 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
 * the top of the compiled file, but it's generally better to create a new file per style scope.
 *= require_self
 *= require_tree . 
*/

You should re-add them if you want the default behaviour of including everything.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜