2017-08-26 51 views
0

我必須覆蓋我自定義的引導程序函數_variables.scss

我嘗試使用map-merge。

$theme-color: map-merge((primary, #333745)); 

回答

1

無需使用合併地圖,只需設置$theme-colors到地圖:

$theme-colors: (
    primary: #333745 
) 

確保您包括您的自定義變量文件前引導變量文件,你應該罰款。在內部,將執行以下操作:

/* Set theme colors, !default means only update if undeclared */ 
$theme-colors:() !default; 
/* Use map-merge to overwrite the standard colors with your colors */ 
$theme-colors: map-merge((
    primary: $blue, 
    secondary: $gray-600, 
    success: $green, 
    info: $cyan, 
    warning: $yellow, 
    danger: $red, 
    light: $gray-100, 
    dark: $gray-800 
), $theme-colors); 

所有引導默認使用!default標誌,所以你可以重寫你通過聲明它需要的任何值加載引導SASS代碼之前,它會兌現設置的你的價值超過它自己。