gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Typography settings of a parent text element do not affect links within

Open richtabor opened this issue 2 years ago • 4 comments

I expected to be able to remove the underline of links within certain paragraph elements on my site — but as-is, the text decoration control applies a style to the <p> element, whereas links within it still retain the origin text-decoration style.

This is the case for any typography styles applied to elements.link — where the parent block's typography attributes are not carried through to the links within.

I'd expect to be able to modify the typography styles of links within a paragraph, with the paragraph's settings.

CleanShot 2023-07-29 at 15 53 02

richtabor avatar Jul 29 '23 19:07 richtabor

This occurred for me for titles in a Query Loop. I want to make titles on the blog template to be a link but without an underline. It's currently not possible.

I'd expect to be able to modify the typography styles of links within a paragraph, with the paragraph's settings.

I had the very same expectation. Due to that it is very clear what the expectation from the user is, would it make sense to add a bug label? Or how about introducing "UX Bug" labels?

hanneslsm avatar Oct 23 '23 08:10 hanneslsm

@hanneslsm is the underline style the only one conflicting here? If so, perhaps targeting the a within the block's generated styles would be simple enough.

richtabor avatar Nov 20 '23 13:11 richtabor

Currently I am only aware of the underline style. I'll keep my eyes open though.

hanneslsm avatar Nov 20 '23 18:11 hanneslsm

For everyone reading, I added this line to my theme to fix it:

p[style*="text-decoration:none"] * {
  text-decoration: none;
  &:hover {
	text-decoration: underline;
  }
}

hanneslsm avatar Jun 16 '25 13:06 hanneslsm