Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use @nuxt/fonts #92

Merged
merged 2 commits into from Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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