Make WordPress Core


Ignore:
Timestamp:
11/12/2013 09:18:45 PM (8 years ago)
Author:
nacin
Message:

Use CSSJanus via a Grunt task to generate right-to-left CSS.

RTL files are now created on build for core CSS files. These files replace the LTR file completely, rather than being in addition to the existing LTR file.

Benefits:

  • For the user: less CSS is served in RTL, less HTTP requests on the frontend, and less work for the browser.
  • For the core developer: Let the tools do the work.

Notes for core development:

  • The file generation task is grunt rtl.
  • grunt watch now handles generating RTL files in /build when a CSS file in /src is saved.
  • /src is now locked to LTR. RTL testing must occur via /build. When attempting to run an RTL text direction with /src, an admin notice will display.

Expect RTL bugs. Please report them.

props yoavf.
see #24977.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r26072 r26107  
    553553
    554554    $rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'customize-controls', 'media-views', 'wp-color-picker' );
    555     // Any rtl stylesheets that don't have a .min version
    556     $no_suffix = array( 'farbtastic' );
    557555
    558556    $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array( 'open-sans', 'dashicons' ) );
     
    593591
    594592    foreach ( $rtl_styles as $rtl_style ) {
    595         $styles->add_data( $rtl_style, 'rtl', true );
    596         if ( $suffix && ! in_array( $rtl_style, $no_suffix ) )
    597             $styles->add_data( $rtl_style, 'suffix', $suffix );
     593        $styles->add_data( $rtl_style, 'rtl', 'replace' );
    598594    }
    599595}
Note: See TracChangeset for help on using the changeset viewer.