Search code examples
pythonhtmldjangotinymcedjango-tinymce

Using TinyMCE for sites with a dark background


I'm using django-tinymce in my Django website. Through the admin interface one can edit a SimplePage object which has a tinymce.models.HTMLField. The website visitor will then see the html rendered in the content area of the page.

Problem is, the website itself has a dark background, and the TinyMCE textarea has a white one. By default the text seems to have no color, which is okay (It appears as black in TinyMCE and as white in the website) but sometimes a black color is assigned to it and then it appears as black in the website, which makes it unreadable.

What's a good way to solve this?


Solution

  • You can customize the CSS of the editable area with the content_css setting, see: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_css

    This also works with django-tinymce, simply adjust TINYMCE_DEFAULT_CONFIG in your django settings:

    TINYMCE_DEFAULT_CONFIG = {
        # your other settings
        'content_css': '/media/css/main.css',
    }