surwiki/assets/test-themes.html

55 lines
2 KiB
HTML
Raw Normal View History

2018-07-10 09:46:51 +03:00
<!DOCTYPE html>
<html>
<head>
<title>Test themes &ndash; Sausagewiki</title>
<link href="themes.css" rel="stylesheet">
2018-07-16 09:30:29 +03:00
<link href="style.css" rel="stylesheet">
2018-07-10 09:46:51 +03:00
<style>
.themed {
padding: 10px;
background: var(--theme-main);
color: var(--theme-text);
}
.link {
color: var(--theme-link);
}
.proto {
display: none;
}
2018-08-31 22:30:46 +03:00
#bar {
display: flex;
width: 100%;
}
#bar>div {
height: 30px;
flex-grow: 1;
}
2018-07-10 09:46:51 +03:00
</style>
</head>
<body>
2018-08-31 22:30:46 +03:00
<div id="bar"></div>
2018-07-10 09:46:51 +03:00
<div class="proto">
2018-07-16 09:30:29 +03:00
<div class="themed">The <span class="link">quick</span> brown <span class="link">dog</span> jumps over the lazy log <span class="theme-name"></span></div>
<div class="themed"><input type=search placeholder=placeholder> <input type=search value="Bacon"></div>
2018-07-10 09:46:51 +03:00
</div>
<script>
const themes = ["red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "gray", "blue-gray"];
const body = document.querySelector("body");
const proto = document.querySelector(".proto");
for (theme of themes) {
const block = proto.cloneNode(true);
block.className = `theme-${theme}`;
2018-07-16 09:30:29 +03:00
block.querySelector(".theme-name").textContent = theme;
2018-07-10 09:46:51 +03:00
body.appendChild(block);
}
2018-08-31 22:30:46 +03:00
const bar = document.querySelector("#bar");
for (theme of themes) {
const block = document.createElement("div");
block.className = `theme-${theme} themed`;
bar.appendChild(block);
}
2018-07-10 09:46:51 +03:00
</script>
</body>
</html>