Last active
August 29, 2015 14:11
-
-
Save kaelig/72fcec1dd3c37d7a4dff to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---- | |
| // libsass (v3.0.2) | |
| // ---- | |
| $_o-fonts-families: ( | |
| 'BentonSans': ( | |
| 'variants': ( | |
| ('weight': 'lighter', 'style': 'normal'), | |
| ('weight': 'normal', 'style': 'normal'), | |
| ('weight': 'bold', 'style': 'normal') | |
| ) | |
| ), | |
| ); | |
| @function _oFontsVariantExists($family, $weight, $style) { | |
| $font-properties: map-get($_o-fonts-families, $family); | |
| $font-variants: map-get($font-properties, variants); | |
| @each $variant in $font-variants { | |
| $variant-weight: map-get($variant, 'weight'); | |
| $variant-style: map-get($variant, 'style'); | |
| // Check if we find the corresponding weight and style in the map | |
| @if ($variant-weight == $weight and $variant-style == $style) { | |
| @return true; | |
| } | |
| } | |
| @return false; | |
| } | |
| @mixin _oFontsVariantExists($family, $weight, $style) { | |
| $font-properties: map-get($_o-fonts-families, $family); | |
| $font-variants: map-get($font-properties, variants); | |
| @each $variant in $font-variants { | |
| $variant-weight: map-get($variant, 'weight'); | |
| $variant-style: map-get($variant, 'style'); | |
| // Check if we find the corresponding weight and style in the map | |
| @if ($variant-weight == $weight and $variant-style == $style) { | |
| content: true; | |
| } | |
| } | |
| } | |
| el { | |
| /* With a function, LibSass returns false, for some reason: */ | |
| content: _oFontsVariantExists(BentonSans, normal, normal); | |
| /* Using a mixin, LibSass returns true, as expected: */ | |
| @include _oFontsVariantExists(BentonSans, normal, normal); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| el { | |
| /* With a function, LibSass returns false, for some reason: */ | |
| content: false; | |
| /* Using a mixin, LibSass returns true, as expected: */ | |
| content: true; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment