]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Add an internal `$-zf-font-stack` map to group font stacks. Added `font-stack` functi...
authorBrett Mason <brettsmason@gmail.com>
Fri, 13 Jan 2017 15:30:10 +0000 (15:30 +0000)
committerBrett Mason <brettsmason@gmail.com>
Fri, 13 Jan 2017 20:41:37 +0000 (20:41 +0000)
scss/util/_typography.scss [new file with mode: 0644]
scss/util/_util.scss

diff --git a/scss/util/_typography.scss b/scss/util/_typography.scss
new file mode 100644 (file)
index 0000000..10bd356
--- /dev/null
@@ -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';
+  }
+}
index d08a40d79480830e7f0c906ca7232207f4a39bf5..ddcb59eb066f5197cb3eee171cc8d4c83a17cc1d 100644 (file)
@@ -11,3 +11,4 @@
 @import 'flex';
 @import 'breakpoint';
 @import 'mixins';
+@import 'typography';