3

Looking at _settings.scss in Zurb Foundation 6 the SASS variable $primary-color appears not to have any assigned value. My question is does $foundation-palettes primary equate to $primary-color?

$foundation-palette: (
  primary: #2199e8,
  secondary: #777,
  success: #3adb76,
  warning: #ffae00,
  alert: #ec5840,
);
cimmanon
  • 67,211
  • 17
  • 165
  • 171

2 Answers2

4

Yes it does. There is a @mixin in scss/util/_color.scss that takes care of this for us:

/// 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;
  }
}
Colin Marshall
  • 2,142
  • 2
  • 21
  • 31
-1

Yes they are equal. $primary-color is legacy stuff just use the color palettes.

Jonh Doe
  • 761
  • 1
  • 9
  • 25