Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load custom fonts without webfont.js #2944

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added optional attributes to catalog/product.ts - @ZeevGerstner (#2792)
- Formatted dates in CHANGELOG.md to match ISO standard - @phoenixdev-kl (#2839)
- Moved Filter Price Ranges (used for ES aggregations and UI Filter) to the config - @jpetar (#2873)
- Load custom fonts without webfont.js - @jahvi (#2944)
- Added some structured data to product page - @cewald (#2910)

## [1.9.0] - 2019.05.06
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/css/base/_fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url('https://fonts.googleapis.com/css?family=Playfair+Display:400,700|Roboto:400,700|Material+Icons&display=swap');
1 change: 1 addition & 0 deletions src/themes/default/css/main.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import 'base/fonts';
@import 'vendor/flexboxgrid2';

@import 'variables/variables';
Expand Down
16 changes: 1 addition & 15 deletions src/themes/default/templates/index.basic.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,8 @@
{{{ meta.inject().meta.text() }}}
<meta name="generator" content="Vue Storefront">
{{{ meta.inject().link.text() }}}
<script type="text/javascript">
WebFontConfig = {
google: { families: [ 'Playfair+Display:400,700', 'Roboto:400,700', 'Material+Icons' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
{{{ renderStyles() }}}
{{{ output.appendHead() }}}
{{{ output.appendHead() }}}
</head>
<body>
<!--vue-ssr-outlet-->
Expand Down
18 changes: 2 additions & 16 deletions src/themes/default/templates/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,13 @@
<meta name="generator" content="Vue Storefront">
{{{ meta.inject().link.text() }}}
{{{ meta.inject().script.text() }}}
<script type="text/javascript">
WebFontConfig = {
google: { families: [ 'Playfair+Display:400,700', 'Roboto:400,700', 'Material+Icons' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
{{{ renderResourceHints() }}}
{{{ renderStyles() }}}
{{{ output.appendHead() }}}
{{{ output.appendHead() }}}
</head>
<body>
<!--vue-ssr-outlet-->
{{{ renderState() }}}
{{{ renderScripts() }}}
{{{ renderScripts() }}}
</body>
</html>