Support automatic switching to dark skin in CKEditor and SimpleEditor

This commit is contained in:
Kijin Sung 2021-01-06 23:35:51 +09:00
parent c80a80f986
commit e7b49baf13
12 changed files with 41 additions and 4 deletions

View file

@ -33,18 +33,23 @@
}
.light_dark(@cs) when (@cs = moono-dark) {
background-color: #494949;
background-color: #333;
color: #fff;
}
.light_dark(@cs) when not (@cs = moono-dark) {
background-color: #fff;
color: #000;
&.color_scheme_dark {
background-color: #333;
color: #fff;
}
}
.light_dark_top(@cs) when (@cs = moono-dark) {
border-bottom-color: #1b1b1b;
}
.light_dark_top(@cs) when not (@cs = moono-dark) {
border-bottom-color: #555;
}
html {

View file

@ -92,11 +92,19 @@ var auto_saved_msg = "{$lang->msg_auto_saved}";
return val + "/" + val + "px";
}).join(";");
// Apply auto dark mode.
var editor_skin = '{$colorset}';
<!--@if($editor_auto_dark_mode)-->
if (getColorScheme() === 'dark') {
editor_skin = 'moono-dark';
}
<!--@endif-->
// Initialize CKEditor settings.
var settings = {
ckeconfig: {
height: '{$editor_height}',
skin: '{$colorset}',
skin: editor_skin,
contentsCss: {json_encode($css_file_list)},
xe_editor_sequence: {$editor_sequence},
font_defaultLabel: default_font_name,