Problem/Motivation
In gin if you have a page title overflow the line, than you get get an Accessibility-Issue (SC 1.4.12: Text Spacing - Level AA). Because the title is getting cut off and cannot be accessed in full length in any way.
See: https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html#use-of-ell...
Steps to reproduce
Go in the backend and go to a page with a very long page title.
(In our case happening in commerce environment if cancelling a subcription - the title is getting cutt off).
Proposed resolution
The proposed solution is to discuss:
- Add a possibility to access the full title (e.g. via accessible tooltip) or to remove the ellipse behavior:
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
to:
white-space: normal;
https://git.drupalcode.org/project/gin/-/blob/5.0.x/styles/base/_title.scss
Issue fork gin-3570087
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
yashaswi18 commentedThanks for raising this! Long titles being truncated with ellipses can be an accessibility issue (WCAG 2.2 SC 1.4.12), but in some projects the ellipsis may be intentional to preserve layout.
A possible solution could be showing the full title when the user clicks on the ellipsis itself (accessible tooltip or expandable element), or providing a theme setting to allow wrapping. This keeps the design intact while improving accessibility.
Would love to hear your thoughts on this approach.
Comment #3
joville commented@yashaswi18
Thanks for your answer! A tooltip would be the most feasible solution there, because wrapping would destroy the design, was I found it out later.
Comment #5
yashaswi18 commentedComment #6
joville commented@yashaswi18
The title attribute is not an accessibility technique anymore, because this also not a tooltip in an accessible way. The problem: the tooltip itself is not controllable by the user (keeping the tooltip open and close it at the time wanted). Therefore this way is not feasible!
Comment #7
mgiffordTooltips are a bit of a known problem in accessibility, most folks just assume if it is supported in HTML it is good to go. Sadly, this is not the case as is pointed out here.
I have some alternate practices which I've put together here (with other examples)
https://mgifford.github.io/ACCESSIBILITY.md/examples/TOOLTIP_ACCESSIBILI...
@joville how does this functionality compare with Core? Should we bring the pattern you suggest up so that it affects all themes (with titles that are too long).