Page MenuHomePhabricator

Remove css class tex?
Closed, ResolvedPublic

Description

When math rendering was part of core (long ago) images and source rendering were tagged with the CSS class name tex .
We still do so today in source rendering mode.

Do we want to keep doing this forever?

Event Timeline

Change 969508 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Explain the significance of the img.tex css element

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

Physikerwelt renamed this task from Remove css class tex to Remove css class tex?.Oct 29 2023, 2:28 PM
Physikerwelt triaged this task as Low priority.

Change 969508 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Explain the significance of the img.tex css element

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

Physikerwelt claimed this task.
Physikerwelt added a subscriber: Jdlrobson.

@Jdlrobson I assume that is okay for the web-team to keep the CSS class tex and close this issue. I added the web-team to understand if this might conflict with the stable interface policy CSS class naming conventions https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS#Naming T346467.

@Physikerwelt I see! Thanks for documenting the code that will be useful!
This doesn't seem in conflict with the stable interface policy from my perspective as it looks like an old class has been replaced with a new mw- prefixed class and you've followed instructions about keeping the old class around but note:

In the case of renaming classes, it is recommended that the new class SHOULD be added along with the removed class for at least one MediaWiki release cycle in case third parties may be relying on them e.g. for HTML processing. An inline comment SHOULD indicate in which release the old class was deprecated.

Per this instruction you should mention when the class was deprecated and remove the legacy class after one MediaWiki release cycle (or document when a suitable time or condition would be satisfied to warrant removing it).

FWIW I think this would be a great topic to start on the talk page (https://www.mediawiki.org/wiki/Manual_talk:Coding_conventions/CSS) to get clarity around updating existing classes to conform to this coding convention. Does this summarize your ask here (feel free to copy paste into the talk page if so)?

In some cases, we retain legacy classes for backwards compatibility. For example in the Math extension the class "tex" predates "mwe-math-fallback-source-display" and "mwe-math-fallback-source-inline". What guidance can be added for retroactively making code conform to guidelines without breaking consumers that might be using the existing class?