Notifications
Clear all

How to change the color of the TinyMCE editor?

34 Posts
6 Users
6 Reactions
997 Views
Posts: 51
 guts
Topic starter
(@guts)
Trusted Member
Joined: 6 months ago

How to change the background color of the TinyMCE editor?

https://imgur.com/wTch5kN

33 Replies
Tutrix
Posts: 1357
(@tutrix)
Noble Member
Joined: 4 years ago

@guts 

tinymce.dom.DOMUtils

Example

<script type="text/javascript">
    jQuery(window).load(function() {
        tinyMCE.activeEditor.dom.addStyle('body{background-color:#000000 !important; color:#dddddd !important;}');
    });
</script>
Reply
3 Replies
 guts
(@guts)
Joined: 6 months ago

Trusted Member
Posts: 51

@tutrix Thanks for your reply but where do I add this code?

Reply
BlackRaz
Admin
(@blackraz)
Joined: 8 years ago

Contributor
Posts: 406

@guts 
You can try this plugin:
https://wordpress.org/plugins/code-snippets/

Reply
 guts
(@guts)
Joined: 6 months ago

Trusted Member
Posts: 51

@blackraz Thank you, I downloaded another free version.

However, I only wish to modify the background-color on the dark version of the forum.
Is it feasible to make this change using CSS?

Reply
Posts: 51
 guts
Topic starter
(@guts)
Trusted Member
Joined: 6 months ago

Additionally, I only wish to modify the background-color on the dark version of the forum.
Is it feasible to make this change using CSS?

Reply
Posts: 126
(@cotner)
Estimable Member
Joined: 2 years ago

I am interested in the same modification. Being able to change the background color based on light or dark mode.

Reply
Tutrix
Posts: 1357
(@tutrix)
Noble Member
Joined: 4 years ago

Posted by: @guts

Is it feasible to make this change using CSS?

If you use WP Dark Mode, you have new CSS classes.
e.g. wp-dark-mode, wp-dark-mode-ignore, --wp-dark-mode-inline, etc.

you can check with the browser developer tools, which will then be used for the editor.

I don't use the dark mode plugin, so I can't help you.

just as an example, probably not working

<script type="text/javascript">
    jQuery(window).load(function() {
        tinyMCE.activeEditor.dom.addStyle('.wp-dark-mode body{background-color:#000000 !important; color:#dddddd !important;}');
    });
</script>
Reply
1 Reply
 guts
(@guts)
Joined: 6 months ago

Trusted Member
Posts: 51

@tutrix I don't find the class. 😐 

I added my forum on my signature if you can help?

I tried with this code but it doesn't work: 

<script type="text/javascript">
    jQuery(window).load(function() {
        tinyMCE.activeEditor.dom.addStyle('.darklup-dark-mode-enabled #wpforo #wpforo-wrap .wpf-field .wpf-field-wrap .mce-tinymce.mce-container.mce-panel{background-color:#15202b !important; color:#ced9e6 !important;}');
    });
</script>

 

Reply
Page 1 / 3