将 TinyMCE 用于深色背景的网站
我在 Django 网站中使用 django-tinymce。通过管理界面,我们可以编辑一个具有 tinymce.models.HTMLField
的 SimplePage 对象。然后,网站访问者将看到页面内容区域中呈现的 html。
问题是,网站本身的背景是深色的,而 TinyMCE 文本区域的背景是白色的。默认情况下,文本似乎没有颜色,这没关系(在 TinyMCE 中显示为黑色,在网站中显示为白色),但有时会为它指定黑色,然后在网站中显示为黑色,这使得它无法阅读。
有什么好的方法可以解决这个问题吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
content_css
设置自定义可编辑区域的 CSS,请参阅:http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_css这也适用于 django-tinymce,只需在 django 设置中调整
TINYMCE_DEFAULT_CONFIG
:You can customize the CSS of the editable area with the
content_css
setting, see: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_cssThis also works with django-tinymce, simply adjust
TINYMCE_DEFAULT_CONFIG
in your django settings:通常在富文本编辑器中,您将指定一个样式表(原始页面的样式表或其变体)作为编辑器的样式表。这样,所有基本文本特征(大小、系列、颜色和背景颜色)都是所见即所得。
我认为就是这样:
Usually in a Rich Text Editor, you would specify a style sheet (the original page's style sheet or a variation of it) as the style sheet for the editor. That way, all the basic text characteristics (size, family, colour and background colour) are really What You See Is What You Get.
I think this is it: