Skip to content

Commit

Permalink
feat: use fontaine for font metrict generation
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Jul 4, 2024
1 parent 7bf046f commit 21ac0f9
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 68 deletions.
16 changes: 16 additions & 0 deletions app/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@font-face {
font-family: 'Cooper Hewitt';
font-weight: 400;
font-style: normal;
font-display: swap;
src: url('/fonts/CooperHewitt-400.woff2') format('woff2');
}

@font-face {
font-family: 'Cooper Hewitt';
font-weight: 700;
font-style: normal;
font-display: swap;
src: url('/fonts/CooperHewitt-700.woff2') format('woff2');
}

:root {
--un-decoration-thickness: max(1px, 0.05em);
--un-decoration-offset: max(2px, 0.15em);
Expand Down
4 changes: 1 addition & 3 deletions app/assets/css/prose.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@
* Custom styles
*/
.prose :where(h1, h2, h3, h4, h5, h6):not(:where(.not-prose, .not-prose *)) {
font-family:
Cooper Hewitt,
sans-serif;
font-family: Cooper Hewitt;
font-size: 1em;
}

Expand Down
94 changes: 93 additions & 1 deletion app/assets/uno.css

Large diffs are not rendered by default.

14 changes: 1 addition & 13 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const isDev = process.env.NODE_ENV === 'development'
export default defineNuxtConfig({
modules: [
'@byjohann/ui/nuxt',
'@nuxt/fonts',
'@nuxtjs/fontaine',
'@unocss/nuxt',
'@vueuse/nuxt',
'nuxt-vitalizer',
Expand Down Expand Up @@ -50,18 +50,6 @@ export default defineNuxtConfig({
disableNuxtInlineStyle: false,
},

fonts: {
families: [
{
provider: 'local',
name: 'Cooper Hewitt',
weights: [400, 700],
styles: ['normal'],
global: true,
},
],
},

nitro: {
storage: {
kql:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@iconify-json/carbon": "^1.1.35",
"@iconify-json/logos": "^1.1.43",
"@julr/unocss-preset-forms": "^0.1.0",
"@nuxt/fonts": "^0.7.0",
"@nuxtjs/fontaine": "^0.4.3",
"@sindresorhus/slugify": "^2.2.1",
"@types/node": "^20.14.5",
"@unocss/eslint-config": "^0.61.0",
Expand Down
68 changes: 19 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default defineConfig<Theme>({
},
},
fontFamily: {
heading: 'Cooper Hewitt, sans-serif',
heading: 'Cooper Hewitt',
},
},
shortcuts: {
Expand Down

0 comments on commit 21ac0f9

Please sign in to comment.