From: Daniel Schuba Date: Wed, 8 Jun 2016 12:58:59 +0000 (+0200) Subject: Make access to $foundation-palette a bit easier X-Git-Tag: v6.2.4-rc1~42^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8911%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Make access to $foundation-palette a bit easier Accessing colors from $foundation-palette through map-get needs a lot of code. This way it would be a lot easier to use colors from palette. --- diff --git a/scss/util/_color.scss b/scss/util/_color.scss index a001de2a2..68561aa66 100644 --- a/scss/util/_color.scss +++ b/scss/util/_color.scss @@ -40,6 +40,19 @@ @return scale-color($color, $lightness: $scale); } +/// Get color from foundation-palette +/// +/// @param {key} color key from foundation-palette +/// +/// @returns {Color} color from foundation-palette +@function get-color($key) { + @if map-has-key($foundation-palette, $key) { + @return map-get($foundation-palette, $key); + } @else { + @error 'given $key is not available in $foundation-palette'; + } +} + /// 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) {