styles: Unify on standard external link icon

Unify on using standard OOUI 'linkExternal' icon, which is directly
replacing Vector's image without relying on ResourceLoader.
Please note that the icon features standard link color `#36c` which is
implemented in a later step. Due to the small icon size and the fact
that current external link icon is also not using the legacy color, this
seems acceptable to move forward with.

Also using relative `em` instead of `px` to support user text zoom
capabilities and introducing a `@size-indicator` variable to be replaced
by WikimediaUI Base variables later.
Alternative to I49de3bfff45.

Replacing images and image names to make quicker lookup with icon
collection possible future-facing.

Note that CSSJanus is flipping the `ltr` string in the background image
rule to `rtl`, therefore making sure that both icons are available.

Bug: T261391
Change-Id: Ibd15517f3adf06010807901e8fb3299e2046a473
This commit is contained in:
Volker E 2022-07-19 12:25:18 -07:00
parent 048e40d0bf
commit cffd494107
6 changed files with 24 additions and 15 deletions

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12">
<path fill="#fff" stroke="#36c" d="M1.5 4.518h5.982V10.5H1.5z"/>
<path fill="#36c" d="M5.765 1H11v5.39L9.427 7.937l-1.31-1.31L5.393 9.35l-2.69-2.688 2.81-2.808L4.2 2.544z"/>
<path fill="#fff" d="m9.995 2.004.022 4.885L8.2 5.07 5.32 7.95 4.09 6.723l2.882-2.88-1.85-1.852z"/>
</svg>

Before

Width:  |  Height:  |  Size: 387 B

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12">
<path fill="#fff" stroke="#36c" d="M10.5 4.518H4.518V10.5H10.5z"/>
<path fill="#36c" d="M6.234 1H1v5.39l1.57 1.546 1.31-1.31L6.607 9.35l2.69-2.688-2.81-2.808L7.8 2.544z"/>
<path fill="#fff" d="M2.004 2.004 1.982 6.89 3.8 5.07l2.88 2.88 1.228-1.227-2.88-2.88 1.85-1.852z"/>
</svg>

Before

Width:  |  Height:  |  Size: 386 B

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<title>
external link
</title><g fill="#36c">
<path d="M17 17H3V3h5V1H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5h-2z"/>
<path d="m11 1 3.29 3.29-5.73 5.73 1.42 1.42 5.73-5.73L19 9V1z"/>
</g></svg>

After

Width:  |  Height:  |  Size: 336 B

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<title>
external link
</title><g fill="#36c">
<path d="M3 12H1v5c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2h-5v2h5v14H3z"/>
<path d="m1 9 3.3-3.3 5.7 5.7 1.4-1.4-5.7-5.7L9 1H1z"/>
</g></svg>

After

Width:  |  Height:  |  Size: 326 B

View file

@ -140,10 +140,14 @@ pre,
}
// External links
// Use of `a` element selector due to its widespread usage and for limiting generic class scope.
// Use of `a` element selector for limiting generic class scope due to `.external` widespread usage.
.mw-parser-output a.external {
background-image: url( images/external-link-ltr-icon.svg );
// Use copy of Codex/OOUI WikimediaUI theme's 'linkExternal' icon in progressive color.
// Note that CSSJanus is flipping the `ltr` in the URL to `rtl`.
// Therefore make sure that both icons are available and up-to-date.
background-image: url( images/link-external-ltr-progressive.svg );
background-position: center right;
background-repeat: no-repeat;
padding-right: 13px;
background-size: @size-indicator;
padding-right: 1em;
}

View file

@ -63,6 +63,7 @@
@size-sidebar-button: unit( 44 / @font-size-browser, em ); // Equals `2.75em`.
@size-icon: unit( 20 / @font-size-browser, em );
@size-indicator: unit( 12 / @font-size-browser, em );
@background-position-nav-personal-icon: left unit( 4 / @font-size-browser / @font-size-nav-personal, em );
@background-size-nav-personal-icon: unit( 14 / @font-size-browser / @font-size-nav-personal, em );