From 84960fdd44f895cee7155c1a4c34be6a5d420949 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sun, 8 Sep 2024 11:00:12 +0200 Subject: [PATCH] Implement dark mode --- tailwind.config.js | 1 + web/static/css/input.css | 53 ++++++++++++++++++++++++++++------------ web/templates/index.html | 45 +++++++++++++++++++++++++++++++--- 3 files changed, 81 insertions(+), 18 deletions(-) diff --git a/tailwind.config.js b/tailwind.config.js index 9e17d63..8e50921 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -7,4 +7,5 @@ module.exports = { plugins: [ require('@tailwindcss/typography') ], + darkMode: 'selector', } diff --git a/web/static/css/input.css b/web/static/css/input.css index 0f50437..462eb57 100644 --- a/web/static/css/input.css +++ b/web/static/css/input.css @@ -2,30 +2,21 @@ @tailwind components; @tailwind utilities; -body { - width: 800px; - @apply mx-auto text-slate-900; -} - h2 { @apply font-bold mb-2 text-2xl; } -form { - @apply flex flex-col gap-y-3; -} - -input[type="file"] { - @apply border rounded-md w-full; +h3 { + @apply font-bold mb-2 text-xl; } input[type="password"], input[type="text"] { - @apply border h-8 rounded-md; + @apply bg-slate-50 dark:bg-slate-950 border border-slate-200 dark:border-slate-800 h-8 rounded-md; } textarea { - @apply border h-32 rounded-md; + @apply bg-slate-50 dark:bg-slate-950 border border-slate-200 dark:border-slate-800 h-32 rounded-md; } .btn-area { @@ -33,9 +24,41 @@ textarea { } .btn { - @apply bg-slate-200 border my-2 px-3 py-2 rounded-md w-full hover:bg-slate-100; + @apply bg-slate-200 dark:bg-slate-800 hover:bg-slate-100 dark:hover:bg-slate-900 border border-slate-200 dark:border-slate-800 my-2 px-3 py-2 rounded-md w-full; } .action-btn { - @apply bg-slate-800 border my-2 px-3 py-2 rounded-md text-slate-50 w-full hover:bg-slate-700; + @apply bg-slate-800 dark:bg-slate-200 hover:bg-slate-700 dark:hover:bg-slate-300 my-2 px-3 py-2 rounded-md text-slate-50 dark:text-slate-950 w-full; +} + +.EasyMDEContainer .CodeMirror { + @apply bg-slate-50 dark:bg-slate-950 border-slate-200 dark:border-slate-800 text-slate-900 dark:text-slate-100 +} + +.EasyMDEContainer .cm-s-easymde .CodeMirror-cursor { + @apply border-slate-900 dark:border-slate-100 +} + +.EasyMDEContainer .editor-toolbar > * { + @apply text-slate-900 dark:text-slate-100 +} + +.EasyMDEContainer .editor-toolbar > .active, .editor-toolbar > button:hover, .editor-preview pre, .cm-s-easymde .cm-comment { + @apply bg-slate-100 dark:bg-slate-900 +} + +.EasyMDEContainer .CodeMirror-fullscreen { + @apply bg-slate-50 dark:bg-slate-950 +} + +.editor-toolbar { + @apply border border-slate-200 +} + +.editor-toolbar.fullscreen { + @apply bg-slate-50 dark:bg-slate-950 +} + +.editor-preview { + @apply bg-slate-50 dark:bg-slate-950 } diff --git a/web/templates/index.html b/web/templates/index.html index 47c8574..4014f49 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -5,13 +5,26 @@ Orient Editor + - +

Orient Editor

+ +
+ + +
@@ -20,18 +33,44 @@
-