Skip to content

Commit d0925f3

Browse files
committed
fix fonts
1 parent 4698b56 commit d0925f3

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:e2e:ui": "playwright test --ui"
1616
},
1717
"dependencies": {
18-
"@fontsource-variable/fira-code": "^5.1.0",
18+
"@fontsource-variable/jetbrains-mono": "^5.1.1",
1919
"@fontsource/space-mono": "^5.1.1",
2020
"@radix-ui/react-dialog": "^1.1.2",
2121
"@radix-ui/react-dropdown-menu": "^2.1.2",
@@ -82,4 +82,4 @@
8282
"vite-bundle-visualizer": "^1.2.1",
8383
"vite-plugin-static-copy": "^2.1.0"
8484
}
85-
}
85+
}

src/components/Editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const EditorView = ({ doc, firstLoad }: { doc: Y.Doc; firstLoad: boolean }) => {
2525
editorProps: {
2626
attributes: {
2727
class:
28-
"!w-full prose !max-w-none dark:prose-invert prose-md leading-tight focus:outline-none min-h-[60vh]",
28+
"!w-full prose !max-w-none dark:prose-invert prose-md leading-tight focus:outline-none min-h-[80vh]",
2929
},
3030
},
3131
});

src/main.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
33
import App from './App.tsx'
4-
import './tailwind.css'
54

6-
// @ts-expect-error - for some reason this doesn't work in terms of importing the font
7-
// however, it works in the browser
8-
import '@fontsource-variable/fira-code';
5+
import '@fontsource-variable/jetbrains-mono/index.css';
6+
7+
import './tailwind.css';
8+
99

1010
createRoot(document.getElementById('root')!).render(
1111
<StrictMode>

src/tailwind.css

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
:root {
2+
/* Please note font is imported in ./main.tsx */
3+
--font-mono: 'JetBrains Mono Variable', monospace;
4+
}
5+
16
@tailwind base;
27
@tailwind components;
38
@tailwind utilities;
@@ -25,6 +30,7 @@
2530
--ring: 307 23.3% 14.3%;
2631
--radius: 0.5rem;
2732
}
33+
2834
.dark {
2935
--background: 307 40% 9%;
3036
--foreground: 307 5% 100%;
@@ -59,15 +65,16 @@
5965
}
6066
}
6167

62-
.prose p {
63-
@apply my-4 leading-tight; /* Tailwind utilities */
68+
.ProseMirror p {
69+
@apply my-4;
70+
/* Tailwind utilities */
6471
}
6572

6673
/* Basic editor styles */
6774
.tiptap {
6875

6976
/* disable margin-bottom for paragraph elements under li */
70-
li > p {
77+
li>p {
7178
margin-bottom: 0;
7279
}
7380

@@ -156,16 +163,16 @@
156163
display: flex;
157164
margin-bottom: 0;
158165

159-
> label {
166+
>label {
160167
flex: 0 0 auto;
161168
margin-right: 0.5rem;
162169
user-select: none;
163170
}
164171

165-
> div {
172+
>div {
166173
flex: 1 1 auto;
167174

168-
> p {
175+
>p {
169176
margin: 0;
170177
}
171178
}
@@ -179,4 +186,4 @@
179186
margin: 0;
180187
}
181188
}
182-
}
189+
}

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
theme: {
88
extend: {
99
fontFamily: {
10-
mono: ['"Fira Code"', 'monospace'],
10+
mono: 'var(--font-mono)',
1111
},
1212
borderRadius: {
1313
lg: 'var(--radius)',

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,10 @@
368368
resolved "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz"
369369
integrity sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==
370370

371-
"@fontsource-variable/fira-code@^5.1.0":
372-
version "5.1.0"
373-
resolved "https://registry.npmjs.org/@fontsource-variable/fira-code/-/fira-code-5.1.0.tgz"
374-
integrity sha512-fwJbJLvyZ2BhgBSPYCNsrQ6IFQTpRu9GWXY8N20wHTpbhV0Ro5QJihiZV060Ay3kVR6IVH/oSVe/cr7Ube28gg==
371+
"@fontsource-variable/jetbrains-mono@^5.1.1":
372+
version "5.1.1"
373+
resolved "https://registry.yarnpkg.com/@fontsource-variable/jetbrains-mono/-/jetbrains-mono-5.1.1.tgz#d45ecec375900a89b64b8c3e260b51ad848ef11c"
374+
integrity sha512-V+1aRFRvuZ66PpO30s8l/2aADKzpV9VRsO3kSZE+rTMvi4vab3cUcPHMN2z+wAvjkYJO71Yf+g3/Y6pSMmQpVQ==
375375

376376
"@fontsource/space-mono@^5.1.1":
377377
version "5.1.1"

0 commit comments

Comments
 (0)