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.

Built from https://develop.svn.wordpress.org/trunk@26107


git-svn-id: http://core.svn.wordpress.org/trunk@26022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2013-11-12 21:19:15 +00:00
parent 522f3168d2
commit 1e30be32c4
25 changed files with 12814 additions and 1695 deletions

View File

@@ -552,8 +552,6 @@ function wp_default_styles( &$styles ) {
$suffix = SCRIPT_DEBUG ? '' : '.min';
$rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'customize-controls', 'media-views', 'wp-color-picker' );
// Any rtl stylesheets that don't have a .min version
$no_suffix = array( 'farbtastic' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array( 'open-sans', 'dashicons' ) );
@@ -592,9 +590,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.css", array( 'mediaelement' ) );
foreach ( $rtl_styles as $rtl_style ) {
$styles->add_data( $rtl_style, 'rtl', true );
if ( $suffix && ! in_array( $rtl_style, $no_suffix ) )
$styles->add_data( $rtl_style, 'suffix', $suffix );
$styles->add_data( $rtl_style, 'rtl', 'replace' );
}
}