sass - Zurb Foundation 6 原色变量

标签 sass zurb-foundation zurb-foundation-6

查看 Zurb Foundation 6 中的 _settings.scss,SASS 变量 $primary-color 似乎没有任何赋值。我的问题是 $foundation-palettes primary 是否等同于 $primary-color

$foundation-palette: (
  primary: #2199e8,
  secondary: #777,
  success: #3adb76,
  warning: #ffae00,
  alert: #ec5840,
);

最佳答案

是的。 scss/util/_color.scss 中有一个 @mixin 为我们处理这个问题:

/// Transfers the colors in the `$foundation-palette` variable into the legacy color variables, such as `$primary-color` and `$secondary-color`. Call this mixin below the Global section of your settings file to properly migrate your codebase.
@mixin add-foundation-colors() {
  @if map-has-key($foundation-palette, primary) {
    $primary-color: map-get($foundation-palette, primary) !global;
  }
  @if map-has-key($foundation-palette, secondary) {
    $secondary-color: map-get($foundation-palette, secondary) !global;
  }
  @if map-has-key($foundation-palette, success) {
    $success-color: map-get($foundation-palette, success) !global;
  }
  @if map-has-key($foundation-palette, warning) {
    $warning-color: map-get($foundation-palette, warning) !global;
  }
  @if map-has-key($foundation-palette, alert) {
    $alert-color: map-get($foundation-palette, alert) !global;
  }
}

关于sass - Zurb Foundation 6 原色变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35806255/

相关文章:

sass - 是否可以从 SASS mixin 中测试当前元素类型?

css - 针对具有两个不同父类的同一个 child

html - Safari 100% 宽度和高度

css - 响应式动态缩略图库 : The last row doesn't work

Gulp-sass 没有正确编译 Foundation 6

html - 新行中第一个和最后一个内联 block 元素的选择器

html - 导航菜单未显示 : inline block

css - Foundation for Apps 元素中的对齐选项卡

html - 基础 CSS 加载 * : before *:after pseudo-elements too many times

css - 从 twitter-bootstrap 迁移到 zurb-foundation