migrated darkMode feature to js bundle
This commit is contained in:
parent
67c1f520d8
commit
28fbd7d906
10 changed files with 92 additions and 5565 deletions
22
assets/scripts/features/darkmode/darkreader.js
Normal file
22
assets/scripts/features/darkmode/darkreader.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { enable, disable, auto } from 'darkreader';
|
||||
import { darkmode } from "@params";
|
||||
|
||||
const {
|
||||
defaultColorScheme,
|
||||
theme,
|
||||
fixes,
|
||||
} = darkmode.darkreader;
|
||||
|
||||
export function setSchemeDark() {
|
||||
enable(theme, fixes);
|
||||
}
|
||||
|
||||
export function setSchemeLight() {
|
||||
disable();
|
||||
}
|
||||
|
||||
export function setSchemeSystem() {
|
||||
auto(theme, fixes);
|
||||
}
|
||||
|
||||
export { defaultColorScheme };
|
Loading…
Add table
Add a link
Reference in a new issue