From ddd977d46a0cddc33b14ae044ca3bd5b709108d0 Mon Sep 17 00:00:00 2001 From: Ryan Schmukler Date: Thu, 30 Oct 2014 21:52:38 -0400 Subject: [PATCH] refactor(theming): switch angular-material.css to include default-theme --- gulpfile.js | 12 ++++-- src/main.scss | 37 ------------------- ...default-theme.scss => _default-theme.scss} | 0 3 files changed, 8 insertions(+), 41 deletions(-) delete mode 100644 src/main.scss rename themes/{default-theme.scss => _default-theme.scss} (100%) diff --git a/gulpfile.js b/gulpfile.js index 6b19a2949f6..5839521b117 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -155,7 +155,7 @@ gulp.task('server', function() { gulp.task('build-default-theme', function() { return gulp.src(config.themeBaseFiles.concat(path.join(config.paths, '*-theme.scss'))) - .pipe(concat('default-theme.scss')) + .pipe(concat('_default-theme.scss')) .pipe(utils.hoistScssVariables()) .pipe(gulp.dest('themes/')); }); @@ -168,7 +168,7 @@ gulp.task('build-theme', ['build-default-theme'], function() { gulp.task('build-themes', ['build-default-theme'], function() { var stream = mergeStream(); - var themes = glob('themes/*.scss', { cwd: __dirname }); + var themes = glob('themes/**.scss', { cwd: __dirname }).filter(function(themeName) { return themeName.split('/')[1].charAt(0) != '_'; }); themes.forEach(function(themeFile) { var name = themeFile.match(/((\w|-)+)-theme\.scss/)[1]; stream.add(buildTheme(name)); @@ -178,20 +178,24 @@ gulp.task('build-themes', ['build-default-theme'], function() { function buildTheme(theme) { gutil.log("Building theme " + theme + "..."); - return gulp.src(['src/core/style/color-palette.scss', 'themes/' + theme + '-theme.scss', 'themes/default-theme.scss']) + return gulp.src(['src/core/style/color-palette.scss', 'themes/' + theme + '-theme.scss', 'themes/_default-theme.scss']) .pipe(concat(theme + '-theme.scss')) .pipe(utils.hoistScssVariables()) .pipe(sass()) .pipe(gulp.dest(config.outputDir + 'themes/')); } -gulp.task('build-scss', function() { +gulp.task('build-scss', ['build-default-theme'], function() { + var defaultThemeContents = fs.readFileSync('themes/_default-theme.scss'); + + var scssGlob = path.join(config.paths, '*.scss'); gutil.log("Building css files..."); return gulp.src(config.scssBaseFiles.concat(scssGlob)) .pipe(filterNonCodeFiles()) .pipe(filter(['**', '!**/*-theme.scss'])) // remove once ported .pipe(concat('angular-material.scss')) + .pipe(insert.append(defaultThemeContents)) .pipe(sass()) .pipe(autoprefix()) .pipe(insert.prepend(config.banner)) diff --git a/src/main.scss b/src/main.scss deleted file mode 100644 index e5dd059ae4b..00000000000 --- a/src/main.scss +++ /dev/null @@ -1,37 +0,0 @@ -@import - -// Variables -"core/style/variables", - -// Base -"core/style/mixins", -"core/style/structure", -"core/style/table", -"core/style/layout", - -// Components -"components/animate/effects", -"components/backdrop/backdrop", -"components/bottomSheet/bottomSheet", -"components/button/button", -"components/card/card", -"components/checkbox/checkbox", -"components/content/content", -"components/dialog/dialog", -"components/divider/divider", -"components/icon/icon", -"components/list/list", -"components/progressCircular/progressCircular", -"components/progressLinear/progressLinear", -"components/radioButton/radio-button", -"components/sidenav/sidenav", -"components/slider/slider", -"components/sticky/sticky", -"components/subheader/subheader", -"components/switch/switch", -"components/tabs/tabs", -"components/textField/textField", -"components/toast/toast", -"components/toolbar/toolbar", -"components/tooltip/tooltip", -"components/whiteframe/whiteframe"; diff --git a/themes/default-theme.scss b/themes/_default-theme.scss similarity index 100% rename from themes/default-theme.scss rename to themes/_default-theme.scss