Problem/Motivation
The work here builds heavily on the discussion and work in #2848507: Indicate that grouping elements have child element errors for ux and a11y, so contributors to that issue should get credit in this one if they don't there.
Child elements in grouping elements like details and vertical tabs are invisible to the user when the grouping element is closed or not-active, respectively.
To improve the user experience and accessibility we should indicate when there are errors 'inside'.
Currently it is hard for the user to find the actual problematic field when the (child) field itself is invisible.
The forms sidebar has a similar problem: #3619387: Indicate on forms sidebar toggle button that sidebar has child element errors.
Steps to reproduce
- In
settings.php, set$settings['extension_discovery_scan_tests'] = TRUE. - Enable the core
form_testmodule (drush en -y form_test). - Install the article test recipe (
drush recipe core/tests/fixtures/recipes/article_content_type) or create an Article content type. - If necessary, set both the default and admin theme to Default Admin. Should not be necessary with this MR.
(drush cset -y system.theme default default_admin && drush cset -y system.theme admin default_admin). - For "standard" details elements:
- Go to
/form_test/details-contains-required-fields. - Click the
Submitbutton. - Close one of the details elements for comparison.
- Go to
- For "accordion" style details elements on the node edit form:
- Go to
/node/add/article. - If the form sidebar on the right is closed, click the toggle button to open it.
- Enter a value without a beginning slash in the
URL aliasfield. - Click the
Savebutton.
This should cause a validation error: "The alias path has to start with a slash". - Open the sidebar to see the invalid URL alias field.
- Go to
- For vertical tabs:
- Widen your viewport to at least 650px.
- Go to
/admin/config/people/accounts. - Within one or more tabs for the
Emailsconfiguration at the bottom of the form, remove the value for the requiredSubjectfield. - Click the
Savebutton. - Click a tab which does not have an error to activate it.
For RTL, either:
- manually change the
dirattribute on thehtmltag tortlin the browser inspector / devtools, OR -
- Enable the Locale module (
drush en -y locale). - Add Hebrew as a language (
/admin/config/regional/language/add). - Repeat the above steps on the Hebrew version of the pages (prepend
/heto the paths).
- Enable the Locale module (
Proposed resolution
Based on discussion and work in #2848507: Indicate that grouping elements have child element errors for ux and a11y, and UX review of this MR:
- Add a thick red solid border on one side of the grouping items that contain child errors.
- Border width:
var(--vertical-tabs-menu-link--active-border-size) + 2px,
so that it is distinguishable fromvar(--vertical-tabs-menu-link--active-border-size). - Border position:
Logical inline start of details element or vertical tab "menu item". - Border radius:
Match the radius of the element to which the border is applied. - Add the error icon from the page-top error block to grouping elements.
- Icon position:
- Vertical: Vertically-centered with the first line of the element's visible label.
- Horizontal: close to the logical inline end of the element's visible label.
- Use red text color for the element's visible label.
- Details elements:
Surround the entiredetailselement with a 1px solid red border. - Use the input error color for the red border / red text (
var(--input--error-color)). - Vertical tabs:
Use the input border color for the border of the active tab to so that it's clear when a tab with errors is also active. - Append visually-hidden " (child error)" to the element's visible label.
- Add the attribute
data-child-error-countto thedetailselement.
Because vertical tabs are progressively-enhanceddetailselements, the attribute will exist on the correspondingdetailselement but not on the vertical tabs menu item (thelielement).
The value of the attribute should be an integer corresponding to the number of invalid children. - For the error border color in forced-colors mode, use
canvasText(#47). - For the icon in forced-colors mode, use the
mask-imageproperty andcanvasTextbackground color.
The UX team members and @mgifford brought up various forced-colors problems with vertical tabs, but they're out of scope. They were approved by the UX team and @mgifford to be followups.
KentR made a note in #3081500-76: Accessibility bugs with vertical tabs.
Remaining tasks
Adapt work from #2848507: Indicate that grouping elements have child element errors for ux and a11y to Default Admin.Create merge request.Usability review.Forced colors mode for icon.Fix details error border position for RTL.Manually test LTR, RTL, forced colors, and presence of hidden text for the following:Standard style details.Accordion style details (such as in advanced sidebar on node edit form).Vertical tabs on wider viewport (>= 650px). On narrow viewports they fall back to accordion style details.
Create change record.
User interface changes
- Visually, the grouping elements will indicate that there are errors inside.
- There will be a visually-hidden "(contains error)" appended to the summary or vertical tabs title for screen reader users.
Screenshots
Full color mode
LTR (left-to-right)
Scenario 1: Standard details (/form_test/details-contains-required-fields)
Light mode:

Dark mode:

Scenario 2: Accordion style details (node edit form)
Light mode:

Dark mode:

Scenario 3: Vertical tabs (/admin/config/people/accounts)
Light mode:

Dark mode:

RTL (right-to-left)
Scenario 1: Standard details (/he/form_test/details-contains-required-fields)

Scenario 2: Accordion style details (node edit form)
URL alias without leading slash, Save, close "URL alias" details. Error indicator visible, no false positives on sibling details.

Scenario 3: Vertical tabs (/he/admin/config/people/accounts)

Forced-colors mode
LTR (left-to-right)
Scenario 1: Standard details (/form_test/details-contains-required-fields)

Scenario 2: Accordion style details (node edit form)

Scenario 3: Vertical tabs (/admin/config/people/accounts)

RTL (right-to-left)
Scenario 1: Standard details (/he/form_test/details-contains-required-fields)

Scenario 2: Accordion style details (node edit form)

Scenario 3: Vertical tabs (/admin/config/people/accounts)

Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #54 | 3604037-54-default-admin-standard-details-ltr.dark_.png | 49.82 KB | kentr |
| #54 | 3604037-54-default-admin-vertical-tabs-ltr.dark_.png | 144.27 KB | kentr |
| #54 | 3604037-54-default-admin-accordion-details-ltr.dark_.png | 97.37 KB | kentr |
| #52 | border_missing.jpg | 40.87 KB | rkoller |
| #51 | 3604037-51-default-admin-vertical-tabs-rtl.forced-colors.png | 134.66 KB | kentr |
Issue fork drupal-3604037
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
kentr commentedComment #3
kentr commentedThis might be do-able now that #3599680: Consolidate, merge, and refactor Gin's CSS variable's into Admin theme's original variables. has landed.
However, it should now wait on #2848507: Indicate that grouping elements have child element errors for ux and a11y, because that work might be usable here with only slight modifications and it will likely need UX input that will also apply to Default Admin.
Comment #4
kentr commentedErr, and also because there are changes outside of the theme.
Comment #5
kentr commentedBased on UX feedback in #2848507-212: Indicate that grouping elements have child element errors for ux and a11y, I think this is also blocked by #2859914: Misleading Icon used on form validation errors.
Comment #6
kentr commentedIt was decided that #2859914: Misleading Icon used on form validation errors isn't a blocker for #2848507: Indicate that grouping elements have child element errors for ux and a11y after all.
@mherchel said in Slack most of the big CSS refactor for Default Admin is complete.
AFAICT, #2848507: Indicate that grouping elements have child element errors for ux and a11y is very close. It might need some code tweaks, but I'm willing to take a gamble that we can start on this in parallel.
I'll work on porting the work in #2848507: Indicate that grouping elements have child element errors for ux and a11y to Default Admin. Once that issue is in, then this will be more easily testable by others.
Comment #7
kentr commentedComment #8
quietone commentedAdding what this is postponed on to the remaining tasks per Remining tasks.
Comment #9
kentr commentedComment #10
kentr commentedComment #11
kentr commentedComment #12
mgiffordProbably the most useful thing in this AI generated .zip is the replicate_grouping_child_errors recipe. Yes, there's a patch and more than one readme. This is all postponed on other issues, so perhaps scanning over this patch might be useful to help build a more solid one. There are also Guidepup instructions (and a diff) to help with tracking the emulation of screen reader impacts before/after.
Comment #13
kentr commentedI’ve done most of the conversion from #2848507: Indicate that grouping elements have child element errors for ux and a11y in the issue fork.
I paused to see what came out of the code review that needed to be carried over.
I didn’t create an MR because I wanted to avoid using CI minutes until it’s ready for review. Sadly, even draft MR‘s run pipelines.
Comment #14
kentr commentedComment #15
kentr commentedComment #16
kentr commentedIt's probably confusing that the status isn't Postponed...
Comment #18
kentr commentedI copied non-Claro changes from #2848507: Indicate that grouping elements have child element errors for ux and a11y because:
If #2848507: Indicate that grouping elements have child element errors for ux and a11y lands first, the corresponding commit in this issue can be reverted in the case of merge conflicts.
I'm tagging for UX review, but I'm leaving it as postponed on #2848507: Indicate that grouping elements have child element errors for ux and a11y because it's not ready for general review and the path forward is TBD.
Comment #19
kentr commentedWhen @mgifford and I talked about it last, we thought this is a blocker for #2915899: [PP-1] Enable the Inline Form Errors module in the Standard profile and recipe for the same reasons that #2848507: Indicate that grouping elements have child element errors for ux and a11y is.
Comment #20
kentr commentedI noticed a couple of janky things that I'll fix:
detailsversion. I messed that up trying to fix something else but missed it when I tested the change.detailsslices through the focus indicator on thesummary.Comment #21
kentr commentedI fixed:
The fix for the latter puts the red error border below the focus outline (in the Z-plane), which also affects the version where the red border completely covered that part of the focus outline (the version labeled "accordion style
detailselement on node edit form" below).Before / after screenshots
Standard
detailselement:Accordion style
detailselement on node edit form:Regular accordion style
details, such as for vertical tabs on narrow viewport:Comment #22
kentr commentedComment #23
kentr commentedNote regarding focus indicator in the #21 screenshots: the focus indicator will change in #3618140: Improve the accessibility of focus outlines.
Comment #24
kentr commentedNo longer postponed on #2848507: Indicate that grouping elements have child element errors for ux and a11y. I've copied the non-theme changes from that issue to here.
The UX team looked at this in #3620853: Drupal Usability Meeting 2026-09-11. Recording: https://www.youtube.com/watch?v=2eIvoRG3GNE
I'll watch the recording to see if anything needs to be adjusted.
Comment #25
kentr commentedNot an official summary, but the usability team discussed this issue in #3620853: Drupal Usability Meeting 2026-09-11.
The attendees at the usability meeting were:
AFAICT from the meeting recording the only concerns with the MR were these:
detailselements, the focus indicator is outside (larger than) thesummary, but on the vertical tabs controls and accordion styledetailsthe focus indicator is inset to thesummary.They were OK'd as followups.
IMO, fixing the focus indicator is out of scope because the underlying problem already exists on
main. This MR just makes it more obvious.It looks to me like the forced-colors problems need a big picture discussion.
I'm removing Needs usability review because that did occur.
[edited to add a link to the meeting issue and a list of attendees, at the recommendation of per @rkoller]
Comment #26
kentr commentedComment #27
kentr commentedComment #28
smustgrave commentedTesting color contrast for this one and it does fail AAA contrast with 1.4.6
Dark module this failures universally at all levels (AAA and AA).
Think we need to address those.
Comment #29
kentr commentedThanks @smustgrave!
That's a problem in
main, with the color for form "labels" in general (not specific to this MR).Surprised we missed that... I'll create an issue for it.
Here's a screenshot of an error on the node edit form in dark mode without this MR (the error is highlighted by the Accessibility Insights extension):
Comment #30
kentr commented#3625458: Form error text in dark mode has low contrast
Comment #31
kentr commentedComment #32
kentr commentedScreenshots for change record.
Comment #33
kentr commentedComment #34
kentr commentedComment #35
kentr commentedDeleted.
Comment #36
kentr commentedComment #37
kentr commentedComment #38
kentr commentedAdding screenshots to IS.
Comment #39
kentr commentedComment #40
kentr commentedActually, going to run pipeline before Needs review because I skipped it previously.
Comment #41
kentr commentedPipeline is green. There were unrelated random failures.
Comment #42
kentr commentedAFAIK no AI was used in this MR. Definitely not in the work I did, but AFAICT also not in the original work of #2848507: Indicate that grouping elements have child element errors for ux and a11y.
Comment #43
kentr commentedAI was not used intentionally, anyway.
Comment #44
rkollerI've did another round of testing of the latest state of the MR. Referring to the points raised during the ux meeting @kentr summarized in #25 .
The only sort of more serious problem that i've noticed and dawned on me where i am not sure it could be deferred to a follow up is the following. the color for errors in scenario 1 and 2 differs from the color from scenario 3. i am well aware to communicate something just based on color is against SC1.4.1 and that is the reason why the prohibition sign was added, but still the color is a visual cue for some people and that is why that cue should also be consistent in forced color imho:
scenario 1 (error in white)

scenario 2 (error in white)

scenario 3 - with no errors and the vertical tab on top active

scenario 3 - with three erroneous vertical tabs and the

Welcome (awaiting approval)vertical tab activescenario 3 - with three erroneous vertical tabs and the

Account blockedvertical tab activeBased on coloring in scenario 1 and 2 the active vertical tab in
scenario3-no_errors.jpgwould be erroneous same as for example the active vertical tab inscenario3-account_blocked-active.jpg. in all cases the left thick border is white.Comment #45
rkollerOne detail to denote I forgot to add in the previous comment and I am uncertain if we touched that topic before. But in dark mode the red used for none text elements is the same red used for the labels of those erroneous elements. Problem is, the color contrast against both possible background colors in dark mode is each time < 4.5:1... And then there is also the problem that the default admin theme provides a red accent color which is quite close to the one for the error illustrated in both screenshots (the colors were only taken with the color picker).
The background for any non active erroneous vertical tab has a color contrast of 3.37:1 against its label

The background for any active erroneous vertical tab has a color contrast of 4.48:1 against its label

Update:
In light mode the accent color collides even more with the red of the error color, making the two hardly distinguishable.
Comment #46
kentr commentedThanks @rkoller!
The red error color low contrast should be fixed by #3625458: Form error text in dark mode has low contrast.
I don't know how to solve the problem with the red accent color, though. I think that would already exist in
main. This MR uses the pre-defined error color.I think the underlying problem is that there's not a system color for errors.
For vertical tabs, the border is on the
aelement, so it gets that semantic color (Edge page colors gives a more complete picture):But for details, the border is on the
detailsand not thesummary, so it gets just the standard white:And in both, the border on the invalid field is yellow and the label is white.
We probably need to figure out a way to color errors in forced colors in general (if it's possible).
For this issue, we could make the border
CanvasTextfor vertical tabs to match the border ondetails. But I was thinking that the icon should probably have the same semantic color as the element that it's attached to (whether it's a button, a link, a summary, etc).Comment #47
rkollerone option might be to simply drop the red accent color from the default admin theme. having an accent color that is that close to the color the theme uses for errors i consider inherently problematic (https://www.whocanuse.com/?bg=bb4d42&fg=c43336&fs=16&fw=). :/
yep i know and i agree to. i've just raised that detail because having the same state with different colors on different pages is problematic. so having a "crude hack" to unify them for the time being until a consensus is reached for a proper fix was what i was implying - something like the CanvasText system color for vertical tabs what you suggested. for the "crude fix" it shouldnt have to make semantic sense but rather just accomplish consistency?
and about a system color for errors, ive already searched in online resources a while ago if there is some sort of documentation or best practice in that regard but i had no luck finding anything yet. will see maybe it would be possible to contact someone at the microsoft edge team or somehow related to pick their brains on that question. and again it would be super helpful if there would be some sort of best practice demo where you are able to see which system color is being used in which context best.
Comment #48
kentr commentedYeah, I thought of that also but didn't think it would be well-received :-). It's worth pursuing, though.
It might be helpful if you comment in #3625458: Form error text in dark mode has low contrast, because the color I used is a slightly lighter red that's probably even closer to the red accent color (based on just looking at your screenshot).
Sounds good. I'll change it.
Comment #49
kentr commentedI didn't find anything either.
That would be awesome! 💪
Comment #50
rkollerhaha yep that might be the case but keeping it in as is might also not be the right choice. :( we will see how things turn out.
left a brief comment
Comment #51
kentr commentedI changed the vertical tabs forced-colors error-border color to
canvasTextper #47.These screenshots are now in the issue summary. I also updated the proposed resolution to match.
Comment #52
rkolleri've found one regression. in dark mode on node edit forms in the advanced sidebar erroneous detail elements are missing a red top and bottom border. i've first noticed in edge and can confirm it in safari. in light mode both borders are in place.
aside that everything looks fab. ive also checked the changes in forced color mode in edge. now all three scenarios have the same color. even tough it makes now distinguishing active and erroneous vertical tabs tough - the prohibition sign is the sole visual cue, but the inconsistency inbetween the scenarios was way worse in comparison.
so with the borders in dark mode on node edit forms fixed i would vote for RTBC the issue. and while waiting for review i would also vote as ive already written on slack to create one or two follow ups for forced color mode. one for adding dotted top and bottom border lines for none active vertical tabs and ensure the vertical tab on top show a top border in regular and forced color mode and the vertical tab on the bottom the bottom border is shown in regular and forced color mode as well. and a separate issue to figure out a solution for the system color to use for errors. and probably another issue for dealing with the case a user chose red as their accent color.
Comment #53
rkollerComment #54
kentr commentedI fixed the border on the dark mode node edit form details and added LTR dark mode screenshots to the IS.
Comment #55
rkollerI've retested the latest state of the MR in light and dark mode in RTL and LTR, and also rechecked forced color mode and reassured that the color for the error state is consistent across all three scenarios. Looks all good now as well as the issue summary is in proper shape, thanks to @kentr's effort! Setting it to RTBC.
There are three details we've agreed on to discuss and/or solve in follow-ups:
Comment #56
mgiffordWould be good to link the follow-up items here when they are created @rkoller
Much appreciate the review.
Comment #57
rkolleryes that was the plan anyway. but created all three issues already now and updated #55 accordingly.