mirror of
https://github.com/kognise/water.css.git
synced 2025-12-07 23:35:10 +01:00
Merge branch 'master' into master
This commit is contained in:
commit
22ef746db1
1 changed files with 3 additions and 7 deletions
10
script.js
10
script.js
|
|
@ -1,8 +1,4 @@
|
||||||
document.getElementById('switch').addEventListener('click', function() {
|
document.getElementById('switch').addEventListener('click', function() {
|
||||||
const stylesheet = document.getElementById('stylesheet')
|
const stylesheet = document.getElementById('stylesheet');
|
||||||
if (stylesheet.getAttribute('href') === 'dist/dark.min.css') {
|
stylesheet.href = stylesheet.href.replace(/dark|light/, function(replaced) { return replaced === 'dark' ? 'light' : 'dark' });
|
||||||
stylesheet.setAttribute('href', 'dist/light.min.css')
|
});
|
||||||
} else {
|
|
||||||
stylesheet.setAttribute('href', 'dist/dark.min.css')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue