mirror of
https://github.com/picocss/pico.git
synced 2025-04-22 09:26:14 -04:00
Improvements
- Add .contrast variant - Separate _button-styles.scss - Edit .secondary, mark, figcaption, hgroup, tooltips - Docs: Add More about grids, External links icon, Second theme switcher
This commit is contained in:
parent
066c0a04fd
commit
73237bdcd4
26 changed files with 516 additions and 229 deletions
2
docs/js/pico.docs.min.js
vendored
2
docs/js/pico.docs.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -14,12 +14,12 @@
|
|||
var switcher = {
|
||||
button: {
|
||||
element: 'BUTTON',
|
||||
class: 'secondary switcher',
|
||||
class: 'contrast switcher theme-switcher',
|
||||
on: '<i>Turn on dark mode</i>',
|
||||
off: '<i>Turn off dark mode</i>'
|
||||
},
|
||||
target: 'body', // Button append in target
|
||||
selector: 'button.switcher', // Button selector in Dom
|
||||
selector: 'button.theme-switcher', // Button selector in Dom
|
||||
currentTheme: systemColorScheme()
|
||||
};
|
||||
|
||||
|
@ -65,17 +65,21 @@
|
|||
setTheme(switcher.currentTheme);
|
||||
|
||||
// Click Listener on Switcher
|
||||
document.querySelector(switcher.selector).addEventListener('click', function() {
|
||||
var switchers = document.querySelectorAll(switcher.selector);
|
||||
console.log(switchers);
|
||||
for (var i = 0; i < switchers.length; i++) {
|
||||
switchers[i].addEventListener('click', function(event) {
|
||||
|
||||
// Switch Theme
|
||||
if (switcher.currentTheme == 'light') {
|
||||
setTheme('dark');
|
||||
}
|
||||
else {
|
||||
setTheme('light');
|
||||
}
|
||||
}, false);
|
||||
// Switch Theme
|
||||
if (switcher.currentTheme == 'light') {
|
||||
setTheme('dark');
|
||||
}
|
||||
else {
|
||||
setTheme('light');
|
||||
}
|
||||
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue