mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Return to auto-detected color scheme if manually set color scheme is removed
This commit is contained in:
parent
380f779301
commit
a4f698c9c6
1 changed files with 2 additions and 0 deletions
|
|
@ -788,6 +788,8 @@ function setColorScheme(color_scheme) {
|
|||
XE.cookie.set('rx_color_scheme', color_scheme, { path: window.XE.URI(default_url).pathname(), expires: 365 });
|
||||
} else {
|
||||
XE.cookie.remove('rx_color_scheme', { path: window.XE.URI(default_url).pathname() });
|
||||
color_scheme = (window.matchMedia && window.matchMedia('(prefers-color-scheme:dark)').matches) ? 'dark' : 'light';
|
||||
$('body').addClass('color_scheme_' + color_scheme).removeClass('color_scheme_' + (color_scheme === 'dark' ? 'light' : 'dark'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue