Skip to content

Commit 65077bb

Browse files
committed
feat: improve note rtl support
1 parent 26ef3dd commit 65077bb

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

src/components/Notes/NoteCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
</NcActionButton>
2525
</NcActions>
2626
</div>
27-
<h3 class="note-card__title">{{ note.title }}</h3>
28-
<div v-if="note.content" class="note-card__content">
27+
<h3 class="note-card__title" dir="auto">{{ note.title }}</h3>
28+
<div v-if="note.content" class="note-card__content" dir="auto">
2929
<NcRichText :text="note.content" :use-markdown="true" :use-extended-markdown="true" />
3030
</div>
3131
</div>

src/components/Notes/NoteDialog.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
v-model="titleValue"
1616
:placeholder="strings.titlePlaceholder"
1717
class="note-dialog__title-input"
18+
dir="auto"
1819
/>
19-
<h2 v-else class="note-dialog__title-text" @click="startEditing('title')">
20+
<h2 v-else class="note-dialog__title-text" dir="auto" @click="startEditing('title')">
2021
{{ titleValue || strings.untitled }}
2122
</h2>
2223

@@ -29,12 +30,14 @@
2930
:max-height="MAX_TEXTAREA_HEIGHT"
3031
:rows="3"
3132
class="note-dialog__content-input"
33+
dir="auto"
3234
autocomplete="off"
3335
/>
3436
<div
3537
v-else
3638
ref="renderedContentRef"
3739
class="note-dialog__content"
40+
dir="auto"
3841
@click="startEditing('content')"
3942
>
4043
<div v-if="contentValue" class="note-dialog__rendered">
@@ -324,6 +327,9 @@ const strings = {
324327
font-size: 1.3rem;
325328
font-weight: 600;
326329
margin: 0;
330+
// Reserve space on the right edge so the title (especially RTL-aligned
331+
// text) doesn't collide with the dialog close button.
332+
padding-right: var(--default-clickable-area, 44px);
327333
cursor: text;
328334
line-height: 1.3;
329335
text-align: start;
@@ -348,9 +354,12 @@ const strings = {
348354
box-shadow: none !important;
349355
background: transparent !important;
350356
color: inherit !important;
351-
padding: 0 !important;
357+
// Reserve space on the right edge so the close button doesn't overlap
358+
// the text — needed especially when the input content is RTL.
359+
padding: 0 var(--default-clickable-area, 44px) 0 0 !important;
352360
margin: 0 !important;
353361
font-family: inherit !important;
362+
box-sizing: border-box !important;
354363
}
355364
356365
&__title-input::placeholder {
@@ -428,12 +437,13 @@ const strings = {
428437
429438
&--none {
430439
background: var(--color-background-hover);
431-
// Diagonal line to indicate "no color"
440+
// Diagonal red line to indicate "no color" (uses a fixed pure red so it
441+
// stays visible in both light and dark themes).
432442
background-image: linear-gradient(
433443
135deg,
434444
transparent 40%,
435-
var(--color-error, #e00) 40%,
436-
var(--color-error, #e00) 60%,
445+
#ff0000 40%,
446+
#ff0000 60%,
437447
transparent 60%
438448
);
439449
background-size: 100% 100%;

0 commit comments

Comments
 (0)