summaryrefslogtreecommitdiff
path: root/assets/js/distillpub/overrides.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/distillpub/overrides.js')
-rw-r--r--assets/js/distillpub/overrides.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/assets/js/distillpub/overrides.js b/assets/js/distillpub/overrides.js
new file mode 100644
index 0000000..7e4dba7
--- /dev/null
+++ b/assets/js/distillpub/overrides.js
@@ -0,0 +1,20 @@
+$(document).ready(function() {
+ // Override styles of the footnotes.
+ document.querySelectorAll("d-footnote").forEach(function(footnote) {
+ footnote.shadowRoot.querySelector("sup > span")
+ .setAttribute("style", "color: var(--global-theme-color);");
+ footnote.shadowRoot.querySelector("d-hover-box").shadowRoot.querySelector("style").sheet
+ .insertRule(".panel {background-color: var(--global-bg-color) !important;}");
+ });
+ // Override styles of the citations.
+ document.querySelectorAll("d-cite").forEach(function(cite) {
+ cite.shadowRoot.querySelector("div > span")
+ .setAttribute("style", "color: var(--global-theme-color);");
+ cite.shadowRoot.querySelector("style").sheet
+ .insertRule("ul li a {color: var(--global-text-color) !important; text-decoration: none;}");
+ cite.shadowRoot.querySelector("style").sheet
+ .insertRule("ul li a:hover {color: var(--global-theme-color) !important;}");
+ cite.shadowRoot.querySelector("d-hover-box").shadowRoot.querySelector("style").sheet
+ .insertRule(".panel {background-color: var(--global-bg-color) !important;}");
+ });
+}) \ No newline at end of file