Fix: Improve footnote and citation colors in Distill posts (#3172)
Fixes #3168. (Implemented by [jules.google](https://jules.google).) This commit resolves issues with footnote and citation styling in Distill posts, particularly ensuring that pop-up contents and the numbers themselves respect the site's light/dark theme via shadow DOM style definitions. Key changes: 1. **`d-hover-box` Internal Styling (template.v2.js):** The `<style>` tag within the `d-hover-box` component's template in `assets/js/distillpub/template.v2.js` has been updated. Styles for `.panel` (the main pop-up container) now define: - `background-color: var(--global-card-bg-color);` - `border: 1px solid var(--global-divider-color);` - `color: var(--global-text-color);` (for default text) - Links within the panel are styled with `color: var(--global-theme-color);` and `color: var(--global-hover-color);` on hover. This ensures pop-up content is correctly themed from within its shadow DOM. 2. **Footnote/Citation Number Color (template.v2.js):** The hardcoded `hsla(206, 90%, 20%, 0.7)` color previously used for footnote numbers (in `d-footnote` template) and citation numbers (in `d-cite` template) in `assets/js/distillpub/template.v2.js` has been replaced with `color: var(--global-theme-color);`. 3. **Cleaned `_sass/_distill.scss`:** Removed the (now redundant) global CSS overrides for `d-hover-box` from `_sass/_distill.scss`, as these styles are now correctly encapsulated within the `d-hover-box` component itself. These changes ensure that all aspects of Distill footnotes and citations (numbers, pop-up background, pop-up text, and links within pop-ups) are styled using theme-aware CSS variables, providing correct visual appearance and readability in both light and dark modes. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
parent
dad01a8acd
commit
71969cce7e
2
FAQ.md
2
FAQ.md
@ -3,6 +3,7 @@
|
||||
Here are some frequently asked questions. If you have a different question, please check if it was not already answered in the Q&A section of the [GitHub Discussions](https://github.com/alshedivat/al-folio/discussions/categories/q-a). If not, feel free to ask a new question there.
|
||||
|
||||
<!--ts-->
|
||||
|
||||
- [Frequently Asked Questions](#frequently-asked-questions)
|
||||
- [After I create a new repository from this template and setup the repo, I get a deployment error. Isn't the website supposed to correctly deploy automatically?](#after-i-create-a-new-repository-from-this-template-and-setup-the-repo-i-get-a-deployment-error-isnt-the-website-supposed-to-correctly-deploy-automatically)
|
||||
- [I am using a custom domain (e.g., foo.com). My custom domain becomes blank in the repository settings after each deployment. How do I fix that?](#i-am-using-a-custom-domain-eg-foocom-my-custom-domain-becomes-blank-in-the-repository-settings-after-each-deployment-how-do-i-fix-that)
|
||||
@ -20,6 +21,7 @@ Here are some frequently asked questions. If you have a different question, plea
|
||||
- [How can I update Tabler Icons version on the template](#how-can-i-update-tabler-icons-version-on-the-template)
|
||||
- [What do all these GitHub actions/workflows mean?](#what-do-all-these-github-actionsworkflows-mean)
|
||||
- [How can I use Google Search Console ID on the template?](#how-can-i-use-google-search-console-id-on-the-template)
|
||||
|
||||
<!--te-->
|
||||
|
||||
## After I create a new repository from this template and setup the repo, I get a deployment error. Isn't the website supposed to correctly deploy automatically?
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# Installing and Deploying
|
||||
|
||||
<!--ts-->
|
||||
|
||||
- [Installing and Deploying](#installing-and-deploying)
|
||||
- [Recommended Approach](#recommended-approach)
|
||||
- [Local setup on Windows](#local-setup-on-windows)
|
||||
@ -18,6 +19,7 @@
|
||||
- [Deployment to another hosting server (non GitHub Pages)](#deployment-to-another-hosting-server-non-github-pages)
|
||||
- [Deployment to a separate repository (advanced users only)](#deployment-to-a-separate-repository-advanced-users-only)
|
||||
- [Upgrading from a previous version](#upgrading-from-a-previous-version)
|
||||
|
||||
<!--te-->
|
||||
|
||||
## Recommended Approach
|
||||
|
||||
@ -39,7 +39,7 @@ int main(int argc, char const \*argv[])
|
||||
}
|
||||
```
|
||||
|
||||
For displaying code in a list item, you have to be aware of the indentation, as stated in this [Stackoverflow answer](https://stackoverflow.com/questions/34987908/embed-a-code-block-in-a-list-item-with-proper-indentation-in-kramdown/38090598#38090598). You must indent your code by **(3 \* bullet_indent_level)** spaces. This is because kramdown (the markdown engine used by Jekyll) indentation for the code block in lists is determined by the column number of the first non-space character after the list item marker. For example:
|
||||
For displaying code in a list item, you have to be aware of the indentation, as stated in [this FAQ](https://github.com/planetjekyll/quickrefs/blob/master/FAQ.md#q-how-can-i-get-backtick-fenced-code-blocks-eg--working-inside-lists-with-kramdown). You must indent your code by **(3 \* bullet_indent_level)** spaces. This is because kramdown (the markdown engine used by Jekyll) indentation for the code block in lists is determined by the column number of the first non-space character after the list item marker. For example:
|
||||
|
||||
````markdown
|
||||
1. We can put fenced code blocks inside nested bullets, too.
|
||||
|
||||
@ -132,6 +132,20 @@ d-article {
|
||||
|
||||
d-footnote {
|
||||
scroll-margin-top: 66px;
|
||||
color: var(--global-theme-color) !important; /* Footnote text color */
|
||||
&:hover {
|
||||
color: var(--global-hover-color) !important; /* Footnote hover color */
|
||||
}
|
||||
}
|
||||
|
||||
/* Citations */
|
||||
d-cite a,
|
||||
a.citation {
|
||||
/* Target citations within d-cite and also general .citation links */
|
||||
color: var(--global-theme-color) !important;
|
||||
&:hover {
|
||||
color: var(--global-hover-color) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2136,7 +2136,7 @@ d-appendix > distill-appendix {
|
||||
}
|
||||
|
||||
.citation {
|
||||
color: hsla(206, 90%, 20%, 0.7);
|
||||
color: var(--global-theme-color);
|
||||
}
|
||||
|
||||
.citation-number {
|
||||
@ -2144,7 +2144,7 @@ d-appendix > distill-appendix {
|
||||
white-space: nowrap;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Roboto", Helvetica, sans-serif;
|
||||
font-size: 75%;
|
||||
color: hsla(206, 90%, 20%, 0.7);
|
||||
color: var(--global-theme-color);
|
||||
display: inline-block;
|
||||
line-height: 1.1em;
|
||||
text-align: center;
|
||||
@ -4277,7 +4277,7 @@ sup {
|
||||
}
|
||||
|
||||
span {
|
||||
color: hsla(206, 90%, 20%, 0.7);
|
||||
color: var(--global-theme-color);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@ -4446,14 +4446,26 @@ d-footnote-list a.footnote-backlink {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
background-color: rgba(250, 250, 250, 0.95);
|
||||
box-shadow: 0 0 7px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
/* Original styles retained and new theming variables added */
|
||||
border: 1px solid var(--global-divider-color); /* Themed border */
|
||||
background-color: var(--global-card-bg-color); /* Themed background */
|
||||
color: var(--global-text-color); /* Themed text color */
|
||||
box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); /* Existing shadow */
|
||||
border-radius: 4px; /* Existing border-radius */
|
||||
box-sizing: border-box; /* Existing box-sizing */
|
||||
|
||||
backdrop-filter: blur(2px);
|
||||
-webkit-backdrop-filter: blur(2px);
|
||||
backdrop-filter: blur(2px); /* Existing backdrop-filter */
|
||||
-webkit-backdrop-filter: blur(2px); /* Existing backdrop-filter */
|
||||
}
|
||||
|
||||
.panel a {
|
||||
color: var(--global-theme-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.panel a:hover {
|
||||
color: var(--global-hover-color);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user