Skip to content

Commit

Permalink
perf(font): self host brand font
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow81627 committed Dec 14, 2019
1 parent 6dc1a83 commit a1f47b0
Show file tree
Hide file tree
Showing 9 changed files with 650 additions and 11 deletions.
13 changes: 13 additions & 0 deletions assets/css/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* rouge-script-regular - latin */
@font-face {
font-family: 'Rouge Script';
font-style: normal;
font-weight: 400;
src: url('../fonts/rouge-script-v8-latin-regular.eot'); /* IE9 Compat Modes */
src: local('Rouge Script'), local('RougeScript-Regular'),
url('../fonts/rouge-script-v8-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/rouge-script-v8-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/rouge-script-v8-latin-regular.woff') format('woff'), /* Modern Browsers */
url('../fonts/rouge-script-v8-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/rouge-script-v8-latin-regular.svg#RougeScript') format('svg'); /* Legacy iOS */
}
Binary file added assets/fonts/rouge-script-v8-latin-regular.eot
Binary file not shown.
600 changes: 600 additions & 0 deletions assets/fonts/rouge-script-v8-latin-regular.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fonts/rouge-script-v8-latin-regular.ttf
Binary file not shown.
Binary file added assets/fonts/rouge-script-v8-latin-regular.woff
Binary file not shown.
Binary file added assets/fonts/rouge-script-v8-latin-regular.woff2
Binary file not shown.
34 changes: 23 additions & 11 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,7 @@ module.exports = {
content: pkg.version,
},
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
rel: 'stylesheet',
href:
'https://fonts.googleapis.com/css?family=Rouge+Script&display=swap',
lazyload: true,
body: true,
},
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
noscript: [{ innerHTML: 'This website requires JavaScript.' }],
},

Expand All @@ -84,7 +75,11 @@ module.exports = {
/*
** Global CSS
*/
css: ['~/assets/scss/custom.scss', '~/assets/css/storyblok.css'],
css: [
'~/assets/scss/custom.scss',
'~/assets/css/storyblok.css',
'~/assets/css/fonts.css',
],

/*
** Plugins to load before mounting the App
Expand Down Expand Up @@ -115,6 +110,7 @@ module.exports = {
'@nuxtjs/dotenv',
'@nuxtjs/markdownit',
'nuxt-i18n',
'nuxt-webfontloader',
[
'storyblok-nuxt',
{
Expand Down Expand Up @@ -174,6 +170,22 @@ module.exports = {
defaultAssets: false,
},

webfontloader: {
// google: {
// families: ['Rouge Script', 'Nunito Sans:n4,n6'],
// urls: [
// // for each Google Fonts add url + options you want
// // here add font-display option
// 'https://fonts.googleapis.com/css?family=Rouge+Script&display=swap',
// 'https://fonts.googleapis.com/css?family=Nunito+Sans:400,600&display=swap',
// // 'https://fonts.googleapis.com/css?family=Roboto:300,700&display=swap'
// ]
// },
custom: {
families: ['Rouge Script'],
},
},

/*
** Build configuration
*/
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"koa": "2.11.0",
"nuxt": "2.10.2",
"nuxt-i18n": "6.4.1",
"nuxt-webfontloader": "1.1.0",
"storyblok-nuxt": "1.0.2"
},
"devDependencies": {
Expand Down

1 comment on commit a1f47b0

@vercel
Copy link

@vercel vercel bot commented on a1f47b0 Dec 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.