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

feat: Add Nuxt Fonts #38

Merged
merged 2 commits into from
May 17, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions assets/style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@ html, body, #__nuxt, #__layout {
}

@font-face {
font-family: "Testimonial";
src: local("Testimonial"), url("/font/PPEditorialNew-UltralightItalic.otf") format("opentype");
font-display: swap;
font-family: "Testimonial", serif;
}

@layer components {
.font-testimonial {
font-family: "Testimonial", sans-serif;
@apply tracking-wider
}
@font-face {
font-family: "Geist", sans-serif;
}

@layer components {
.text-gradient {
@apply bg-clip-text text-transparent;
@apply bg-gradient-to-bl from-accent-primary to-accent-secondary;
Expand Down Expand Up @@ -76,7 +73,7 @@ html, body, #__nuxt, #__layout {
}

.writing {
@apply prose antialiased text-gray-700/90 dark:text-gray-400/80 leading-relaxed;
@apply prose antialiased font-geist text-gray-700/90 dark:text-gray-400/80 leading-relaxed;
@apply prose-h1:text-2xl prose-h1:mb-0 sm:prose-h1:text-3xl prose-h1:text-zinc-900 dark:prose-h1:text-zinc-100 prose-h1:italic prose-h1:font-[600];
@apply prose-h2:text-xl sm:prose-h2:text-2xl prose-h2:text-zinc-900 dark:prose-h2:text-zinc-100;
@apply prose-h3:text-lg sm:prose-h3:text-xl prose-h3:text-zinc-900 dark:prose-h3:text-zinc-100;
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion components/content/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defineOgImage({ url: appConfig.openGraphImage, width: 1200, height: 630, alt: 'H
</h1>

<!-- subtitle -->
<h2 class="mx-auto mt-4 max-w-xl text-center text-lg font-extralight text-white/60">
<h2 class="mx-auto mt-4 max-w-xl text-center text-lg antialiased text-white/60">
<ContentSlot :use="$slots.hero_subtitle" />
</h2>
</div>
Expand Down
6 changes: 6 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<script setup lang="ts">
const { page } = useContent()

useContentHead(page)
</script>

<template>
<div>
<div>
Expand Down
14 changes: 12 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ export default defineNuxtConfig({
enabled: true,
},

modules: ['@vueuse/nuxt', '@nuxtjs/i18n', '@nuxt/ui', 'nuxt-svgo', '@nuxt/content', '@nuxthq/studio', '@nuxt/image', 'nuxt-og-image'],
modules: [
'@vueuse/nuxt',
'@nuxtjs/i18n',
'@nuxt/ui',
'nuxt-svgo',
'@nuxt/content',
'@nuxthq/studio',
'@nuxt/image',
'nuxt-og-image',
"@nuxt/fonts"
],

image: {
format: ['webp'],
Expand Down Expand Up @@ -103,4 +113,4 @@ export default defineNuxtConfig({
svgo: {
autoImportPath: './assets/logo/',
},
})
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@nuxt/content": "npm:@nuxt/content-edge@latest",
"@nuxt/devtools": "^1.3.1",
"@nuxt/eslint-config": "^0.3.12",
"@nuxt/fonts": "^0.7.0",
"@nuxt/image": "1.7.0",
"@nuxt/ui": "^2.16.0",
"@nuxthq/studio": "^1.0.15",
Expand Down
2 changes: 1 addition & 1 deletion pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ defineShortcuts({
<div>
<Html
:lang="$i18n.locale"
class="bg-zinc-950 text-main transition-colors duration-300 selection:bg-white/60 selection:text-zinc-800"
class="bg-zinc-950 text-main font-geist transition-colors duration-300 selection:bg-white/60 selection:text-zinc-800"
>
<Body>
<LayoutScrollToTop />
Expand Down
Binary file added public/fonts/geist.ttf
Binary file not shown.
5 changes: 5 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ module.exports = {
textShadow: {
sm: 'rgba(255, 255, 255, 0.35) 1px 1px 12px',
},

fontFamily: {
testimonial: ['Testimonial', 'sans-serif'],
geist: ['Geist', 'sans-serif'],
},
},
},
plugins: [
Expand Down