Page MenuHomePhabricator

Separate styling of links in ResourceLoaderSkinModule feature legacy feature
Closed, ResolvedPublic

Description

There are various styles relating to links inside the existing legacy feature. Let's move these into a new feature called content.links

Acceptance criteria

  • The elements feature will contain styles for logged in users which want underlined links e.g. .mw-underline-always or e.g. .mw-underline-never
  • Plain link external link styling /*.plainlinks a.external */ is moved into elements feature
  • autonumber is moved to content.parser-output

note

  • Red link encoding e.g. a.new will be deprecated and moved to skins.

Event Timeline

I investigated autonumber. It lives in Parser.php (handleExternalLinks) - it labels external wiki links that do not specify text (e.g. [www.example.org]). It's only legacy in the sense that it's old. I'm not sure if Parsoid does the same, but I can imagine that deprecating would be received badly.

So perhaps that should be moved to content.parser-output since its an artifact of the parser ?

I just noticed the content-links feature already exists, but it provides the external link icons.

That feature and the proposed feature should be separate. Some skins (including Mirage and Vector) would like to use the default linking styles, but provide custom external link icons (because they want to use OOUI for example).

Given that content-links isn't yet stable, we could rename it to content-external-links.

There's more of this stuff in elements.css. I wonder if it wouldn't be better to move a.new to elements.css. Note that that file already defines a.new but with a different colour. The inheritance order ensures that legacy.less takes precedence though...

Frankly, I see no reason for a separate skin feature, everything can either be moved to elements or to content-parser-output.

Yeh content-parser-output makes sense for a.new. Perhaps the other classes can live in the existing links feature?

Change 675210 had a related patch set uploaded (by Mainframe98; author: Mainframe98):
[mediawiki/core@master] Move legacy link styles to other skin features

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

I took a slightly different approach in https://gerrit.wikimedia.org/r/675210, with doesn't need a new feature.

One thing to note about a.new is, that Vector is the only skin relying on legacy.less a.new. There is a task about this: T213778. It would probably help that task that, regardless of the outcome of this task, the value of a.new is defined in Vector itself, without relying on legacy.less, especially since that task states (it will not affect legacy Vector)`.

Good point. Thanks for pulling that up @Mainframe99

I'll look to merge these on Tuesday after the branch cut, so we have some more time for testing. Thank you so much for these patches in time for the 1.36 release!

Jdlrobson renamed this task from Create the `content.links` ResourceLoaderSkinModule feature, pulling code out of legacy to Separate styling of links in ResourceLoaderSkinModule feature legacy feature.Mar 30 2021, 4:45 PM

Change 675210 merged by jenkins-bot:

[mediawiki/core@master] Move legacy link styles to other skin features

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

Jdlrobson updated the task description. (Show Details)