查看Zurb 6中的_settings.scss,SASS变量$primary-color似乎没有任何赋值。我的问题是$foundation-palettes主成分是否等同于$primary-color?
$foundation-palette: (
primary: #2199e8,
secondary: #777,
success: #3adb76,
warning: #ffae00,
alert: #ec5840,
);发布于 2016-03-04 21:42:59
是的,确实如此。有一个@mixin在scss/util/_color.scss中为我们处理这个问题:
/// 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;
}
}发布于 2016-03-05 02:18:50
是的,他们是平等的。$主色是遗留的东西,只需使用调色板即可。
https://stackoverflow.com/questions/35806255
复制相似问题