Navigation Menu

Skip to content

Commit

Permalink
feat(styles): Make it possible to generate multiple css themes
Browse files Browse the repository at this point in the history
  • Loading branch information
chloe463 committed May 8, 2017
1 parent cfc2436 commit 688a6e2
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 5 deletions.
12 changes: 12 additions & 0 deletions gulpfile.js
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const gulp = require('gulp');
const gulpBetterRollup = require('gulp-better-rollup');
const gulpSass = require('gulp-sass');
const gulpSassThemes = require('gulp-sass-themes');
const autoPrefixer = require('gulp-autoprefixer');
const gulpRename = require('gulp-rename');
const gulpCleanCss = require('gulp-clean-css');
Expand Down Expand Up @@ -94,6 +95,17 @@ gulp.task('minify:css', () => {
.pipe(gulp.dest(BUNDLES_ROOT));
});

// Build css with themes
gulp.task('build:css:themes', () => {
const TARGET_FILE = path.join(SOURCE_ROOT, 'francette-themed.scss');
return gulp.src(TARGET_FILE)
.pipe(gulpSassThemes('./styles/themes/_*.scss', { cwd: './src', placeholder: /^francette\-(themed)\.(scss|sass)$/ }))
.pipe(gulpSass()).on('error', gulpSass.logError)
.pipe(autoPrefixer())
.pipe(gulpCleanCss())
.pipe(gulp.dest('builds/bundles'));
});

// bundle js files
gulp.task('build:rollup', () => {
const TARGET_FILE = path.join(BUILDS_ROOT, 'index.js');
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -48,6 +48,7 @@
"gulp-clean-css": "^2.3.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sass-themes": "^2.0.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
Expand Down
25 changes: 25 additions & 0 deletions src/francette-themed.scss
@@ -0,0 +1,25 @@
@import './styles/themes/default';
@import './styles/alerts';
@import './styles/buttons';
@import './styles/grid';
@import './styles/navbar';
@import './styles/list';
@import './styles/panel';
@import './styles/table';
@import './styles/kpi-dashboard';
@import './styles/tabs';
@import './styles/radio';
@import './styles/tile';
@import './styles/timepicker';
@import './styles/steps';
@import './styles/ripple';
@import './styles/chips';
@import './styles/select';
@import './styles/input-text';
@import './styles/data-table';
@import './styles/textbox';
@import './styles/checkbox';
@import './styles/date-picker';
@import './styles/side-nav';
@import './styles/form-group';
@import './styles/input-container';
File renamed without changes.
28 changes: 23 additions & 5 deletions yarn.lock
Expand Up @@ -2108,6 +2108,16 @@ globby@^5.0.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"

globby@^6.0.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
dependencies:
array-union "^1.0.1"
glob "^7.0.3"
object-assign "^4.0.1"
pify "^2.0.0"
pinkie-promise "^2.0.0"

globule@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/globule/-/globule-1.1.0.tgz#c49352e4dc183d85893ee825385eb994bb6df45f"
Expand Down Expand Up @@ -2197,6 +2207,14 @@ gulp-rename@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.2.2.tgz#3ad4428763f05e2764dec1c67d868db275687817"

gulp-sass-themes@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/gulp-sass-themes/-/gulp-sass-themes-2.0.1.tgz#107d034ca1b46ee9290ed740e3f14faade20efd0"
dependencies:
globby "^6.0.0"
slash "^1.0.0"
through2 "^2.0.0"

gulp-sass@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/gulp-sass/-/gulp-sass-3.1.0.tgz#53dc4b68a1f5ddfe4424ab4c247655269a8b74b7"
Expand Down Expand Up @@ -3330,11 +3348,7 @@ lowercase-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306"

lru-cache@2:
version "2.7.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"

lru-cache@2.2.x:
lru-cache@2, lru-cache@2.2.x:
version "2.2.4"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d"

Expand Down Expand Up @@ -4897,6 +4911,10 @@ silent-error@^1.0.0:
dependencies:
debug "^2.2.0"

slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"

slide@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707"
Expand Down

0 comments on commit 688a6e2

Please sign in to comment.