11import modeOptions from './modeOptions'
22
33export function activateMode ( mode ) {
4- console . log ( mode )
54 const rootElement = document . querySelector ( ':root' )
65 const options = modeOptions [ mode ]
76
@@ -10,29 +9,6 @@ export function activateMode (mode) {
109 }
1110}
1211
13- export function activateDarkMode ( ) {
14- const rootElement = document . querySelector ( ':root' )
15- const darkTheme = {
16- '--background-color' : '#25272a' ,
17- '--box-shadow' : '0 1px 6px 0 rgba(0, 0, 0, .9)' ,
18- '--box-shadow-hover' : '0 2px 26px 0 rgba(0, 0, 0, .9)'
19- }
20- for ( const k in darkTheme ) {
21- rootElement . style . setProperty ( k , darkTheme [ k ] )
22- }
23- }
24-
25- export function activateLightMode ( ) {
26- const rootElement = document . querySelector ( ':root' )
27- const lightTheme = {
28- '--background-color' : '#fff' ,
29- '--box-shadow' : '0 1px 6px 0 rgba(0, 0, 0, 0.2)' ,
30- '--box-shadow-hover' : '0 2px 16px 0 rgba(0, 0, 0, 0.2)'
31- }
32- for ( const k in lightTheme ) {
33- rootElement . style . setProperty ( k , lightTheme [ k ] )
34- }
35- }
3612/**
3713 * Sets a color scheme for the website.
3814 * If browser supports "prefers-color-scheme" it will respect the setting for light or dark mode
0 commit comments