-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to enable dark mode detection? #375
Comments
I think it would be acceptable to use those code lines in our own |
I am guessing this is the file and function that you are suggesting we change: https://github.com/jazzband/django-tinymce/blob/master/tinymce/static/django_tinymce/init_tinymce.js Something like this?
In this example, we're adding the skin and content_css options to the default configuration object passed to the tinyMCE.init() function. The skin option sets the skin to use for the editor, based on the user's preferred color scheme (oxide-dark for dark mode, and the default skin for light mode). The content_css option sets the CSS file to use for styling the contents of the editor, also based on the user's preferred color scheme (dark for dark mode, and the default CSS file for light mode). Note that if you're using a custom configuration object instead of the default one, you'll need to add these options to your own configuration object instead. We might be able to use code from SilviaAmAm's connected PR. |
I saw on this document that there is a way to detect dark mode in javascript and apply a specific
skin
andcontent_css
.https://www.tiny.cloud/blog/dark-mode-tinymce-rich-text-editor/
I'm not sure how to do it as part of this package since it only takes a dict and doesn't seem to process the values client-side. Is there some easy pattern I'm missing or maybe just a way to have it pass these dark mode detection values to the init?
The text was updated successfully, but these errors were encountered: