This repository has been archived by the owner on Apr 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prep code for self-hosted webfonts
- Add placeholder directory for self-hosted webfonts - Adapt config.js so that webfonts from that placholder directory are copied to dist/ in deploy task - Add + include mixins for modern + legacy webfont code - Add project-specific partial to include webfont SCSS in order to make sure that the webfonts SCSS gets included in the compiled CSS as early as possible - Document mixin and project file
- Loading branch information
Showing
8 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Empty file.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SELF-HOSTED WEBFONTS | ||
// -------------------------------------------------------------------- | ||
// Defaults | ||
$font-path: '../fonts' !default; | ||
|
||
|
||
// For modern browsers | ||
@mixin webfont($family, $src, $style: normal, $weight: normal, $path: $font-path) { | ||
@font-face { | ||
font-family: $family; | ||
src: url('#{$path}/#{$src}.woff2') format('woff2'), // new standards | ||
url('#{$path}/#{$src}.woff') format('woff'), // standards | ||
url('#{$path}/#{$src}.ttf') format('truetype'); // Safari, Android, iOS | ||
font-style: $style; | ||
font-weight: $weight; | ||
} | ||
} | ||
|
||
// For legacy browsers | ||
@mixin legacy-webfont($family, $src, $style: normal, $weight: normal, $path: $font-path) { | ||
@font-face { | ||
font-family: $family; | ||
src: url('#{$path}/#{$src}.eot'); // IE9 compat | ||
src: url('#{$path}/#{$src}.eot?#iefix') format('embedded-opentype'), // IE8 and below | ||
url('#{$path}/#{$src}.woff2') format('woff2'), // new standards | ||
url('#{$path}/#{$src}.woff') format('woff'), // standards | ||
url('#{$path}/#{$src}.ttf') format('truetype'), // Safari, Android, iOS | ||
url('#{$path}/#{$src}.svg##{$family}') format('svg'); // legacy iOS | ||
font-style: $style; | ||
font-weight: $weight; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// FONTS | ||
// -------------------------------------------------------------------- |