Skip to content

Commit

Permalink
refactor: use @nuxt/fonts (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpreston321 committed Mar 6, 2024
1 parent d6d22e3 commit 6543833
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
23 changes: 6 additions & 17 deletions app/nuxt.config.ts
Expand Up @@ -7,28 +7,17 @@ const dev = !!process.env.NUXT_DOCS_DEV
const isProd = process.env.NODE_ENV === 'production'
const ssr = Boolean(isProd || process.env.NUXT_DOCS_SSR)

// Some modules are shameless and don't understand prepare mode and make nonsense warnings
const isPrepare = Boolean(process.env.NUXT_DOCS_PREPARE)

export default defineNuxtConfig({
ssr,
modules: [
'@nuxt/content',
'@nuxtjs/fontaine',
!isPrepare && '@nuxtjs/google-fonts',
'@nuxtjs/seo',
isProd && '@nuxtjs/plausible',
'@nuxt/ui',
],
modules: ['@nuxt/fonts', '@nuxt/content', '@nuxtjs/seo', isProd && '@nuxtjs/plausible', '@nuxt/ui'],
ui: {
icons: [],
},
fontMetrics: {
fonts: ['Nunito'],
},
googleFonts: {
display: 'swap',
download: true,
fonts: {
families: [{ name: 'Nunito', provider: 'bunny' }],
defaults: {
weights: [400, 500, 600, 700],
},
},
app: {
head: {
Expand Down
2 changes: 1 addition & 1 deletion app/tailwind.config.ts
Expand Up @@ -26,7 +26,7 @@ export default <Partial<Config>>{
theme: {
extend: {
fontFamily: {
sans: ['nunito', 'sans-serif', ...defaultTheme.fontFamily.sans],
sans: ['Nunito', 'sans-serif', ...defaultTheme.fontFamily.sans],
},
colors: {
yellow: {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 0 additions & 6 deletions cli/setup.mjs
Expand Up @@ -40,12 +40,6 @@ export async function setupDocs(docsDir, opts = {}) {
// @ts-ignore
docs: docsconfig,
// @ts-ignore
googleFonts: {
families: {
Nunito: [400, 500, 600, 700], // in layer, it duplicates. why? (god knows?)
},
},
// @ts-ignore
site: {
name: docsconfig.name || '',
description: docsconfig.description || '',
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -32,9 +32,8 @@
"dependencies": {
"@headlessui/vue": "^1.7.19",
"@nuxt/content": "^2.12.0",
"@nuxt/fonts": "^0.0.1",
"@nuxt/ui-pro": "^1.0.2",
"@nuxtjs/fontaine": "^0.4.1",
"@nuxtjs/google-fonts": "^3.1.3",
"@nuxtjs/plausible": "^0.2.4",
"@nuxtjs/seo": "^2.0.0-rc.8",
"@nuxtjs/tailwindcss": "^6.11.4",
Expand Down

0 comments on commit 6543833

Please sign in to comment.