WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 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:
PR Number:

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.

http://i.imgur.com/C5qwZtq.png

Attachments (1)

logo background image.png (359.6 KB) - added by themightymo 5 years ago.
Annotated screengrab of what I want

Download all attachments as: .zip

Change History (6)

@themightymo
5 years ago

Annotated screengrab of what I want

#1 @valendesigns
5 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 @johnbillion
5 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.

#3 @SergeyBiryukov
5 years ago

  • Component changed from General to Login and Registration
  • Focuses ui added

#4 @pingram3541
3 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.

#5 @SergeyBiryukov
3 years ago

  • Milestone set to Awaiting Review
Note: See TracTickets for help on using tickets.