fix: add JetBrains Mono as default code font

This commit is contained in:
saicaca 2023-11-10 18:25:18 +08:00
parent 2aaeb3dcbe
commit cff918dab3
4 changed files with 19 additions and 4 deletions

5
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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

View File

@ -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