From 785a38ec28d5f4a22489bab36a067030ab140b5d Mon Sep 17 00:00:00 2001 From: Khokan Sardar Date: Wed, 2 Sep 2026 12:36:37 +0530 Subject: [PATCH] Build/Test Tools: Swap RTL arrow icons that carry alternative text. The `swap-dashicons-left-right-arrows` rtlcss plugin matches each `content` value against the six arrow glyphs by exact string equality, so a declaration written with alternative text, `content: "\f141" / '';`, never matches and keeps its LTR arrow. The generated stylesheets then pair a correctly flipped fallback with an unflipped modern value. Set any alternative text aside before the comparison and restore it after, so both declarations agree. This corrects 17 declarations across seven stylesheets, including the toolbar submenu arrows. Fixes #66020. --- Gruntfile.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9f34d13b57721..134aa5eb58c74 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -925,6 +925,11 @@ module.exports = function(grunt) { { expr: /content/im, action: function( prop, value ) { + // Alternative text, as in `content: "\f141" / '';`, is not part of the icon. + var altText = ( value.match( /\s*\/\s*(?:'[^']*'|"[^"]*")\s*$/ ) || [ '' ] )[ 0 ]; + + value = value.slice( 0, value.length - altText.length ); + if ( value === '"\\f141"' ) { // dashicons-arrow-left value = '"\\f139"'; } else if ( value === '"\\f340"' ) { // dashicons-arrow-left-alt @@ -938,7 +943,7 @@ module.exports = function(grunt) { } else if ( value === '"\\f345"' ) { // dashicons-arrow-right-alt2 value = '"\\f341"'; } - return { prop: prop, value: value }; + return { prop: prop, value: value + altText }; } } ]