Skip to content

Commit 92cb782

Browse files
committed
fix(mobile): improve paragraph spacing and inline code wrapping
1 parent d388ba5 commit 92cb782

2 files changed

Lines changed: 23 additions & 9 deletions

File tree

apps/mobile/v1/editor/src/components/Editor.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,21 @@ const createEditorHTML = (content: string, placeholder: string, isDark: boolean,
125125
h2 { font-size: 24px; line-height: 1.3; }
126126
h3 { font-size: 20px; line-height: 1.4; }
127127
128-
/* Paragraphs */
128+
/* Paragraphs - small bottom margin for visual separation between blocks */
129129
p {
130-
margin: 0;
130+
margin: 0 0 0.4em 0;
131131
line-height: 1.6;
132132
}
133133
134-
/* Empty paragraphs should show as single line */
134+
/* Last paragraph shouldn't have bottom margin */
135+
p:last-child {
136+
margin-bottom: 0;
137+
}
138+
139+
/* Empty paragraphs should show as spacing */
135140
p:empty {
136141
min-height: 1em;
142+
margin-bottom: 0;
137143
}
138144
139145
/* First empty paragraph in editor gets slightly more height for better UX */
@@ -237,15 +243,16 @@ const createEditorHTML = (content: string, placeholder: string, isDark: boolean,
237243
border-radius: 3px;
238244
}
239245
240-
/* Code */
246+
/* Code - inline code should wrap */
241247
code {
242248
background-color: ${editorColors.codeBackground};
243249
color: ${editorColors.foreground};
244250
padding: 2px 6px;
245251
border-radius: 3px;
246252
font-family: 'Courier New', Courier, monospace;
247253
font-size: 14px;
248-
white-space: pre;
254+
white-space: pre-wrap;
255+
word-break: break-word;
249256
}
250257
251258
pre {

apps/mobile/v1/src/screens/ViewNote/NoteContent.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,16 @@ export function NoteContent({
153153
line-height: 1.6 !important;
154154
}
155155
156-
/* Code */
156+
/* Code - inline code should wrap */
157157
code {
158158
background-color: ${theme.isDark ? 'rgba(255, 255, 255, 0.08)' : theme.colors.muted};
159159
color: ${theme.colors.foreground};
160160
padding: 2px 6px;
161161
border-radius: 3px;
162162
font-family: 'Courier New', Courier, monospace;
163163
font-size: 14px;
164-
white-space: pre;
164+
white-space: pre-wrap;
165+
word-break: break-word;
165166
}
166167
167168
pre {
@@ -202,14 +203,20 @@ export function NoteContent({
202203
margin-top: 0 !important;
203204
}
204205
205-
/* Paragraphs - no margin so single line breaks don't look like double */
206+
/* Paragraphs - small bottom margin for visual separation between blocks */
206207
p {
207-
margin: 0;
208+
margin: 0 0 0.4em 0;
209+
}
210+
211+
/* Last paragraph shouldn't have bottom margin */
212+
p:last-child {
213+
margin-bottom: 0;
208214
}
209215
210216
/* Empty paragraphs should show as spacing (Tiptap uses <p></p> for blank lines) */
211217
p:empty {
212218
min-height: 1em;
219+
margin-bottom: 0;
213220
}
214221
215222
/* Headings */

0 commit comments

Comments
 (0)