Skip to content

Commit

Permalink
Make navigation block wavy underline more visible on dark backgrounds. (
Browse files Browse the repository at this point in the history
#69004)

Co-authored-by: afercia <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: Rishit30G <[email protected]>
Co-authored-by: hanneslsm <[email protected]>
  • Loading branch information
5 people authored Feb 19, 2025
1 parent c856964 commit 90ee09a
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions packages/block-library/src/navigation-link/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,9 @@
// Draw a wavy underline.
.wp-block-navigation-link__placeholder-text {
span {
$blur: 10%;
$width: 6%;
$stop1: 30%;
$stop2: 64%;

--wp-underline-color: var(--wp-admin-theme-color);

background-image:
linear-gradient(45deg, transparent ($stop1 - $blur), var(--wp-underline-color) $stop1, var(--wp-underline-color) ($stop1 + $width), transparent ($stop1 + $width + $blur)),
linear-gradient(135deg, transparent ($stop2 - $blur), var(--wp-underline-color) $stop2, var(--wp-underline-color) ($stop2 + $width), transparent ($stop2 + $width + $blur));
background-position: 0 100%;
background-size: 6px 3px;
background-repeat: repeat-x;

// Since applied to a span, it doesn't change the footprint of the item,
// but it does vertically shift the underline to better align.
padding-bottom: 0.1em;
}

&.is-invalid,
&.is-draft {
span {
--wp-underline-color: #{$alert-red};
}
text-decoration: wavy underline;
text-decoration-skip-ink: none;
text-underline-offset: 0.25rem;
}
}

Expand Down

0 comments on commit 90ee09a

Please sign in to comment.