Bootstrap 4 Beta上相当于$ btn-secondary-color

时间:2017-10-05 18:19:29

标签: twitter-bootstrap sass twitter-bootstrap-4

我在$btn-secondary-color文件中使用变量_custom.scss,但Bootstrap 4 Beta上不存在此变量。它似乎被它取代了:

// _variables.scss

$theme-colors: (
  primary: $blue,
  secondary: $gray-600,
  success: $green,
  info: $cyan,
  warning: $yellow,
  danger: $red,
  light: $gray-100,
  dark: $gray-800
) !default;

// _buttons.scss
@each $color, $value in $theme-colors {
  .btn-#{$color} {
    @include button-variant($value, $value);
  }
}

那么如何修复我的代码并引用_custom.scss

中按钮的辅助颜色

1 个答案:

答案 0 :(得分:1)

不确定这是否是最佳方式,但我通过使用获得了我需要的价值:

color: map-get($theme-colors, secondary);