7

Here are all the less bootstrap variables: http://twitter.github.com/bootstrap/less.html

I've used the bootstrap-sass gem to add twitter bootstrap to my rails app which means I'm using sass. How do I modify/edit these less variables in my bootstrap_and_overrides.css.scss file?

When I try to do something like this:

@navbarBackground: #3D368B;

I get:

Sass::SyntaxError in Pages#home

Showing /Users/justme/myproject/app/views/layouts/application.html.erb where line #5 raised:

Invalid CSS after "@navbarBackground:": expected pseudoclass or pseudoelement, was " #3D368B;"

4

2 回答 2

9

Sass 中的变量以美元符号 ($) 开头,而不是在 Less 中使用的 at 符号 (@)。

尝试这个:

$navbarBackground: #3D368B;
@import "bootstrap";
@import "bootstrap-responsive";
于 2012-12-30T21:43:15.820 回答
5

修改saas中的变量,在导入bootstrap之前修改

.alert{
  margin-top:-40px;
}



@import "bootstrap";
@import "bootstrap-responsive";

这是我的应用程序中的一个示例

于 2012-07-28T23:31:42.973 回答