2016-05-12 40 views
0

我正在嘗試使用基金會button() mixin來更改按鈕的顏色。我想下面的文檔的例子:基礎按鈕mixin拋出錯誤

@include button(
// $padding - Used to build padding for buttons Default: $button-med or rem-calc(12) 
$padding, 
// Background color. We can set $bg:false for a transparent background. Default: $primary-color. 
$bg, 
// If true, set to button radius which is $global-radius or explicitly set radius amount in px (ex. $radius:10px). Default:false. 
$radius, 
// We can set $full-width:true to remove side padding extend width. Default:false 
$full-width, 
// We can set $disabled:true to create a disabled transparent button. Default:false 
$disabled 
); 

但我的編譯器抱怨說,混入只需要4個參數。我可以提供四個參數,但沒有一個採取我期望的行動。

回答

0

嘗試將參數作爲命名參數傳遞給@include()。像這樣:

@include button($padding: 4px, $bg: #1a1a1a, $radius: 3px, $full-width: false); 

此外,參數名稱將取決於您使用的Foundation版本。您的示例顯示您正在使用Foundation 5. Foundation 6使用不同的參數名稱。