Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2349653: Copy color templates to Classy
The lock/unlock link is just an empty div, this means it is not accessible to screenreaders and is not useable without CSS.
As nod_ mentioned, this will be removed, but only in 8.1.x-dev, depending on #1651344: Use color input type in the color.module.
So as a consensus, lets make this icon accessible without restyling it.
Beta phase evaluation
Issue category | Bug because accessibility |
---|---|
Issue priority | Not critical because minor accessibility defect | Unfrozen changes | Unfrozen because it only changes markup |
Prioritized changes | The main goal of this issue is accessibility |
Comment | File | Size | Author |
---|---|---|---|
#14 | color-module-accessible-link-2409653-14.patch | 1.57 KB | MathieuSpil |
#13 | Screenshot 2015-04-13 14.33.30.jpg | 476.49 KB | LewisNyman |
#11 | color-module-accessible-link-2409653-11.patch | 2.16 KB | MathieuSpil |
Comments
Comment #1
MathieuSpil CreditAttribution: MathieuSpil commentedSo here are my changes explained (for all the changes, you should still check patch)
Replaced the clickable div by a actual link with linktext and a href-attribute so it is focusable.
Added Some logic so that the link text is being replaced on click.
Removed cursor: pointer in css because this is now a actual link.
Added text-indent: -9999px because when css is being used, it already have a background-image, and it shouldn't have visible text (But now it is accessible for screen readers)
Only remaining issue I spotted here, is that the module css file was full of unnecessary css inside media queries, so I removed a bunch of it (Just stating the obvious, that is highly unlikely that this code was ever used.)
And last but not least: Am I the only one who doesn't like those icons (If Duke Nukem would have a manbag, those would look like that)
So is it an option to replace those icons with some better ones, or remove them all together?
Comment #2
LewisNymanNice, I didn't find much to improve but we could do with nod_ giving this a quick JS review to make sure.
I think for accessibility reasons this should actually be a element?
That's cool, but we will need some before/after screenshots at various screen sizes just to make sure we haven't broken anything. I am happy to do this.
Haha yeah they look like something out of minecraft or something. Let's open a new issue and replace them with Libricons like we have in #1356602: [META] Clean up icons in misc
Comment #3
MathieuSpil CreditAttribution: MathieuSpil commentedHey Lewis,
What do you mean with: "I think for accessibility reasons this should actually be a element?"?
For accessibility's sake, a clickable element schouldn't be a div. Also a 'a'-element is not focusable when there isn't a href-attribute.
Just not really sure what you meant by this :)
Comment #4
LewisNymanAh sorry, I think I forgot to use the code tag. I meant a
<button>
elementComment #5
LewisNymanSeven has a
.link
class that you can use the reset the styles of the button tagComment #6
nod_Didn't we talk about getting rid of them altogether because it was really unclear what they did? I know Bojhan mentioned that and I agreed :p
Comment #7
MathieuSpil CreditAttribution: MathieuSpil commented@nod_ Can you provide a link to that issue?
Comment #8
mgiffordI suspect it was #1164796: The lock icon attracts unwanted attention, and its purpose is not clear.. Good catch @LewisNyman
Comment #9
MathieuSpil CreditAttribution: MathieuSpil commentedComment #10
MathieuSpil CreditAttribution: MathieuSpil commentedComment #11
MathieuSpil CreditAttribution: MathieuSpil commentedAltered the patch so instead of using
<a>
elements, it now uses<button>
elements.Comment #12
MathieuSpil CreditAttribution: MathieuSpil commentedComment #13
LewisNymanI tested this patch and it works as expected. Here's a screenshot of the functionality working without any JS errors:
I think we should move these CSS improvements to a follow up issue, so we can keep this issue focused.
Comment #14
MathieuSpil CreditAttribution: MathieuSpil commentedNew patch now only has the neccessary css change:
text-indent: -9999px;
because I added text to the button, so people who use screenreaders can actually use these buttons for now.There should be a new issue where we do a cleanup of the CSS (or we can ignore this, and it will be deleted eventually when this functionality is being deleted, as mentioned before)
Comment #15
LewisNymanGreat! Thanks a lot. Follow up issue: #2470069: Refactor color module CSS inline with our CSS standards
Comment #16
LewisNymanComment #17
LewisNymanComment #18
alexpottCommitted 4b0b2c0 and pushed to 8.0.x. Thanks!