Read more: can not set default underline using theme.json #56036
Labels
[Block] Read More
Affects the Read More Block
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
What problem does this address?
The read more block is always a link, but it can not be styled as a link using theme.json. Not without using the "CSS" field and force overriding the current block CSS.
I added this block to my block template inside the post template / query loop specifically because I thought it would have more styling possibilities than the link in the excerpt block. But also because I did not want untranslatable text in my HTML template.
If I want the "read more" text string to show up in the excerpt block, I would have to have the text string like this:
<!-- wp:post-excerpt {"moreText":"Read more"} /-->
Even though this is the default text.The block has CSS that removes the default underline on the link.
This CSS overrides the CSS generated by theme.json: styles > blocks > core/read-more > typography > textDecoration.
From the block styles:
From my example theme.json:
I think this CSS needs to be removed, -but I am unsure of how to do that without changing the look on existing websites.
@ntsekouras I am reading through #37649 but I can not find the reason for why the underline needed to be removed? Does it break the text underline option?
There is no way right now to set the default to showing an underline and then removing the underline on :hover.
https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/read-more/style.scss#L4
Can we make it valid to use the link states, hover, focus, active and visited directly on this block, since
styles > blocks > core/read-more > elements > links does not work?
The text was updated successfully, but these errors were encountered: