Opened 10 years ago
Last modified 8 years ago
#30274 reopened enhancement
wp-login.php Logo Image Use "img" tag rather than CSS background
Reported by: | themightymo | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Login and Registration | Keywords: | |
Focuses: | ui | Cc: |
Description
The fact that the logo image that displays on www.website.com/wp-login.php is a background image rather than an "img src" html tag often makes it problematic, because support for resizing CSS backgrounds is more complicated than using "img src" tags. For example, it seems like every time I use a plugin or try to alter the logo image on wp-login.php it in some way, it takes some combination of the perfect image size and css hacks to make it responsive.
Conversely, if it was an "img" tag, I could just apply "width:100%; height:auto;" or something like that.
So, in conclusion, I propose switching from a background image to an "img src" html tag.
Attachments (1)
Change History (6)
#1
@
10 years ago
Changing the logo to an image element would likely introduce bugs for those plugins that style the background. You can make background images responsive using only CSS. Granted it's not as easy, but it's doable.
#2
@
10 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Thanks for the suggestion.
While this would be a reasonable change, as valendesigns points out this would cause unnecessary breakage for existing sites that style the login screen logo, and we don't want that.
#4
@
8 years ago
- Resolution wontfix deleted
- Status changed from closed to reopened
There is an even more important reason to reconsider this. Static payload of images in css.
Currently the only way to use a custom logo is to override it with css or use an alternate form of login altogether. Core loads a combined 4.6kb payload for both logo images in wp-admin.css and it isn't practical to deregister this file, provide our own to eliminate the extra payload, and then re-enqueue the modified version of the file because later it can become outdated with future releases of WP.
If an img element was used we can filter the url using functions.php or a plugin or possibly even enhance the ability to modify the argument array of wp_login_form( $args ) passing the image url.
Plugin authors know the risk of an ever changing core so I think the excuse is not really that strong of an argument when we could be doing it in a more efficient, modern way.
Annotated screengrab of what I want