#61661 closed defect (bug) (duplicate)
WordPress 6.6 display all links as underlined
Reported by: | simonbelley | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.6 |
Component: | Editor | Keywords: | |
Focuses: | ui, css | Cc: |
Description
Since the update of WordPress 6.6 the css line: :root :where(a:where(:not(.wp-element-button))){text-decoration:underline;} broke all of my websites designs by adding underline on every links.
Change History (9)
#2
follow-up:
↓ 3
@
2 months ago
It's clearly not a browser behaviour since it's a css line that has been added to wordpress core in the update. Hope they fix that soon! I have multiple website and don't want to go on each one to add a css line that would override it...
#3
in reply to:
↑ 2
@
2 months ago
Replying to simonbelley:
It's clearly not a browser behaviour since it's a css line that has been added to wordpress core in the update. Hope they fix that soon! I have multiple website and don't want to go on each one to add a css line that would override it...
No, but that was their reason for introducing that CSS rule.
30 years ago, links were, indeed, underlined and blue. This doesn't mean we need to have them like that.
#4
@
2 months ago
- Component changed from General to Editor
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Severity changed from major to normal
- Status changed from new to closed
Duplicate of #61660.
Closing as this was already reported & resolved.
#5
@
2 months ago
This is how I solved it, in case anyone stumbles upon this ticket. I put the code below in my theme:
:root :where(a:where(:not(.wp-block-navigation))), :root :where(a:where(:not(.wp-element-button))) { text-decoration: initial; }
#7
in reply to:
↑ 1
@
2 months ago
Replying to butterflymedia:
I have already opened a ticket on the block editor on GitHub, and they said there is a hotfix for 6.6.1. Here is the link - https://github.com/WordPress/gutenberg/issues/63345
Still, there is a bunch of
:root
and:where
styles overriding everything. Another example would be all centred images are now left aligned.
Regarding the underline, their reply was that this is common behaviour for browsers to underline links…
Here is the selector being added by the core:
:root :where(a:where(:not(.wp-element-button))) { text-decoration: underline; }
#9
@
2 months ago
The filter below fixed the entire issue for me:
add_action( 'wp_head', function () { global $wp_styles; if ( ! empty( $wp_styles->registered['global-styles']->extra['after'][0] ) ){ $wp_styles->registered['global-styles']->extra['after'][0] = str_replace( [ ':root :where', ':root', ':where', ], '', $wp_styles->registered['global-styles']->extra['after'][0] ); } }, 1 );
I have already opened a ticket on the block editor on GitHub, and they said there is a hotfix for 6.6.1. Here is the link - https://github.com/WordPress/gutenberg/issues/63345
Still, there is a bunch of
:root
and:where
styles overriding everything. Another example would be all centred images are now left aligned.Regarding the underline, their reply was that this is common behaviour for browsers to underline links…
Here is the selector being added by the core: