Page MenuHomePhabricator

Don't override site authors' styles by using inline style in UniversalLanguageSelector
Closed, ResolvedPublic

Description

Author: michael

Description:
The ULS specifies fonts by injecting inline style sheets into the DOM.

This overrides site style sheets, takes control away from site authors and administrators, as well as readers, including those using accessibility technology, and encourages authors to use the harmful !important CSS keyword.

An example of the problem: on en.wiktionary there is a mature framework of classes used to set fonts by script code, alongside the use of HTML lang attributes. The ULS randomly interferes with this.

For example, in the page Fraktur, a passage of text is specified as <span class="Latf" lang="de"> to set it in a Fraktur font. The class .Latf applies font-family: UnifrakturMaguntia, a web font that is *provided by the ULS.*

The ULS adds a style="font-family: sans-serif;" which would be needless otherwise, but in en.Wiktionary overrides the authors’ CSS which resides in MediaWiki:Common.css

https://en.wiktionary.org/wiki/Fraktur#German
https://en.wiktionary.org/wiki/MediaWiki:Common.css

How are authors supposed to reliably specify correct fonts? How are authors supposed to specify web fonts provided by the ULS? Why are fonts specified with inline CSS, which robs all control from authors? Why is German-language text specifically formatted as sans-serif?

The ULS should operate using the standard framework of lang attributes, classes, and style sheets instead of inline CSS, providing authors, editors, readers, and users of accessibility technology with several avenues to control or override its behaviour.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=39992
https://bugzilla.wikimedia.org/show_bug.cgi?id=53734

Details

Reference
bz54453

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:10 AM
bzimport set Reference to bz54453.

michael wrote:

Related:

Bug 39992 - ULS: Don't set inline "font-family: sans-serif" when no fonts are specified

By design, ULS tries to give priority to user custom font styles. It is supposed to apply inline font only when no such styles exist. In this specific case, it is not respected and I confirm the bug. This is a regression from https://github.com/wikimedia/jquery.webfonts/commit/39e3851ca1e17e7e9d5968b0af1a0523abf87060 and I am working on it. Thanks.

(For record, this is the same commit cause this bug too: https://bugzilla.wikimedia.org/show_bug.cgi?id=53734)

dmitrismirnov wrote:

Template lang creates bad effect: it shows a different sort of font that looks much bigger that other text around it. It was not like this about two months ago.
Here is only one an example (but there are thousands like this):

https://ru.wikisource.org/wiki/%D0%A2%D0%A1%D0%94/%D0%90%D0%B4%D0%B0%D0%BC

~~~~

dmitrismirnov wrote:

Yes, now it is OK. Thanks!!! ~~~~