Opened 2 hours ago

#35804 new Cleanup/optimization

Unused CSS in admin's forms.css

Reported by: Baptiste Mispelon Owned by:
Component: contrib.admin Version: 5.0
Severity: Normal Keywords: css
Cc: Mario Munoz Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Working on #35799 with Mario Munoz, we found that forms.css contains rules for ul.tools but no such element exists in the HTML.

Digging into the git history, we found that the CSS rules were introduced in 2008 with a19ed8aea395e8e07164ff7d85bd7dff2f24edca (both in tabular.html and stacked.html), but even back then the template code for the ul.tools was commented out: https://github.com/django/django/blob/a19ed8aea395e8e07164ff7d85bd7dff2f24edca/django/contrib/admin/templates/admin/edit_inline/tabular.html#L60-L62

The commented out HTML code was then removed two years later with https://github.com/django/django/commit/c14937cf7a1e8c25702e89485cc2dd33aa0d3a16#diff-a30e8306c1101c2881c43ab5c18d44aa25281f170b2e7b7d186edff2512ca179L23-L25

That means that any CSS rule involving ul.tools can be safely removed at this point.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top