UNPKG

colette

Version:

A CSS and JS starter kit for 20 Minutes web projects

28 lines (24 loc) 824 B
// FontLoad // // Write font-family and fallback if `$fontload-js` is `true` // // $family - value of final `font-family` property (with custom font at fist place) // $weight - weight of font (by default current `font-weight` or `normal`) // $style - style of font (by default current `font-style` or `normal`) // // Styleguide: Mixins.FontLoad _fontload($family) if (!$fontload-js) font-family $family else $family-fallback = clone($family) $font = shift($family-fallback) $isCustom = false for key, val in $fontface $isCustom = $isCustom || (('' + val.family) == $font) if (!$isCustom) font-family $family else font-family $family-fallback .{$fontload-class} & font-family $family