Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a conditional import for font faces #71

Open
asantos00 opened this issue Jan 19, 2017 · 1 comment
Open

Create a conditional import for font faces #71

asantos00 opened this issue Jan 19, 2017 · 1 comment

Comments

@asantos00
Copy link
Contributor

asantos00 commented Jan 19, 2017

The main idea is to only import the fonts needed on each project (the same approach we do with the mixins, instead of exporting behaviour we don't need, only use what you want)

The main idea was to keep (like a registry) of the imported fonts

(Pseudo code below, it will have lots of errors and won't be complete)

$base-font-path : "fonts/"
$fonts : ();

@mixin font($name = "IntervalNextSemiBold") {
   $font-already-imported: map-get($fonts, $name);

   @if(!$font-already-imported) {
       $fonts : map-set($fonts, $name, true);
       @include font-face($name, "${$base-font-path}/intervalnext-semibold", null, null, woff2 woff eot);
   }

   @return "font-family: ${name}, sans-serif"   
}
@asantos00
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant