mirror of
https://github.com/picocss/pico.git
synced 2025-04-21 09:06:14 -04:00
Fix typo in theme-switcher.js
Prefered -> Preferred
This commit is contained in:
parent
3052db4bd3
commit
61be7a852a
1 changed files with 4 additions and 4 deletions
|
@ -14,7 +14,7 @@ export const themeSwitcher = {
|
|||
dark: '<i>Turn off dark mode</i>',
|
||||
},
|
||||
buttonsTarget: '.theme-switcher',
|
||||
localStorageKey: 'picoPreferedColorScheme',
|
||||
localStorageKey: 'picoPreferredColorScheme',
|
||||
|
||||
// Init
|
||||
init() {
|
||||
|
@ -32,8 +32,8 @@ export const themeSwitcher = {
|
|||
return this._scheme;
|
||||
},
|
||||
|
||||
// Prefered color scheme
|
||||
get preferedColorScheme() {
|
||||
// Preferred color scheme
|
||||
get preferredColorScheme() {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
},
|
||||
|
||||
|
@ -57,7 +57,7 @@ export const themeSwitcher = {
|
|||
// Set scheme
|
||||
set scheme(scheme) {
|
||||
if (scheme == 'auto') {
|
||||
this.preferedColorScheme == 'dark' ? this._scheme = 'dark' : this._scheme = 'light';
|
||||
this.preferredColorScheme == 'dark' ? this._scheme = 'dark' : this._scheme = 'light';
|
||||
}
|
||||
else if (scheme == 'dark' || scheme == 'light') {
|
||||
this._scheme = scheme;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue