mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
관리자가 모든 모듈의 다크모드 설정을 제어하도록 합니다. (#1558)
* 관리자가 다크모드 작동 여부를 선택할 수 있도록 수정
This commit is contained in:
parent
b7856e5683
commit
899fe00dda
9 changed files with 75 additions and 9 deletions
|
|
@ -351,10 +351,13 @@ jQuery(function($) {
|
|||
|
||||
/* Detect color scheme */
|
||||
var body_element = $('body');
|
||||
var color_scheme_cookie = XE.cookie.get('rx_color_scheme');
|
||||
var color_scheme_detected = (window.matchMedia && window.matchMedia('(prefers-color-scheme:dark)').matches) ? 'dark' : 'light';
|
||||
if (!color_scheme_cookie || (!body_element.hasClass('color_scheme_light') && !body_element.hasClass('color_scheme_dark'))) {
|
||||
body_element.addClass('color_scheme_' + color_scheme_detected).removeClass('color_scheme_' + (color_scheme_detected === 'dark' ? 'light' : 'dark'));
|
||||
/* If there is color_scheme class in the body, color scheme settings were already applied. */
|
||||
if(!body_element.hasClass('color_scheme_light') && !body_element.hasClass('color_scheme_dark')) {
|
||||
var color_scheme_cookie = XE.cookie.get('rx_color_scheme');
|
||||
var color_scheme_detected = (window.matchMedia && window.matchMedia('(prefers-color-scheme:dark)').matches) ? 'dark' : 'light';
|
||||
if (!color_scheme_cookie) {
|
||||
body_element.addClass('color_scheme_' + color_scheme_detected).removeClass('color_scheme_' + (color_scheme_detected === 'dark' ? 'light' : 'dark'));
|
||||
}
|
||||
}
|
||||
|
||||
/* Editor preview replacement */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue