typeplate/starter-kit

Open Type Mixin

Opened this issue · 0 comments

$dlig-boolean: off;
$font-feat: (
  dlig: if($dlig-boolean, 1, null),
  smcp: on,
  c2sc: null,
  liga: off,
  tnum: 'hist'
);

@mixin openType($el, $map) {
  #{$el} {
    @each $lig, $val in $map {
      @if $val != null {
        font-feature-settings: "#{$lig}" $val;
      } @else {
        font-feature-settings: "#{$lig}";
      }
    }
  }
}

@include openType('.element', $font-feat);