Editor in dark mode

1 Answer 269 Views
Editor
Uwe
Top achievements
Rank 1
Uwe asked on 10 Dec 2021, 02:26 PM

Using the Kendo UI Editor successfully in my application, I recently try to implement a dark mode through an external library.

To my surprise, the editor itself seems to be not able to work correctly in dark mode in general.

I.e. I see dark font color on dark background.

Even the very own demos with the very own Telerik skins fail to work correctly. E.g.:

demos.telerik.com/kendo-ui/editor/index?autoRun=true&theme=material-main-dark

I found no way and no CSS to specify a light default text color.

My question:

How can I configure the Kendo UI Editor to correctly work with a dark background?

1 Answer, 1 is accepted

Sort by
1
Accepted
Yanislav
Telerik team
answered on 14 Dec 2021, 12:24 PM

Hello Uwe,

You can set the text color dynamically by using jQuery. Please review the following snippet:

  $(document).ready(function(){
    var editor = $("#editor").data("kendoEditor")
    editor.body.style.color = "white";
  })

When the page is loaded, by getting a reference to the Editor component, its options can be modified.

Here is a sample: https://netcorerepl.telerik.com/GlPGFykN41Ju5YQJ46

I hope this will help you to reach the desired behavior. 

Regards,
Yanislav
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Uwe
Top achievements
Rank 1
commented on 15 Dec 2021, 03:00 PM

This works perfectly. Thanks a lot, Yanislav 😊
Tags
Editor
Asked by
Uwe
Top achievements
Rank 1
Answers by
Yanislav
Telerik team
Share this question
or