From: Brett Mason Date: Fri, 13 Jan 2017 15:30:10 +0000 (+0000) Subject: Add an internal `$-zf-font-stack` map to group font stacks. Added `font-stack` functi... X-Git-Tag: 6.3.1~31^2^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b712ab45034b78ebc4199d67fb0a2ddd0145ff3f;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Add an internal `$-zf-font-stack` map to group font stacks. Added `font-stack` function which retrives a value from the new map, and can also be used with your own man. --- diff --git a/scss/util/_typography.scss b/scss/util/_typography.scss new file mode 100644 index 000000000..10bd356c4 --- /dev/null +++ b/scss/util/_typography.scss @@ -0,0 +1,34 @@ +// Foundation for Sites by ZURB +// foundation.zurb.com +// Licensed under MIT Open Source + +//// +/// @group functions +//// + +$-zf-font-stack: ( + 'georgia': (Georgia, "URW Bookman L", serif), + 'helvetica': (Helvetica, Arial, "Nimbus Sans L", sans-serif), + 'lucida-grande': ("Lucida Grande", "Lucida Sans Unicode", "Bitstream Vera Sans", sans-serif), + 'monospace': ("Courier New", Courier, "Nimbus Sans L", monospace), + 'system': (-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif), + 'verdana': (Verdana, Geneva, "DejaVu Sans", sans-serif), +); + +/// Retrieve a font stack string from a map. +/// @param {String} $stack - The key of the font stack from the map. +/// @param {Map} $map - A map of font stacks to retrieve a string from. +/// @return {List} A font stack list. +@function font-stack($stack, $map: $-zf-font-stack) { + @if (type-of($map) == 'map') { + @if (map-has-key($map, $stack)) { + @return map-get($map, $stack); + } + @else { + @error 'Font stack $key is not available in $map'; + } + } + @else { + @error '$map is not a map'; + } +} diff --git a/scss/util/_util.scss b/scss/util/_util.scss index d08a40d79..ddcb59eb0 100644 --- a/scss/util/_util.scss +++ b/scss/util/_util.scss @@ -11,3 +11,4 @@ @import 'flex'; @import 'breakpoint'; @import 'mixins'; +@import 'typography';