Make WordPress Core

Changeset 63885


Ignore:
Timestamp:
09/23/2026 12:05:51 AM (8 weeks ago)
Author:
lancewillett
Message:

Build/Test Tools: Correct RTL arrows with alternative text.

Set aside CSS content alternative text before matching directional Dashicons, then restore it after swapping the glyph. This keeps modern declarations consistent with their legacy fallbacks in generated RTL stylesheets.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13361

Props khokansardar, sabernhardt, joedolson.
Fixes #66020.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r63883 r63885  
    965965                                                                expr: /content/im,
    966966                                                                action: function( prop, value ) {
     967                                                                        // Alternative text, as in `content: "\f141" / '';`, is not part of the icon.
     968                                                                        var altText = ( value.match( /\s*\/\s*(?:'[^']*'|"[^"]*")\s*$/ ) || [ '' ] )[ 0 ];
     969
     970                                                                        value = value.slice( 0, value.length - altText.length );
     971
    967972                                                                        if ( value === '"\\f141"' ) { // dashicons-arrow-left
    968973                                                                                value = '"\\f139"';
    … …  
    978983                                                                                value = '"\\f341"';
    979984                                                                        }
    980                                                                         return { prop: prop, value: value };
     985                                                                        return { prop: prop, value: value + altText };
    981986                                                                }
    982987                                                        }
Note: See TracChangeset for help on using the changeset viewer.