Tutorial: Enable Dark Mode for the Block Editor
For those who use dark mode daily, it's not comfortable to write with Block Editor at night because it doesn't support Dark Mode.
If you want to add dark mode support, you can use custom CSS but you MUST enqueue the styles by using the
You can read about that hook on WP and this is a snippet that you can use right away to add dark mode to your block editor.
Hope this will be useful to you.
#Tip
For those who use dark mode daily, it's not comfortable to write with Block Editor at night because it doesn't support Dark Mode.
If you want to add dark mode support, you can use custom CSS but you MUST enqueue the styles by using the
enqueue_block_editor_assets action hook. You can read about that hook on WP and this is a snippet that you can use right away to add dark mode to your block editor.
Hope this will be useful to you.
#Tip
WordPress Developer Resources
enqueue_block_editor_assets – Hook | Developer.WordPress.org
Fires after block assets have been enqueued for the editing interface.
👍3