aboutsummaryrefslogtreecommitdiffstats
path: root/v8.0.0-beta.3/_static/changelog.js
diff options
context:
space:
mode:
authorGravatar ChrisLovering <[email protected]>2022-07-26 16:01:54 +0000
committerGravatar ChrisLovering <[email protected]>2022-07-26 16:01:54 +0000
commit6c17e8382c048c1e29c12b479e8e213a4fedec24 (patch)
tree8a226671170b09eac2311a8af96f7f7bd5636d44 /v8.0.0-beta.3/_static/changelog.js
parentDeploying to docs from @ python-discord/bot-core@1f309b695e21511173ced9c729f4... (diff)
Deploying to docs from @ python-discord/bot-core@20ed26e794c677205417a475b5d3719822e4bc4b 🚀
Diffstat (limited to 'v8.0.0-beta.3/_static/changelog.js')
-rw-r--r--v8.0.0-beta.3/_static/changelog.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/v8.0.0-beta.3/_static/changelog.js b/v8.0.0-beta.3/_static/changelog.js
new file mode 100644
index 00000000..94834eaa
--- /dev/null
+++ b/v8.0.0-beta.3/_static/changelog.js
@@ -0,0 +1,41 @@
+/** Update the changelog colors in dark mode */
+function changelog_color_main() {
+ const changelog = document.getElementById("changelog");
+
+ function updateEntryColor(span) {
+ const lightColorSpan = span;
+ const darkColorSpan = lightColorSpan.cloneNode(true);
+
+ lightColorSpan.parentElement.insertBefore(darkColorSpan, lightColorSpan);
+
+ lightColorSpan.classList.add("light");
+ darkColorSpan.classList.add("dark");
+
+ let color;
+ switch (darkColorSpan.textContent) {
+ case "Feature":
+ color = "#5BF38E";
+ break;
+ case "Support":
+ color = "#55A5E7";
+ break;
+ case "Bug":
+ color = "#E14F4F";
+ break;
+ default:
+ color = lightColorSpan.style.color;
+ }
+
+ darkColorSpan.style["color"] = color;
+ }
+
+ const TYPES = ["Feature", "Bug", "Support", "Breaking"];
+
+ if (changelog !== null) {
+ Array.from(changelog.getElementsByTagName("span"))
+ .filter(value => TYPES.includes(value.textContent))
+ .forEach(updateEntryColor)
+ }
+}
+
+changelog_color_main();