Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add RTL support #61

Merged
merged 1 commit into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/core/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const del = require('del');
const gulp = require('gulp');
const rename = require('gulp-rename');
const postcss = require('gulp-postcss');
const rtlcss = require('gulp-rtlcss');
const postcssPresetInfima = require('postcss-preset-infima');
const webserver = require('gulp-webserver');

Expand All @@ -29,6 +30,14 @@ function transformStyles() {
.pipe(gulp.dest('./dist/css'));
}

function createRtlStyles() {
return gulp
.src('./dist/css/**/*.css')
.pipe(rtlcss())
.pipe(rename({suffix: '-rtl'}))
.pipe(gulp.dest('./dist/css'));
}

function transformScripts() {
// Only copy for now. In future run through Babel.
return gulp.src('./js/**/*.js').pipe(gulp.dest('./dist/js'));
Expand Down Expand Up @@ -70,7 +79,7 @@ function clean() {
return del(['./dist/**/*', './demo/css/**', './demo/js/**']);
}

const transformAssets = gulp.parallel(transformStyles, transformScripts);
const transformAssets = gulp.parallel(gulp.series(transformStyles, createRtlStyles), transformScripts);
const copyAssetsToDemo = gulp.parallel(copyStylesToDemo, copyScriptsToDemo);
const minifyAssets = gulp.parallel(minifyStyles, minifyScripts);
const transformAndCopy = gulp.series(transformAssets, copyAssetsToDemo);
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"gulp": "^4.0.0",
"gulp-postcss": "^8.0.0",
"gulp-rename": "^1.2.2",
"gulp-rtlcss": "^1.4.1",
"gulp-sass": "^4.0.1",
"gulp-webserver": "^0.9.1",
"natives": "^1.1.6",
Expand Down
Loading