Skip to content

Commit

Permalink
refactor: separate fonts src from fonts.scss
Browse files Browse the repository at this point in the history
You can now set fonts src in `fonts-src.scss`.

BREAKING CHANGE: fonts.scss changed

If you have customized `fonts.scss`, be sure to check this change before updating.
  • Loading branch information
reuixiy committed Sep 30, 2019
1 parent 10e8ff3 commit 8de3b8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
13 changes: 13 additions & 0 deletions assets/scss/_common/fonts-src.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@if variable-exists("glyph") {
@font-face {
font-family: 'glyph-correction';
font-display: swap;
font-weight: inherit;
font-style: inherit;
src: url("../../fonts/glyph-correction.eot");
src: url("../../fonts/glyph-correction.eot?#iefix") format('embedded-opentype'),
url("../../fonts/glyph-correction.woff2") format('woff2'),
url("../../fonts/glyph-correction.woff") format('woff'),
url("../../fonts/glyph-correction.ttf") format('truetype');
}
}
14 changes: 0 additions & 14 deletions assets/scss/_common/fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,3 @@
font-family: $fontFamilyBody;
}
}

@if variable-exists("glyph") {
@font-face {
font-family: 'glyph-correction';
font-display: swap;
font-weight: inherit;
font-style: inherit;
src: url("../../fonts/glyph-correction.eot");
src: url("../../fonts/glyph-correction.eot?#iefix") format('embedded-opentype'),
url("../../fonts/glyph-correction.woff2") format('woff2'),
url("../../fonts/glyph-correction.woff") format('woff'),
url("../../fonts/glyph-correction.ttf") format('truetype');
}
}
2 changes: 2 additions & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@

@import "_common/fonts.scss";

@import "_common/fonts-src.scss";

{{ if .Site.Params.enableHeader }}
@import "_common/header.scss";
.site-brand {
Expand Down

0 comments on commit 8de3b8d

Please sign in to comment.