#27743 closed Cleanup/optimization (fixed)
CSS fix of "viewsitelink", "golink" and "addlink" buttons for Django admin
Reported by: | Nick Mavrakis | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | admin, css, background-position, icon |
Cc: | elky | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
This is a minor fix but, in my opinion, its very helpful!
Inside the Django admin change list page, in the upper right corner (ADD OBJECT button), if the text is too long then the "+" icon overlaps the text as you can see in the image. This is due to the background-position: 93% center
(https://github.com/django/django/blob/master/django/contrib/admin/static/admin/css/base.css#L741).
PROPOSED FIX: Because background-position
can take up to 4 values due to background position edge offsets
(http://caniuse.com/#feat=css-background-offsets), we can change the above line to:
background-position: right 7px center;
The same applies to the other button, VIEW ON SITE
(https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.view_on_site), as well.
Attachments (1)
Change History (7)
by , 8 years ago
Attachment: | icon_not_align_right.png added |
---|
comment:1 by , 8 years ago
Cc: | added |
---|---|
Easy pickings: | unset |
Triage Stage: | Unreviewed → Accepted |
ekly, could you review? Nick, could you create a pull request?
comment:2 by , 8 years ago
background-position: right 7px center;
fix is totally fine. It will work well in all major browsers.
comment:4 by , 8 years ago
Pull request created (https://github.com/django/django/pull/7914). Thank you!
django admin list display view, "+" icon overlaps text