Opened 7 months ago
Closed 7 months ago
#35382 closed Cleanup/optimization (fixed)
Remove unused CSS style `.inline-related fieldset.module h3`
Reported by: | Sarah Boyce | Owned by: | Saurabh |
---|---|---|---|
Component: | contrib.admin | Version: | 5.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
Currently, the CSS definition in forms.css
for .inline-related fieldset.module h3
(which is at least 16 years old) is not being used in the Django code base. The only templates using the inline-related
CSS class are contrib/admin/templates/admin/edit_inline/tabular.html and contrib/admin/templates/admin/edit_inline/stacked.html, and the former only uses h3
elements inside a div
element which does not fulfill the CSS rule, and in the latter there is no usage of h3
at all.
Attachments (2)
Change History (17)
by , 7 months ago
comment:1 by , 7 months ago
Description: | modified (diff) |
---|
comment:2 by , 7 months ago
Component: | Uncategorized → contrib.admin |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
by , 7 months ago
Attachment: | suggestion.png added |
---|
comment:4 by , 7 months ago
Looks good! I checked the base.css
and noticed we have a --body-fg: #333
which also seems like a good option. I would remove the bold though!
comment:5 by , 7 months ago
Description: | modified (diff) |
---|---|
Summary: | Low contrast background color for fieldset headings within inline formsets → Remove unused CSS style `.inline-related fieldset.module h3` |
During a Discord conversation between Sarah and Ben, they realized that this low-contrast issue was only reproducible in the context of a PR fixing #35189, meaning that the issue is not present in main
. So we are re-purposing this ticket to confirm and delete the unused CSS style .inline-related fieldset.module h3
.
comment:6 by , 7 months ago
Keywords: | accessibility removed |
---|---|
Type: | Bug → Cleanup/optimization |
comment:8 by , 7 months ago
Hello, author of the fix for the aforementioned other ticket here.
The light blue color used for inline H3s feels random; it does not fit the Django Admin's color scheme.
Since the CSS hasn't been touched for years and is unused, and the color is not referred to with CSS custom properties, I assume it's an old remnant that wasn't meant to match modern admin styles.
Hence I propose we find a style or color that better fits with the current base colors tint-wise, and find a suitable text color with a WCAG-approved contrasting text color.
I am not a designer, so I would experiment with my PR and see what works. It's not a scientific method. If anyone has had a good thought about this before, let me know!
Edit: I can also make it look like it does currently so you won't notice a visual difference.
comment:9 by , 7 months ago
Just an FYI, this ticket has bee repurposed to fully remove the unused CSS rule so there is no need to pick new colors. If a new color is needed in a future work that introduces this h3 back, the colors should be discussed in that PR/ticket. Thank you!
comment:10 by , 7 months ago
I have removed this whole selector and contents for .inline-related fieldset.module h3
in my PR for ticket #35189 (PR #17910).
Do you want to have this as a separate PR, as well?
comment:11 by , 7 months ago
Do you want to have this as a separate PR, as well?
Yes please, let's get this merged as a distinct and independent cleanup change. Having a ticket to track this is probably overkill, but merging in a separate commit has a couple of advantages and it's quite common we try to pull out commits and merge early when possible/appropriate. 👍
comment:12 by , 7 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:13 by , 7 months ago
Has patch: | set |
---|
comment:14 by , 7 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
Thank you Sarah for the report, it makes sense. I checked and the background color is at least 16 years old!
Do you have any concrete suggestion for the new font color?