Skip to content

Commit

Permalink
feat: update font (#23)
Browse files Browse the repository at this point in the history
# What 💻 
* update font for readability
* Use fira mono for code font
  • Loading branch information
itsacoyote authored Apr 23, 2024
1 parent 2fcfeb1 commit 3790c0c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bun run dev -o

## Local Preview

To locally preview the production build:
To locally preview the production build, first run `bun run generate` to build the project, then run the following:

```shell
bun run preview
Expand Down
18 changes: 18 additions & 0 deletions components/content/ProseCodeInline.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<code class="inline-code border-0 text-base font-normal"><slot /></code>
</template>

<style>
.prose :where(a code):not(:where([class~='not-prose'], [class~='not-prose'] *)) {
color: var(--tw-prose-links);
}
.prose :where(a:hover code):not(:where([class~='not-prose'], [class~='not-prose'] *)) {
text-decoration: underline;
}
.prose :where(h2 code, h3 code, h4 code, h5 code, h6 code) {
font-size: inherit;
line-height: inherit;
}
</style>
12 changes: 11 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export default defineNuxtConfig({
extends: ['@nuxt/ui-pro'],
app: {
head: {
link: [{ rel: 'stylesheet', href: '/katex.min.css' }],
link: [
{ rel: 'stylesheet', href: '/main.css' },
{ rel: 'stylesheet', href: '/katex.min.css' },
],
},
},
modules: [
Expand All @@ -26,6 +29,13 @@ export default defineNuxtConfig({
globals.forEach((c) => (c.global = true));
},
},
fonts: {
families: [
{ name: 'Raleway', provider: 'google' },
{ name: 'Montserrat', provider: 'google' },
{ name: 'Fira Mono', provider: 'google' },
],
},
ui: {
icons: {
collections: {
Expand Down
5 changes: 5 additions & 0 deletions public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
body {
-webkit-font-smoothing: auto !important;
text-rendering: optimizeLegibility;
letter-spacing: 0.1px;
}
3 changes: 2 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ export default <Partial<Config>>{
theme: {
extend: {
fontFamily: {
sans: ['Inter', ...defaultTheme.fontFamily.sans],
sans: ['Raleway', ...defaultTheme.fontFamily.sans],
serif: ['Montserrat', ...defaultTheme.fontFamily.serif],
mono: ['Fira Mono', ...defaultTheme.fontFamily.mono],
},
colors: {
zkSlate: {
Expand Down

0 comments on commit 3790c0c

Please sign in to comment.