diff --git a/test.css b/test.css
index c7e2917..fcb78a1 100644
--- a/test.css
+++ b/test.css
@@ -29,3 +29,12 @@ padding: 10px;
.tabs > div {
padding: 10px;
}
+
+body {
+background-color: white;
+color: black;
+}
+body.dark {
+background-color: black;
+color: white;
+}
diff --git a/test.html b/test.html
index ea79488..982a6e6 100644
--- a/test.html
+++ b/test.html
@@ -12,6 +12,7 @@
Tabs
+Dark
- test.html
- test.html?tab=2/3
diff --git a/test.js b/test.js
index ca31308..b482e7c 100644
--- a/test.js
+++ b/test.js
@@ -6,16 +6,13 @@ function check(tab) {
document.getElementById(path).checked = true
}
}
-
function push(tab) {
window.history.pushState(null, null, `?tab=${tab}`)
}
-
function update(id) {
const tab = id.split('/').slice(1).join('/')
push(tab)
}
-
function main() {
let tab = (new URL(document.location)).searchParams.get('tab')
if (tab) {
@@ -26,3 +23,7 @@ function main() {
push(tab)
}
}
+
+function swap() {
+ document.body.classList.toggle('dark')
+}