Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix distill dark mode again #517

Merged
merged 1 commit into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion _layouts/distill.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{% include scripts/mathjax.html %}
<script src="{{ '/assets/js/distillpub/template.v2.js' | relative_url }}"></script>
<script src="{{ '/assets/js/distillpub/transforms.v2.js' | relative_url }}"></script>
<script src="{{ '/assets/js/distillpub/overrides.js' | relative_url }}"></script>
{% if page._styles %}
<style type="text/css">
{{ page._styles }}
Expand Down Expand Up @@ -104,4 +103,7 @@ <h3>Contents</h3>
<d-bibliography src="{{ page.bibliography | prepend: '/assets/bibliography/' | relative_url }}">
</d-bibliography>

{% include scripts/jquery.html %}
<script src="{{ '/assets/js/distillpub/overrides.js' | relative_url }}"></script>

</html>
14 changes: 9 additions & 5 deletions _sass/_distill.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ d-article {
width: calc(max(70%, 300px));
margin-right: 0px;
margin-top: 0em;
display: grid;
grid-template-columns:
minmax(8px, 1fr) [toc] auto
display: grid;
grid-template-columns:
minmax(8px, 1fr) [toc] auto
minmax(8px, 1fr) [toc-line] 1px
minmax(32px, 2fr);
nav {

nav {
grid-column: toc;
a {
border-bottom: none !important;
Expand Down Expand Up @@ -87,6 +87,10 @@ d-article {
grid-column: toc-line;
}
}

d-footnote {
scroll-margin-top: 66px;
}
}

d-appendix {
Expand Down
4 changes: 4 additions & 0 deletions assets/js/distillpub/overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $(document).ready(function() {
.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) {
Expand All @@ -16,5 +18,7 @@ $(document).ready(function() {
.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;}");
});
})