Skip to content

Commit

Permalink
Darken the color of links within click tooltips to improve color cont…
Browse files Browse the repository at this point in the history
…rast and readability (#9571)
  • Loading branch information
Jinksi authored Oct 17, 2024
1 parent 685471e commit 3326a6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-9559-tooltip-link-color-contrast
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix the color contrast of links within tooltips to improve readability.
11 changes: 9 additions & 2 deletions client/components/tooltip/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@
&__tooltip {
position: relative;

// Default tooltip styles have a dark background and light text.
color: $white;
background-color: $gray-900;
padding: 10px;
text-align: center;

// Links inside default tooltips should have a light color against the dark background.
a {
color: var( --wp-admin-theme-color-background-25, $wp-blue-5 );
text-decoration: underline;
Expand All @@ -72,16 +74,21 @@
}

&__tooltip {
// Specific styles for the click tooltip variant.
// Click tooltips have a light background and dark text.
position: relative;
padding: 12px;
color: $gray-900;
text-align: left;
border-radius: 2px;
border: 1px solid $gray-400;
background: $white;
background-color: $white;
box-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 );

// Links inside click tooltips should have a dark color against the light background.
a {
color: var( --wp-admin-theme-color, $gutenberg-blue );
}

&::after {
// Remove the arrow from the click tooltip variant.
display: none;
Expand Down

0 comments on commit 3326a6d

Please sign in to comment.