Page MenuHomePhabricator

Remove !important from special page font declarations in minerva and increase specificity of rule
Open, LowPublic

Description

When using the minerva skin on enwiki (and not on other projects such as eswiki or testwiki) the computed stylesheet:

<view-source:https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.wikimediaBadges%7Cmediawiki.hlist%7Cmediawiki.ui.button%2Ccheckbox%2Cicon%2Cinput%2Cradio%7Cmobile.init.styles%7Cmobile.pagelist.styles%7Cmobile.pagesummary.styles%7Cmobile.placeholder.images%7Cmobile.special.history.styles%7Cmobile.special.pagefeed.styles%7Cmobile.special.styles%7Cmobile.user.icons%7Cskins.minerva.amc.styles%7Cskins.minerva.base.styles%7Cskins.minerva.content.styles.images%7Cskins.minerva.icons.wikimedia%7Cskins.minerva.mainMenu.icons%2Cstyles%7Cskins.minerva.messageBox.styles&only=styles&skin=minerva>

The loaded rule is:

.ns-special h1,
.ns-special h2 {
font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Lato', 'Helvetica', 'Arial', sans-serif !important
}

The !important enhancer seems over used here, however we are having a hard time determining where this is being introduced to determine why it was introduced.

reported on-wiki in https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Elements_in_custom_CSS_disabled

Event Timeline

Suspect it is somewhere deep in mobilefrontend

Thank you for the tip, I saw very similar code in https://gerrit.wikimedia.org/g/mediawiki/extensions/MobileFrontend/+/ee9659197f39824d7fafd9b8a4ceb16c80ab6b4c/mobile.less/mobile.variables.less but I'm still at a loss for where the !important is coming from there - my code-search-fu must be lacking

Thank you! From T173597 ; @Jdlrobson is forcing this styling to "!important" necessary here - seems to be preventing userstyles from taking affect?

Xaosflux renamed this task from Overly !important font on enwiki in minerva to Overly !important font in minerva.Nov 28 2021, 11:49 PM

I don't think the !important is necessary here, but it needs to override .pre-content h1, .content h1, .content h2 so I think provided .ns-special h1, .ns-special h2 is replaced with .ns-special .pre-content h1, .ns-special .content h1, .content h2 a patch would be welcome to drop the !important.

I think originally the goal was to have consistent headings across pages because certain special pages were deviating from standard font families, but I don't think that's happening any more, and if it is, it's better fixed in the special page itself.

Jdlrobson renamed this task from Overly !important font in minerva to Remove !important from special page font declarations in minerva and increase specificity of rule.Nov 30 2021, 6:52 PM
Jdlrobson triaged this task as Low priority.

Greetings!!
Is this issue still open to work? If yes, can anyone guide me through?

Aklapper added a subscriber: nilima_mahakur28.

@nilima_mahakur28: I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task. Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding!