Skip to content

Commit

Permalink
access font from scss
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanujkanti4441 committed Nov 7, 2024
1 parent 7519c04 commit 34736e4
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/_includes/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@
font-display: swap;
}

@font-face {
font-family: Inter;
src:
url("{{ '/assets/fonts/Inter-SemiBold-subset.woff2' | url }}") format("woff2"),
url("{{ '/assets/fonts/Inter-SemiBold-subset.zopfli.woff' | url }}") format("woff");
font-weight: 500;
font-style: "normal";
font-display: "swap";
}

/* Space Mono for code snippets */
@font-face {
font-family: "Space Mono";
Expand All @@ -131,20 +141,6 @@
src: url('https://cdn.jsdelivr.net/npm/[email protected]/dist/TwemojiCountryFlags.woff2') format('woff2');
}
</style>
<script>
if ("fonts" in document) {
var InterSemiBold = new FontFace("Inter", "url({{ '/assets/fonts/Inter-SemiBold-subset.woff2' | url }}) format('woff2'), url({{ '/assets/fonts/Inter-SemiBold-subset.zopfli.woff' | url }}) format('woff')", {
weight: "500",
style: "normal"
});

Promise.all([InterSemiBold.load()]).then(function(fonts) {
fonts.forEach(function(font) {
document.fonts.add(font);
});
});
}
</script>
{% if page.url != '/play/' %}
<script src="{{ '/assets/js/themes.js' | url }}"></script>
{%- endif -%}
Expand Down

0 comments on commit 34736e4

Please sign in to comment.