Skip to content

Commit

Permalink
Fix blockquote color contrasts
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Apr 25, 2024
1 parent a4eaf77 commit b8a2d85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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);
}

//hack to make the text in the blockquote selectable
&:before {
z-index: -1;
Expand Down
5 changes: 5 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,11 @@ $pst-semantic-colors: (
"light": rgba(23, 23, 26, 0.2),
"dark": #{map-deep-get($color-palette, "gray", "700")},
),
"blockquote-notch": (
// gray-500 has a contrast ratio > 3.0 for foundation white and black
"light": #{map-deep-get($color-palette, "gray", "500")},
"dark": #{map-deep-get($color-palette, "gray", "500")},
),
"inline-code": (
"light": #{map-deep-get($color-palette, "pink", "600")},
"dark": #{map-deep-get($color-palette, "pink", "300")},
Expand Down

0 comments on commit b8a2d85

Please sign in to comment.