From cff918dab36fde7359d17599b589c8217ced7d49 Mon Sep 17 00:00:00 2001 From: saicaca Date: Fri, 10 Nov 2023 18:25:18 +0800 Subject: [PATCH] fix: add JetBrains Mono as default code font --- package-lock.json | 5 +++++ package.json | 1 + pnpm-lock.yaml | 9 ++++++++- src/components/misc/Markdown.astro | 8 +++++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28b736d..9fb3887 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1138,6 +1138,11 @@ "node": ">=12" } }, + "node_modules/@fontsource-variable/jetbrains-mono": { + "version": "5.0.18", + "resolved": "https://registry.npmjs.org/@fontsource-variable/jetbrains-mono/-/jetbrains-mono-5.0.18.tgz", + "integrity": "sha512-8qyD5zmaB4X9EQsGViwHGcQPjOGsHGxyJ+DuAxkXVyP+/Mzb5B9kYuG8+8a3vX/y0mZ81CUpbUWp0ik89c3dQw==" + }, "node_modules/@fontsource/roboto": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.0.8.tgz", diff --git a/package.json b/package.json index 7e14e27..55e3699 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@astrojs/check": "^0.2.0", "@astrojs/tailwind": "^5.0.2", "@astrojs/vue": "^3.0.1", + "@fontsource-variable/jetbrains-mono": "^5.0.18", "@fontsource/roboto": "^5.0.8", "astro": "^3.5.0", "astro-icon": "1.0.0-next.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7831dd5..beb98fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,10 @@ dependencies: version: 5.0.2(astro@3.5.0)(tailwindcss@3.3.3) '@astrojs/vue': specifier: ^3.0.1 - version: 3.0.1(@babel/core@7.23.2)(astro@3.4.4)(vite@4.5.0)(vue@3.3.8) + version: 3.0.1(@babel/core@7.23.3)(astro@3.5.0)(vite@4.5.0)(vue@3.3.8) + '@fontsource-variable/jetbrains-mono': + specifier: ^5.0.18 + version: 5.0.18 '@fontsource/roboto': specifier: ^5.0.8 version: 5.0.8 @@ -1093,6 +1096,10 @@ packages: dev: false optional: true + /@fontsource-variable/jetbrains-mono@5.0.18: + resolution: {integrity: sha512-8qyD5zmaB4X9EQsGViwHGcQPjOGsHGxyJ+DuAxkXVyP+/Mzb5B9kYuG8+8a3vX/y0mZ81CUpbUWp0ik89c3dQw==} + dev: false + /@fontsource/roboto@5.0.8: resolution: {integrity: sha512-XxPltXs5R31D6UZeLIV1td3wTXU3jzd3f2DLsXI8tytMGBkIsGcc9sIyiupRtA8y73HAhuSCeweOoBqf6DbWCA==} dev: false diff --git a/src/components/misc/Markdown.astro b/src/components/misc/Markdown.astro index 5ffdff5..f8f7f85 100644 --- a/src/components/misc/Markdown.astro +++ b/src/components/misc/Markdown.astro @@ -1,4 +1,5 @@ --- +import '@fontsource-variable/jetbrains-mono/wght-italic.css'; interface Props { class: string; } @@ -38,10 +39,9 @@ const className = Astro.props.class; /*&:after*/ /* background: var(--link-active)*/ code - font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace + font-family: JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace background: var(--inline-code-bg) color: var(--inline-code-color) - font-size: 0.875rem padding: 2px 4px border-radius: 4px overflow: hidden @@ -55,6 +55,8 @@ const className = Astro.props.class; padding-left: 20px padding-right: 20px code + color: unset + font-size: 0.875rem padding: 0 background: none ::selection @@ -99,4 +101,4 @@ const className = Astro.props.class; margin-left: auto margin-right: auto max-width: 100% - + \ No newline at end of file