mirror of
https://github.com/picocss/pico.git
synced 2025-04-20 08:45:06 -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>',
|
dark: '<i>Turn off dark mode</i>',
|
||||||
},
|
},
|
||||||
buttonsTarget: '.theme-switcher',
|
buttonsTarget: '.theme-switcher',
|
||||||
localStorageKey: 'picoPreferedColorScheme',
|
localStorageKey: 'picoPreferredColorScheme',
|
||||||
|
|
||||||
// Init
|
// Init
|
||||||
init() {
|
init() {
|
||||||
|
@ -32,8 +32,8 @@ export const themeSwitcher = {
|
||||||
return this._scheme;
|
return this._scheme;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Prefered color scheme
|
// Preferred color scheme
|
||||||
get preferedColorScheme() {
|
get preferredColorScheme() {
|
||||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ export const themeSwitcher = {
|
||||||
// Set scheme
|
// Set scheme
|
||||||
set scheme(scheme) {
|
set scheme(scheme) {
|
||||||
if (scheme == 'auto') {
|
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') {
|
else if (scheme == 'dark' || scheme == 'light') {
|
||||||
this._scheme = scheme;
|
this._scheme = scheme;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue