Skip to content

Commit

Permalink
Packages: Adding RTL CSS support to the packages CSS (#8187)
Browse files Browse the repository at this point in the history
* Packages: Adding RTL CSS support to packages built CSS

* Minify CSS files for prod
  • Loading branch information
youknowriad authored Jul 25, 2018
1 parent 3b13a1b commit 66747a0
Show file tree
Hide file tree
Showing 5 changed files with 1,276 additions and 1,943 deletions.
10 changes: 10 additions & 0 deletions bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function buildFile( file, silent ) {
function buildStyle( packagePath ) {
const styleFile = path.resolve( packagePath, SRC_DIR, 'style.scss' );
const outputFile = path.resolve( packagePath, BUILD_DIR.style, 'style.css' );
const outputFileRTL = path.resolve( packagePath, BUILD_DIR.style, 'style-rtl.css' );
mkdirp.sync( path.dirname( outputFile ) );
const builtSass = sass.renderSync( {
file: styleFile,
Expand All @@ -98,8 +99,17 @@ function buildStyle( packagePath ) {
.then( ( result ) => callback( null, result ) );
};

const postCSSRTLSync = ( ltrCSS, callback ) => {
postcss( [ require( 'rtlcss' )() ] )
.process( ltrCSS, { from: 'src/app.css', to: 'dest/app.css' } )
.then( ( result ) => callback( null, result ) );
};

const result = deasync( postCSSSync )();
fs.writeFileSync( outputFile, result.css );

const resultRTL = deasync( postCSSRTLSync )( result );
fs.writeFileSync( outputFileRTL, resultRTL );
}

/**
Expand Down
3 changes: 0 additions & 3 deletions nux/index.js

This file was deleted.

Loading

0 comments on commit 66747a0

Please sign in to comment.