Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit fd8fa65

Browse files
committed
Add theme color test.
1 parent 9494454 commit fd8fa65

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

common/test/theme-color/index.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: theme color
3+
layout: page
4+
favicon: gray
5+
background: gray
6+
---
7+
8+
<div id="content">
9+
<h1 style="font-size: 9vw;">
10+
<input id="color" type="color" name="color" value="#00e000">
11+
</h1>
12+
</div>
13+
14+
<div id="footer">
15+
This page allows setting a dynamic theme color.<br>
16+
The color defaults to bright green, and will update with the page background.
17+
</div>
18+
19+
<script>
20+
var themeColor = document.createElement("meta");
21+
themeColor.name = "theme-color";
22+
document.head.appendChild(themeColor);
23+
24+
var colorElem = document.querySelector("#color");
25+
var updateColor = function() {
26+
themeColor.content = colorElem.value;
27+
document.body.style.backgroundColor = colorElem.value;
28+
}
29+
30+
updateColor();
31+
colorElem.addEventListener("change", updateColor);
32+
</script>

0 commit comments

Comments
 (0)