Skip to content

Commit 55d9cbe

Browse files
committed
feat: webfont for titles
1 parent 4c01658 commit 55d9cbe

12 files changed

+433
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ yarn-debug.log*
88
yarn-error.log*
99

1010
.vscode
11+
SourceHanSansCN-*.otf
1112
maxmind-data
1213

1314
# Runtime data

assets/font/title.woff

9.13 KB
Binary file not shown.

assets/font/title.woff2

7.72 KB
Binary file not shown.

assets/style/title-font.css

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@font-face {
2+
font-family: 'SHSans EL';
3+
font-weight: 200;
4+
src: url('~assets/font/title.woff2') format('woff2'),
5+
url('~assets/font/title.woff') format('woff');
6+
}

components/headline.vue

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
<template>
22
<container dark header v-bind="$attrs">
3-
<h1 class="display-3">{{ title }}</h1>
3+
<h1 class="display-3"><slot />{{ title }}</h1>
44
<h2 class="subtitle-1">{{ subtitle }}</h2>
55
</container>
66
</template>
77
<script>
88
export default {
9-
props: { title: String, subtitle: String }, // eslint-disable-line vue/require-default-prop
9+
props: {
10+
title: { type: String, default: '' },
11+
subtitle: { type: String, default: '' },
12+
},
1013
}
1114
</script>
15+
16+
<style src="~/assets/style/title-font.css" />
1217
<style scoped>
1318
.v-application h1.display-3 {
19+
font-family: 'SHSans EL' !important;
1420
font-weight: 200;
1521
margin: 40px 0 16px;
1622
}
@@ -20,6 +26,7 @@ export default {
2026
font-size: 2rem !important;
2127
line-height: 2rem;
2228
font-weight: 400;
29+
font-family: inherit !important;
2330
}
2431
}
2532
h1, h2 { padding: 0 16px; }

0 commit comments

Comments
 (0)