2013-08-22 48 views
0

框架:Ruby on Rails。Zurb基金会中的按钮自定义

我插入此代码到:foundation_and_overrides.scss

.button-facebook { 
    $bg: #000; 
    @include button($bg); 
} 

它给我这个错误:

Sass::SyntaxError at/Cannot add a number with units (0.0625em) to a color (#f1f1f1).

如何自定义ZURB的基金会$ BG变量?

回答

1

我假设这个问题是关于Zurb基金会4.

根据Zurb基金会4号文件, button()混入6个参数, 和按钮的颜色是第二个参数。因此,你可以指定按钮颜色如下:

@import "foundation/components/buttons"; 
.button-facebook{ 
    $bg: #000; 
    @include button($button-sml, $bg, false, false, false, false); 
} 

第一argment是按钮的填充,可以使用$button-tny$button-sml$button-med$button-lrgemCalc(NNNpx),或什么的。

看到Zurb基金会4号文件的更多详细信息:

http://foundation.zurb.com/docs/components/buttons.html