diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index 8ff438dc20abef..11a281a44a76d7 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -14,7 +14,6 @@ import { TextControl, TextareaControl, ToolbarButton, - Tooltip, ToolbarGroup, } from '@wordpress/components'; import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes'; @@ -490,10 +489,6 @@ export default function NavigationLinkEdit( { const placeholderText = `(${ isInvalid ? __( 'Invalid' ) : __( 'Draft' ) })`; - const tooltipText = - isInvalid || isDraft - ? __( 'This item has been deleted, or is a draft' ) - : __( 'This item is missing a link' ); return ( <> @@ -533,9 +528,7 @@ export default function NavigationLinkEdit( { { /* eslint-enable */ } { ! url ? (
- - { missingText } - + { missingText }
) : ( <> @@ -578,27 +571,30 @@ export default function NavigationLinkEdit( { { ( isInvalid || isDraft || isLabelFieldFocused ) && ( -
- - - { - // Some attributes are stored in an escaped form. It's a legacy issue. - // Ideally they would be stored in a raw, unescaped form. - // Unescape is used here to "recover" the escaped characters - // so they display without encoding. - // See `updateAttributes` for more details. - `${ decodeEntities( label ) } ${ - isInvalid || isDraft - ? placeholderText - : '' - }`.trim() - } - - +
+ + { + // Some attributes are stored in an escaped form. It's a legacy issue. + // Ideally they would be stored in a raw, unescaped form. + // Unescape is used here to "recover" the escaped characters + // so they display without encoding. + // See `updateAttributes` for more details. + `${ decodeEntities( label ) } ${ + isInvalid || isDraft + ? placeholderText + : '' + }`.trim() + } +
) } diff --git a/packages/block-library/src/navigation-link/editor.scss b/packages/block-library/src/navigation-link/editor.scss index 84cd6f6d4ee363..c48af79385c47f 100644 --- a/packages/block-library/src/navigation-link/editor.scss +++ b/packages/block-library/src/navigation-link/editor.scss @@ -80,24 +80,33 @@ background-image: none !important; // 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; + .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: var(--wp--preset--color--vivid-red); + } + } } // This needs extra specificity.