Skip to content

Commit 0544751

Browse files
committed
Lexical: Added some styling and tweaks for basic editors
1 parent 02a35b6 commit 0544751

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

resources/js/components/page-comments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class PageComments extends Component {
200200
this.formInput.parentElement?.appendChild(container);
201201
this.formInput.hidden = true;
202202

203-
this.wysiwygEditor = wysiwygModule.createBasicEditorInstance(container as HTMLElement, '', {
203+
this.wysiwygEditor = wysiwygModule.createBasicEditorInstance(container as HTMLElement, '<p></p>', {
204204
darkMode: document.documentElement.classList.contains('dark-mode'),
205205
textDirection: this.wysiwygTextDirection,
206206
translations: (window as unknown as Record<string, Object>).editor_translations,

resources/js/components/wysiwyg-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class WysiwygInput extends Component {
1313

1414
type WysiwygModule = typeof import('../wysiwyg');
1515
const wysiwygModule = (await window.importVersioned('wysiwyg')) as WysiwygModule;
16-
const container = el('div', {class: 'comment-editor-container'});
16+
const container = el('div', {class: 'basic-editor-container'});
1717
this.elem.parentElement?.appendChild(container);
1818
this.elem.hidden = true;
1919

resources/js/wysiwyg/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ export class SimpleWysiwygEditorInterface {
144144
}
145145

146146
remove() {
147-
this.context.editorDOM.remove();
148147
this.context.manager.teardown();
148+
this.context.containerDOM.remove();
149149
if (this.editorListenerTeardown) {
150150
this.editorListenerTeardown();
151151
}

resources/sass/_editor.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ body.editor-is-fullscreen {
5252
flex: 1;
5353
}
5454

55+
// Variation specific styles
56+
.comment-editor-container,
57+
.basic-editor-container {
58+
border-left: 1px solid #DDD;
59+
border-right: 1px solid #DDD;
60+
border-bottom: 1px solid #DDD;
61+
border-radius: 3px;
62+
@include mixins.lightDark(border-color, #DDD, #000);
63+
64+
.editor-toolbar-main {
65+
border-radius: 3px 3px 0 0;
66+
justify-content: end;
67+
}
68+
}
69+
70+
.basic-editor-container .editor-content-area {
71+
padding-bottom: 0;
72+
}
73+
5574
// Buttons
5675
.editor-button {
5776
font-size: 12px;

0 commit comments

Comments
 (0)