Page MenuHomePhabricator

The 1.38 change-your-logo default for developers and new wikis is missized and looks out of place
Closed, ResolvedPublic

Description

Follows-up https://gerrit.wikimedia.org/r/c/mediawiki/core/+/769740, \cc @Jdlrobson @Jdforrester-WMF

BeforeAfter
Screenshot (946×1 px, 292 KB)
Screenshot (939×1 px, 256 KB)

I believe this is not the intended design and not expected as end-result.

It is (implicitly) rendered at 160x160px instead of in the standard x135px box that MediaWiki expects for logos, due to having no width of its own, and having no CSS background-size rule.

Square logos are rendered at 135x135px, with additional reserved space in the skin layout for taller logos like Commons, or wider logos like Wikidata. This information must come from the image file or the CSS, not the skin.

I believe this is a side-effect of an SVG incorrectly being placed inside the wgLogos[1x] configuration, which currently only supports a raster file that provides its own fixed width and height information.

Our CSS only sets background-size for higher DPI and SVG keys, which means as-written SVGs are only suitable for svg key, not for 1x (which requires a raster file). That's what the svg key exists for after all, and these would always be set in addition to a 1x raster file.

This could alternatively also repaired in other ways, e.g. by implementing support for SVG under 1x in the SkinModule, and adjusting the generated CSS accordingly to include a size declaration, or by providing a PNG at 1x and setting the SVG as the value for svg.

Event Timeline

Change 793539 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Define background size on logos with 1x and icon keys

https://gerrit.wikimedia.org/r/793539

I think the above patch should solve this issue.

Change 800310 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Installer: Add constraint that uploaded graphic must be SVG

https://gerrit.wikimedia.org/r/800310

Change 793539 abandoned by Jdlrobson:

[mediawiki/core@master] ResourceLoader: Define background-size for certain config variants

Reason:

On second thoughts I think it will be simpler to simply set the 'svg' field in the installer. See https://gerrit.wikimedia.org/r/c/mediawiki/core/+/800310

https://gerrit.wikimedia.org/r/793539

Change 802640 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] change-your-logo.svg: Resize to 135px square, re-crush, and manually minify

https://gerrit.wikimedia.org/r/802640

Change 802610 had a related patch set uploaded (by Reedy; author: Jforrester):

[mediawiki/core@REL1_38] change-your-logo.svg: Resize to 135px square, re-crush, and manually minify

https://gerrit.wikimedia.org/r/802610

Change 802610 merged by jenkins-bot:

[mediawiki/core@REL1_38] change-your-logo.svg: Resize to 135px square, re-crush, and manually minify

https://gerrit.wikimedia.org/r/802610

Change 802640 merged by jenkins-bot:

[mediawiki/core@master] change-your-logo.svg: Resize to 135px square, re-crush, and manually minify

https://gerrit.wikimedia.org/r/802640

Jdlrobson claimed this task.

Change 800310 abandoned by Jdlrobson:

[mediawiki/core@master] Installer: Add constraint that uploaded graphic must be SVG

Reason:

Fixed by https://gerrit.wikimedia.org/r/802640

https://gerrit.wikimedia.org/r/800310