Add test page for themes
This commit is contained in:
parent
963d70ff7a
commit
c201bb4bc4
2 changed files with 36 additions and 0 deletions
35
assets/test-themes.html
Normal file
35
assets/test-themes.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test themes – Sausagewiki</title>
|
||||
<link href="themes.css" rel="stylesheet">
|
||||
<style>
|
||||
.themed {
|
||||
padding: 10px;
|
||||
background: var(--theme-main);
|
||||
color: var(--theme-text);
|
||||
}
|
||||
.link {
|
||||
color: var(--theme-link);
|
||||
}
|
||||
.proto {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="proto">
|
||||
<div class="themed">The <span class="link">quick</span> brown <span class="link">dog</span> jumps over the lazy log</div>
|
||||
</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}`;
|
||||
body.appendChild(block);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -82,6 +82,7 @@ fn fs_lookup(root: &str, path: &str) ->
|
|||
let extension = path.rsplitn(2, ".").next();
|
||||
|
||||
let content_type = match extension {
|
||||
Some("html") => "text/html",
|
||||
Some("css") => "text/css",
|
||||
Some("js") => "application/javascript",
|
||||
Some("woff") => "application/font-woff",
|
||||
|
|
Loading…
Reference in a new issue