pages/assets/js/distillpub/overrides.js
Maruan beb6f27d59
format code with prettier.io (#2048)
summary:
- adds prettier formatter configuration
- formats the entire repo using prettier, ignoring minified files
(`*.min.css`) and heavy generated html
- changes extensions of all `.html` files to `.liquid`, which is more
correct and necessary for prettier to work correctly
- replaces "%-" and "-%" with just "%" — manual liquid formatting using
minus signs is superfluous since we are compressing and minifying the
code anyway
- adds CI action for running prettier check on PR and pushes to master
2024-01-10 00:10:51 -05:00

29 lines
1.5 KiB
JavaScript

$(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;}");
footnote.shadowRoot
.querySelector("d-hover-box")
.shadowRoot.querySelector("style")
.sheet.insertRule(".panel {border-color: var(--global-divider-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;}");
cite.shadowRoot
.querySelector("d-hover-box")
.shadowRoot.querySelector("style")
.sheet.insertRule(".panel {border-color: var(--global-divider-color) !important;}");
});
});