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 blockquote color contrasts #1786

Merged
merged 4 commits into from
Apr 29, 2024
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
7 changes: 6 additions & 1 deletion src/pydata_sphinx_theme/assets/styles/content/_quotes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
blockquote {
padding: 1em 1em;
color: var(--pst-color-text-muted);
border-left: 0.25em solid var(--pst-color-border);
border-left: 0.25em solid var(--pst-color-blockquote-notch);
border-radius: $admonition-border-radius;
position: relative;

Expand All @@ -23,6 +23,11 @@ blockquote {
@include legacy-backdrop-placeholder;
background-color: var(--pst-color-surface);

// Ensure there is enough contrast against the background
a {
color: var(--pst-color-inline-code-links);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice I had not realised we had contrast issues here, so thanks for fixing this.

}

//hack to make the text in the blockquote selectable
&:before {
z-index: -1;
Expand Down
6 changes: 6 additions & 0 deletions src/pydata_sphinx_theme/assets/styles/variables/_color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ $pst-semantic-colors: (
"light": rgba(23, 23, 26, 0.2),
"dark": #{map-deep-get($color-palette, "gray", "700")},
),
"blockquote-notch": (
// These colors have a contrast ratio > 3.0 against both the background and
// surface colors that the notch is sandwiched between
"light": #{map-deep-get($color-palette, "gray", "500")},
"dark": #{map-deep-get($color-palette, "gray", "400")},
),
"inline-code": (
"light": #{map-deep-get($color-palette, "pink", "600")},
"dark": #{map-deep-get($color-palette, "pink", "300")},
Expand Down
Loading