In the many different theme the "Page List" block not displaying text underline on editor, front-end, or both sides.
Description
Hello team,
I have reviewed the "Page List" block on many different themes and I have found that it's text decoration is not appear or not same on editor side & front-end side.
I already added this issue for "Twenty Fourteen" theme #61441, After that I have checked this issue for other themes.
I think that it should be same on both(Editor & Front-end) sides or the text-decoration should have be display based on requirement.
Here, I have provided it's screenshots:
- WordPress version: WordPress 6.5.4 running,
- Themes:
- Twenty Ten Version: 4.1
- Twenty Twelve Version: 4.2
- Twenty Nineteen Version: 2.8
- Twenty Twenty-One Version: 2.2
- Browser: Google Chrome, Version 126.0.6478.56 (Official Build) (arm64)
- Device: MacBook Air M1
- OS: macOS 14.5 (23F79)
- Gutenberg plugin: Version Version 18.5.0
Thanks,
Step-by-step reproduction instructions
- Type / to choose a block
- Select Page List Block
- Save the changes and publish the page.
Screenshots, screen recording, code snippet
Twenty Ten Theme:
Twenty Twelve Theme:
Twenty Nineteen Theme:
Twenty Twenty-one Theme:
Environment info
- WordPress version: WordPress 6.5.4 running,
- Themes:
- Twenty Ten Version: 4.1
- Twenty Twelve Version: 4.2
- Twenty Nineteen Version: 2.8
- Twenty Twenty-One Version: 2.2
- Browser: Google Chrome, Version 126.0.6478.56 (Official Build) (arm64)
- Device: MacBook Air M1
- OS: macOS 14.5 (23F79)
- Gutenberg plugin: Version Version 18.5.0
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Hello @talldan
I hope you are doing well.
I have checked above mentioned issue in other themes but they displaying "text-decoration"(Underline) still there is no any href for a tag.
I have checked this issue in below-mentioned themes:
- Twenty Sixteen Version: 3.2
- Twenty Seventeen Version: 3.6
- Twenty Twenty-Two Version: 1.7
- Twenty Twenty-Three Version: 1.4
- Twenty Twenty-Four Version: 1.1
Twenty Sixteen:
Twenty Seventeen:
Twenty Twenty-Two:
Twenty Twenty-Four:
Note: I already added this issue for "Twenty Fourteen" theme #61441 , After that I have checked this issue for other themes.
Thanks,
Hi @viralsampat90, Each of these themes have different styles for links, for example in Twenty Sixteen, there is an editor stylesheet that adds a box shadow to the links, so it is not the default underline that is visible.
@talldan is correct that the best way to solve this is to add the href to the markup in the editor. This will apply the links default browser style, which is to display the underline. Some themes will still need some CSS adjustments after this change.
The proposed CSS change in the linked PR also does not work when the block is placed outside the post content, like in the Site Editor or the widget screen.
I looked into this today. The page list block goes through the child pages and passes props for each page to the page list item block https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/page-list/edit.js#L224
Among these props is the link, which is then used in the page list item block as the href of the element in the editor. https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/page-list-item/edit.js#L38 https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/page-list-item/edit.js#L82
And the reason it is not being output in the editor seems to be because the link prop is assigned page.url, but url does not exist on page. If I do a console.log of page, I do see link.
You can also see link being used on line 135:
https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/page-list/edit.js#L135
So I think this is just a typo, and that url should be replaced with link, and the problem in this issue should be solved.
https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/page-list/edit.js#L236
However, the value of the href does not matter since the list item has inert=true. The link is not clickable.
Following @carolinan's explanation: what you're comparing across Twenty Fourteen/Sixteen/Seventeen etc. are those themes' own link styles, each classic theme styles links (and its editor styles) differently, so the Page List block inherits different decoration per theme and per side. That's theme styling working as designed rather than a block bug. Closing; if a specific theme shows a genuine editor/front-end mismatch caused by the block's own markup, a report against that one case with the markup diff would be actionable.