
Problem/Motivation
This is a followup issue to #3084166: Add a focus-within polyfill to core.
Convert hidden.module.css
to use focus-within
instead of focus
for the benefits that it brings.
Example use-case
Allow arbitrary hidden-but-focusable skip-links that are nested with <ul><li>
, such as the "Add new comment" link.
Bartik
Olivero
Proposed resolution
Convert hidden.module.css
to use focus-within
.
Remaining task
Update for stable9
Check for other themes
Comment | File | Size | Author |
---|---|---|---|
2021-08-21 16.31.41.gif | 64.25 KB | kentr | |
2021-08-21 15.53.21.gif | 76.9 KB | kentr |
Issue fork drupal-3229647
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:
- 3229647-use-focus-within-in
changes, plain diff MR !10217 /
changes, plain diff MR !3133
Comments
Comment #2
kentr CreditAttribution: kentr as a volunteer commentedHere's a patch against
9.3.x
.Comment #3
kentr CreditAttribution: kentr as a volunteer commentedComment #4
gauravvvv CreditAttribution: gauravvvv at OpenSense Labs commentedComment #8
mherchelThis seems like a great idea to me and totally makes sense.
Note that that the
:focus-within
pseudo-class will activate when the selected element has focus, too. So, this won't break BCComment #9
mherchelComment #10
mherchelNeeds re-roll for D10.
Discussing this on accessibility off-hours today.
Comment #11
mgiffordThis looks like it will be a good improvement. Happy to see this change.
Comment #14
mansi agarwal CreditAttribution: mansi agarwal commentedadded patch against #2 in 10.1.x
Comment #15
_utsavsharma CreditAttribution: _utsavsharma at OpenSense Labs commentedComment #16
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedComment #17
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedPatch #14 work fine in drupal 10.1.x-dev.
Thank you.
Comment #18
xjmAs an accessibility improvement, this should have accessibility review.
Comment #19
mherchelAccessibility maintainer @mgifford commented in #11 (per our discussion in Drupal Accessibility office hours).
Comment #20
jitender vaidhComment #21
xjmThanks @mherchel for the context. :)
Hiding patches for clarity. Saving credits for reviewers, but uncrediting #14 as it just duplicated the work in the MR in #12 and #13, which in turn were also just applying a one-word change to an issue fork instead even though I can still apply #2 to 10.1.x now, so it did not actually need a reroll? (Also uncrediting my own clicking of the MR rebase button.)
As a change to module CSS, this is allowed in a Drupal minor version (so 10.1.x).
Comment #22
smustgrave CreditAttribution: smustgrave at Mobomo commentedAlso happy to see Drupal get more accessible!
Comment #23
lauriiiChanging this to a bug since this is an accessibility improvement.
I'm wondering if we should be making this change to Stable 9 too? It seems like it would be a relatively low risk accessibility improvement that we could ship to all themes.
Comment #24
smustgrave CreditAttribution: smustgrave at Mobomo commentedFor accessibility my answer is always yes. If it can be added lets do it.
Comment #25
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedAddressed #23, Updated changes in stable9 as well. Please review
Comment #26
smustgrave CreditAttribution: smustgrave at Mobomo commentedPerfect
Comment #27
xjmFixing attribution.
Comment #28
lauriiiSorry, I forgot to mention in #23 that we would also need a change record since we are changing Stable. The CR should mention what the implications of this change is, and how someone with a theme extending Stable could revert to the old behavior if this is causing regressions for them.
Comment #29
quietone CreditAttribution: quietone at PreviousNext commentedSetting to NW to get the change record written.
Comment #30
mgiffordAdding https://www.w3.org/WAI/WCAG21/Understanding/keyboard
Comment #33
saurav-drupal-dev CreditAttribution: saurav-drupal-dev as a volunteer and at Material for Drupal India Association commentedComment #34
smustgrave CreditAttribution: smustgrave at Mobomo commented#28
Comment #35
arunkumarkCreated drafted Change Record. Feel free to update the change record if needed.
https://www.drupal.org/node/3484054
Comment #36
smustgrave CreditAttribution: smustgrave at Mobomo commentedActually looking at the change introduced #32 and not sure why it's needed. Think it should be reverted.
Comment #37
arunkumarkComment #38
smustgrave CreditAttribution: smustgrave at Mobomo commentedComment has been removed.
Comment #39
nod_The mr should target the 11.x branch
Comment #41
arunkumarkAs per comment #39 created a new MR for 11.x version.
Comment #43
smustgrave CreditAttribution: smustgrave at Mobomo commentedComment #49
nod_Committed fcde87f and pushed to 11.x. Thanks!
Comment #50
mherchel(changing my attribution to add my company)