Skip to content

Commit ebd5be2

Browse files
committed
ADD: Preload fonts
1 parent 49c20ed commit ebd5be2

File tree

7 files changed

+34
-2
lines changed

7 files changed

+34
-2
lines changed

build/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = env => {
3232
alias: {
3333
source: path.resolve(__dirname, '../src'), // Relative path of src
3434
images: path.resolve(__dirname, '../src/assets/images'), // Relative path of images
35+
fonts: path.resolve(__dirname, '../src/assets/fonts'), // Relative path of fonts
3536
}
3637
},
3738

51.8 KB
Binary file not shown.
52.6 KB
Binary file not shown.
52 KB
Binary file not shown.
52.1 KB
Binary file not shown.

src/assets/styles/base/_fonts.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
11
/* src/assets/styles/base/_fonts.scss */
22

3+
/*
4+
Quicksand
5+
*/
6+
7+
@font-face {
8+
font-family: 'Quicksand';
9+
font-weight: 700;
10+
src: url('@~fonts/Quicksand-Bold.woff');
11+
}
12+
13+
@font-face {
14+
font-family: 'Quicksand';
15+
font-weight: 500;
16+
src: url('@~fonts/Quicksand-Medium.woff');
17+
}
18+
19+
@font-face {
20+
font-family: 'Quicksand';
21+
font-weight: 400;
22+
src: url('@~fonts/Quicksand-Regular.woff');
23+
}
24+
25+
@font-face {
26+
font-family: 'Quicksand';
27+
font-weight: 300;
28+
src: url('@~fonts/Quicksand-Light.woff');
29+
}
30+
331
$quicksand: 'Quicksand', sans-serif;

src/views/layouts/master.pug

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ html(lang='en')
4040
link(rel='icon', type='image/png', sizes='16x16', href=require('images/favicons/favicon-16x16.png'))
4141
link(rel='shortcut icon', href=require('images/favicons/favicon.ico'))
4242

43-
//- Fonts
44-
link(href="https://fonts.googleapis.com/css?family=Quicksand", rel='stylesheet')
43+
//- Preload fonts
44+
link(type='font/woff', href=require('source/assets/fonts/Quicksand-Bold.woff'), rel='preload', as='font', crossorigin)
45+
link(type='font/woff', href=require('source/assets/fonts/Quicksand-Medium.woff'), rel='preload', as='font', crossorigin)
46+
link(type='font/woff', href=require('source/assets/fonts/Quicksand-Regular.woff'), rel='preload', as='font', crossorigin)
47+
link(type='font/woff', href=require('source/assets/fonts/Quicksand-Light.woff'), rel='preload', as='font', crossorigin)
4548

4649
//- Title
4750
block title

0 commit comments

Comments
 (0)