- Issue created by @mstrelan
- Status changed to Needs review
over 1 year ago 9:21am 8 June 2023 - last update
over 1 year ago 29,436 pass - ๐ฎ๐ณIndia lokeshsahu Delhi
I have created a patch to address the above issue. I am attaching a screenshot for reference, showing the state before and after applying the patch.
- Status changed to Needs work
over 1 year ago 2:04pm 8 June 2023 - ๐บ๐ธUnited States smustgrave
Tested #4 and am not seeing the background effect.
- Status changed to Needs review
over 1 year ago 8:50am 9 June 2023 - last update
over 1 year ago 29,436 pass - ๐ฎ๐ณIndia shyam_bhatt Gujarat
I have created a new patch to address the above issue. I am attaching a screenshot for reference, showing the state before and after applying the patch.
Before:
After:
- Status changed to RTBC
over 1 year ago 7:59pm 9 June 2023 - ๐บ๐ธUnited States smustgrave
Seeing the background. Attaching a color contrast check too.
- last update
over 1 year ago 29,437 pass - last update
over 1 year ago 29,444 pass - last update
over 1 year ago 29,450 pass - last update
over 1 year ago 29,495 pass, 2 fail The last submitted patch, 6: 3364984-6.patch, failed testing. View results โ
- last update
over 1 year ago 29,499 pass - last update
over 1 year ago 29,499 pass - Status changed to Needs review
over 1 year ago 5:20am 19 June 2023 - ๐ฎ๐ณIndia shyam_bhatt Gujarat
For #6 ๐ Toolbar is-active link causes layout shift Needs work All checks pass. Needs review.
- Status changed to RTBC
over 1 year ago 1:29pm 19 June 2023 Ahmad Smhan โ made their first commit to this issueโs fork.
- ๐จ๐ญSwitzerland saschaeggi Zurich
We could also consider to just fix the layout shift with a small CSS trick like https://css-tricks.com/bold-on-hover-without-the-layout-shift/
- Status changed to Needs work
over 1 year ago 12:35pm 20 June 2023 - ๐บ๐ธUnited States bnjmnm Ann Arbor, MI
I'm not entirely sold on the background color solution. While there is still the underline to represent the active item, ensuring it doesn't rely on color alone, the bold text is arguably more salient and I'm concerned its removal could be (perhaps subconsciously) disruptive. If the bold were replaced with something similarly salient that I'd be more on board with.
Even if we ultimately go with the background approach, this still needs to go back to NW as it should be applied to the core/modules/toolbar/css/toolbar.menu.css file as well, as the current implementation only addresses Claro.
As far as alternate solutions
- The pseudo approach could probably be done accessibly, but it also requires knowing what the text content of the link is, and that would need to account for translations being different lengths and contrib additions to the toolbar. There are certainly ways to make this happen, but unsure if it can be done elegantly.
- Something that might work, but needs manual testing in multiple browsers and zoom depth: A quick test suggests styling inactive links to
.letter-spacing: 0.0224rem;
and active links to.letter-spacing: normal;
miiight work. In most cases that resulted in the normal and bold text occupying the same width, and when they didn't the difference was small enough that the repaint either didn't happen or was imperceptible. This would be imprecise, but if it addresses the majority of the use cases without causing new problems this would get my vote as it would improve the experience for most users without any UX disruption.
- ๐ฆ๐บAustralia mstrelan
There are also text-shadow and text-stroke approaches but I'm not sure if they are consistent enough.
- ๐บ๐ธUnited States bnjmnm Ann Arbor, MI
Re #14
There are also text-shadow and text-stroke approaches but I'm not sure if they are consistent enough.
Good call! Even if it's not fully consistent from browser to browser, as long as there's a distinct visual difference up to 200% zoomed, one of those two approaches is probably the best way to go. That would reliably keep the widths intact. Trying both approaches out and providing screenshots of the outcomes is probably a good next step.
- ๐ฆ๐บAustralia mstrelan
In my testing
-webkit-text-stroke: 0.2px black
looked ok in Chromium but awful in Firefox, andtext-shadow: 0 0 0.75px black;
looked ok but not perfect in both browsers, particularly good at 200%. Not entirely convinced this is the solution. Most other interfaces I've looked at use either a background colour (e.g. Firefox tabs) or a bottom border (PhpStorm tabs), or the link takes up a fixed amount of space and longer text doesn't matter (Slack channels, unread vs read). - ๐ฆ๐บAustralia mstrelan
FWIW Github is using the same pseduo-element trick as mentioned in #12 on a span inside the link:
<span data-content="Pull requests">Pull requests</span>
.UnderlineNav-item [data-content]::before { content: attr(data-content); display: block; font-weight: var(--base-text-weight-semibold, 600); height: 0; visibility: hidden; }
- Status changed to RTBC
over 1 year ago 12:04am 24 June 2023 - last update
over 1 year ago 29,553 pass - last update
over 1 year ago 29,553 pass 22:31 21:11 Running- Status changed to Needs work
over 1 year ago 12:09pm 29 June 2023 - ๐ฌ๐งUnited Kingdom catch
This was needs work and under discussion, no reason to mark it RTBC, also removing credit for the empty issue fork.