From a0d2c2497b85adba03fe551b6e8e1be6cdf3f696 Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Mon, 1 Jun 2020 21:09:42 -0600 Subject: [PATCH] [fix][RTL] flip menu collapse button icon Fix the icon button directionality in right-to-left languages. Previously, the button was hardcoded to support left-to-right only. - Replace the skin.vector.icons' `.mw-ui-icon-wikimedia-{name}:before` `selector` in skin.json with a placeholder, `{name}`. I don't think this selector should be needed but it seems to be erroneous not have one. I believe this issue of wanting a null selector was encountered in Minerva or MobileFrontend but am unable to locate the past discourse. - Add check and unchecked menu button selectors to skin.json that set the appropriate background image. This shards some of the styles out of Less and into ResourceLoader-land but it's worthwhile. - Revise the name of horizontal collapse icon to describe its form not function, "collapseHorizontal" to "chevronHorizontal". This has been an established convention that was missed a couple patches back. - Add a flipped chevronHorizontal for RTL. I used Inkscape to do the flip and tried to match the style of the original by hand. Feel free to edit further. - Drop the now unnecessary icon flipping JavaScript and initial Mustache class. This enables a real CSS-only solution for the icons. Bug: T246419 Change-Id: I60f65b3c595bf18d309b667d9a0b066691b90c97 --- includes/templates/Sidebar.mustache | 8 +------ ...rizontal.svg => chevronHorizontal-ltr.svg} | 2 +- .../chevronHorizontal-rtl.svg | 7 ++++++ resources/skins.vector.js/skin.js | 23 ------------------- skin.json | 11 ++++++--- 5 files changed, 17 insertions(+), 34 deletions(-) rename resources/skins.vector.icons/{collapseHorizontal.svg => chevronHorizontal-ltr.svg} (93%) create mode 100644 resources/skins.vector.icons/chevronHorizontal-rtl.svg diff --git a/includes/templates/Sidebar.mustache b/includes/templates/Sidebar.mustache index e4578ed..a348d2e 100644 --- a/includes/templates/Sidebar.mustache +++ b/includes/templates/Sidebar.mustache @@ -22,13 +22,7 @@ aria-controls="mw-panel">