agusmakmun / django-markdown-editor

Awesome Django Markdown Editor, supported for Bootstrap & Semantic-UI
GNU General Public License v3.0
826 stars 1.34k forks source link

Broken preview when using dark theme (Mac) #250

Open baidyprod opened 5 months ago

baidyprod commented 5 months ago

Preview mode is broken on both bootstrap/semantic when system is using dark mode.

Screenshot 2024-06-28 at 03 06 15 Screenshot 2024-06-28 at 03 07 06

Details

Steps to reproduce

  1. Switch to dark mode on your Mac system.
  2. Use Martor widget in your project.
ndjman7 commented 4 months ago

In martor/css/martor-admin.css, because of the prefers-colour-scheme: dark option This is being affected by the operating system's settings.

To fix it, you can add MARTOR_ENABLE_ADMIN_CSS = False to settings.py to make the CSS slightly broken.

But fundamentally, it needs to be improved to match Django's code.

HlebKrah commented 3 months ago

Better temp fix:

create /static/admin/custom.css and put .main-martor { color: #000 !important; }

add to admin class:

class Media:
    css = {'all': ('admin/custom.css',),}