Problem/Motivation
I was having hard time finding the more actions button. Turns out I can't really see it because for some reason the icon is not visible:

Steps to reproduce
- Open latest version of Chrome (currently using v133.0.6943.100 at time of writing)
- Login as admin
- Turn on
navigationandnavigation_top_barmodules - Create and edit content, or just edit an existing piece of content
Expected behavior
Top bar displays with a "More Actions" button on the right-hand side that is denoted by a three-dot icon, eg.

Actual behavior
Top bar displays, but the "More Actions" button on the right-hand side, while present, does not show the three-dot icon, eg.

Proposed resolution
In Chrome, the ::before pseudo element supposed to render for this icon is not. The issue appears to be that no content property is calculated. This is set with the following CSS rule:
https://git.drupalcode.org/project/drupal/-/blob/11.1.x/core/modules/nav...
data-icon-text is not defined for this icon b/c its icon only, it doesn't have a corresponding text label. It should at least have some hidden text for screen readers. That wouldn't resolve our issue here though.
To resolve, lets add an additional modifier to the toolbar-button component, icon-only, which explicitly sets content: ''. In this way, we avoid Chromes' seeming issue in dealing with content: attr(data-icon-text) when data-icon-text is undefined.
Remaining tasks
MR- Review
User interface changes
Three dot icon shows when needed.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | actual.png | 343.48 KB | m4olivei |
| #7 | expected.png | 345.39 KB | m4olivei |
| Screenshot 2025-02-07 at 1.39.49 PM.png | 8.66 KB | lauriii |
Issue fork drupal-3505124
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
lauriiiDebugged this with @plopesc and this looks like a regression in Chrome in version 133. 😭
Comment #3
quietone commentedComment #4
kentr commentedHow does one reproduce this?
Comment #5
finnsky commentedWe need to pause icons tickets and concentrate on Icon API implementation
https://www.drupal.org/project/drupal/issues/3483209
Comment #6
finnsky commentedIt is not small hot fix but reason is in wrong icons management in module.
https://gyazo.com/cfbb9da933c5d883bf840b02a9b6a522
All buttons with only one icon broken. Close on mobile as well.
I would like to fix that system problem in global linked ticket.
Comment #7
m4oliveiI found that the issue appears to be Chrome's inability to interpret
content: attr(data-icon-text);when thedata-icon-textattribute is not set. We don't have any text label for this particular button, so I'm proposing that we add a new modifier,icon-onlyto thetoolbar-buttoncomponent, so we can style it explicitly ascontent: ''. That will make the::beforepseudo element appear as expected and fix the issue reported here.This is a quick fix that we should be able to get in quickly before the icon management lands.
Updated issue summary. Marking as active. Will work on an MR.
Comment #9
m4oliveiComment #10
finnsky commented1. I prefer not to duplicate class functionality. We already have [class*="toolbar-button--icon"]
We should use it. Just add a check for the text attribute.
2. In #6 I pointed out that the close button on mobile is also broken.
Comment #11
m4oliveiGood point! I've got rid of the extra modifier and class, and instead used a
[class*="toolbar-button--icon"]:not([data-icon-text])::beforeselector. Is that what you meant, or did you have something else in mind?Sorry I missed this. I didn't know what you meant, b/c I couldn't see the icon, because it was broken 😆. The above selector catches the Close icon and fixes it as well.
Comment #12
smustgrave commentedVerified the problem following the steps provided in the IS.
Applying the MR did fix the issue, not uploading a screenshot as they are already included.
Javascript failure was random
Comment #13
finnsky commentedFixed in related issue.
https://www.drupal.org/project/drupal/issues/3483209