From f874b3507dcf731175c9ee3f945203f4672f014e Mon Sep 17 00:00:00 2001 From: Yash Kanakiya <76934250+yashkanakiya@users.noreply.github.com> Date: Tue, 28 Mar 2023 15:58:36 +0530 Subject: [PATCH] add dark mode in baseEditor (#1180) --- .../base/base-editor/BaseEditor.vue | 104 ++++++++++++------ 1 file changed, 69 insertions(+), 35 deletions(-) diff --git a/resources/scripts/components/base/base-editor/BaseEditor.vue b/resources/scripts/components/base/base-editor/BaseEditor.vue index 3a781a2d..6ec464ad 100644 --- a/resources/scripts/components/base/base-editor/BaseEditor.vue +++ b/resources/scripts/components/base/base-editor/BaseEditor.vue @@ -16,13 +16,15 @@ text-left bg-white border border-gray-200 + dark:border-gray-600 rounded-md min-h-[200px] overflow-hidden + dark:bg-gray-700 dark:text-white " >
-
+
-
+
@@ -69,8 +72,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('italic') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('italic') }" @click="editor.chain().focus().toggleItalic().run()" > @@ -85,8 +89,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('strike') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('strike') }" @click="editor.chain().focus().toggleStrike().run()" > @@ -101,8 +106,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('code') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('code') }" @click="editor.chain().focus().toggleCode().run()" > @@ -117,8 +123,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('paragraph') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('paragraph') }" @click="editor.chain().focus().setParagraph().run()" > @@ -133,9 +140,10 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " :class="{ - 'bg-gray-200': editor.isActive('heading', { level: 1 }), + 'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 1 }), }" @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" > @@ -151,9 +159,10 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " :class="{ - 'bg-gray-200': editor.isActive('heading', { level: 2 }), + 'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 2 }), }" @click="editor.chain().focus().toggleHeading({ level: 2 }).run()" > @@ -169,9 +178,10 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " :class="{ - 'bg-gray-200': editor.isActive('heading', { level: 3 }), + 'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 3 }), }" @click="editor.chain().focus().toggleHeading({ level: 3 }).run()" > @@ -188,8 +198,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('bulletList') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('bulletList') }" @click="editor.chain().focus().toggleBulletList().run()" > @@ -204,8 +215,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('orderedList') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('orderedList') }" @click="editor.chain().focus().toggleOrderedList().run()" > @@ -220,8 +232,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('blockquote') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('blockquote') }" @click="editor.chain().focus().toggleBlockquote().run()" > @@ -236,8 +249,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('codeBlock') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('codeBlock') }" @click="editor.chain().focus().toggleCodeBlock().run()" > @@ -252,8 +266,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('undo') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('undo') }" @click="editor.chain().focus().undo().run()" > @@ -268,8 +283,9 @@ rounded-sm cursor-pointer hover:bg-gray-100 + dark:hover:bg-gray-800 " - :class="{ 'bg-gray-200': editor.isActive('redo') }" + :class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('redo') }" @click="editor.chain().focus().redo().run()" > @@ -277,7 +293,7 @@
-