Opened 3 months ago

Closed 2 months ago

#35804 closed Cleanup/optimization (fixed)

Unused CSS in admin's forms.css

Reported by: Baptiste Mispelon Owned by: Aditya Chaudhary
Component: contrib.admin Version: 5.0
Severity: Normal Keywords: css
Cc: Mario Munoz 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

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 (5)

comment:1 by Claude Paroz, 3 months ago

Triage Stage: UnreviewedAccepted

Clean, clean, clean :-)

comment:2 by Sebastian Ozimkowski, 3 months ago

Owner: set to Sebastian Ozimkowski
Status: newassigned

comment:3 by Aditya Chaudhary, 3 months ago

Owner: changed from Sebastian Ozimkowski to Aditya Chaudhary

comment:4 by Adam Johnson, 2 months ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:5 by Sarah Boyce <42296566+sarahboyce@…>, 2 months ago

Resolution: fixed
Status: assignedclosed

In 4cad317:

Fixed #35804 -- Removed unused rules for ul.tools from admin CSS.

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