Make WordPress Core


Ignore:
Timestamp:
11/12/2013 09:18:45 PM (11 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/locale.php

    r24971 r26107  
    184184        elseif ( 'rtl' == _x( 'ltr', 'text direction' ) )
    185185            $this->text_direction = 'rtl';
     186
     187        if ( 'rtl' === $this->text_direction && strpos( $GLOBALS['wp_version'], '-src' ) ) {
     188            $this->text_direction = 'ltr';
     189            add_action( 'all_admin_notices', array( $this, 'rtl_src_admin_notice' ) );
     190        }
     191    }
     192
     193    function rtl_src_admin_notice() {
     194        echo '<div class="error"><p>' . 'The <code>build</code> directory of the develop repository must be used for RTL.' . '</p></div>';
    186195    }
    187196
Note: See TracChangeset for help on using the changeset viewer.