easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Dark Background?

Open httpjamesm opened this issue 3 years ago • 8 comments

How do I set my background to another color using CSS/JS? The other dark mode thread did not help me.

httpjamesm avatar May 02 '21 23:05 httpjamesm

I would like it too!

lexterror avatar May 08 '21 22:05 lexterror

Anyone find a solution for this?

CaptainStealthy avatar Aug 03 '21 23:08 CaptainStealthy

I was able to work around the issue with the following CSS... I'm posting this with the disclaimer that I am not skilled with CSS/design (think the famous Peter Griffin GIF...) whatsoever, so feel free to modify this snippet if I've written it like an idiot.

It may look hacky to those more skilled than I, but it works for my purposes. 😝

(replace my scss color variables with your own color vars/color codes as you see fit)

.EasyMDEContainer {
    background-color: $gray-800 !important;
}

.CodeMirror, .editor-preview {
    color: $white !important;
    border-color: $gray-600 !important;
    background-color: $gray-800 !important;
}

.cm-s-easymde .CodeMirror-cursor {
    border-color: $gray-600 !important;
}

.editor-toolbar button i {
    color: $white !important;
}

.editor-toolbar button.active, .editor-toolbar button:hover {
    background-color: $blue !important; // Fixes toolbar buttons from appearing as white when hovered or selected
}

.editor-preview pre {
    background-color: #333 !important; // This fixes code blocks in Markdown appearing with a white background
}

CaptainStealthy avatar Aug 04 '21 16:08 CaptainStealthy

@CaptainStealthy This worked surprisingly well. One thing I changed was to not set the EasyMDEContainer background because that would also include the background of the status bar at the bottom.

chrisspiegl avatar Feb 10 '22 19:02 chrisspiegl

How to change the text selection background color?

jjxtra avatar Oct 06 '22 17:10 jjxtra

Use the ::selection selector: https://developer.mozilla.org/en-US/docs/Web/CSS/::selection

Ionaru avatar Oct 06 '22 20:10 Ionaru

Thanks!

jjxtra avatar Oct 10 '22 14:10 jjxtra