Skip to content

Commit

Permalink
chore: optimize fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanChanges committed Nov 13, 2024
1 parent 695284e commit 3f9af97
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
20 changes: 20 additions & 0 deletions assets/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,23 @@
font-family: "Noto Sans", sans-serif;
font-weight: 500;
}

:root[lang^="en"] {
font-family: "Noto Sans", sans-serif;
font-weight: 500;
}

:root[lang^="zh-TW"], :root[lang^="zh-Hant"] {
font-family: "Noto Sans TC", "Noto Sans", sans-serif;
font-weight: 500;
}

:root[lang^="zh-CN"], :root[lang^="zh-Hans"] {
font-family: "Noto Sans SC", "Noto Sans", sans-serif;
font-weight: 500;
}

:root[lang^="ja"] {
font-family: "Noto Sans JP", "Noto Sans", sans-serif;
font-weight: 500;
}
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion components/AppFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { major, minor, commit } = useVersion()
</div>
<div select="none" class="text-center"><NuxtLink to="/privacy#privacy-policy">{{ t('privacy-policy') }}</NuxtLink></div>
<br>
<div select-none class="version color-blue font-800 text-center">
<div select-none class="version color-emerald font-600 text-center">
Build: {{ major }}-{{minor}}@<b>{{ commit.slice(0, 8) }}</b>
</div>
</template>
Expand Down
28 changes: 7 additions & 21 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export default defineNuxtConfig({
modules: [
'@primevue/nuxt-module',
'@nuxtjs/i18n',
'@nuxtjs/google-fonts',
'@vite-pwa/nuxt',
'@nuxt/content',
'@nuxtjs/seo',
Expand All @@ -73,10 +72,11 @@ export default defineNuxtConfig({
'@pinia/nuxt',
'pinia-plugin-persistedstate',
'@nuxtjs/device',
'@nuxt/fonts',
],
version: {
major: "a",
minor: 11
minor: 12
},
i18n: {
langDir: "locales",
Expand All @@ -101,25 +101,6 @@ export default defineNuxtConfig({
pinia: {
storesDirs: ['./stores/**'],
},
googleFonts: {
preload: true,
base64: true,
families: {
"Noto+Sans": {
wght: '400..600'
},
"Noto+Sans+SC": {
wght: '400..600'
},
"Noto+Sans+TC": {
wght: '400..600'
},
"Roboto": {
wght: '700',
text: "abcdefghijklmnopqrstuvwxyz1234567890"
}
}
},
nitro: {
preset: hyphenate(process.env.SERVER_PRESET ?? 'netlify_edge'),
},
Expand Down Expand Up @@ -148,4 +129,9 @@ export default defineNuxtConfig({
unocss: {
nuxtLayers: true,
},
fonts: {
defaults: {
weights: [400, 500, 600, 700]
}
}
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@nuxt/content": "^2.13.4",
"@nuxt/fonts": "^0.7.2",
"@nuxt/fonts": "^0.10.2",
"@nuxt/image": "^1.8.1",
"@nuxtjs/color-mode": "^3.5.1",
"@nuxtjs/device": "^3.2.4",
Expand Down

0 comments on commit 3f9af97

Please sign in to comment.