Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
work on #3: gulp-sass - rename to module.scss/app.css
Browse files Browse the repository at this point in the history
  • Loading branch information
gruppjo committed Jun 15, 2015
1 parent 1e5c391 commit e0b4dee
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/templates/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- endbower -->
<!-- endbuild -->

<!-- build:css main/styles/main.css -->
<!-- build:css main/styles/app.css -->
<!-- inject:css -->
<!-- endinject -->
<!-- endbuild -->
Expand Down
6 changes: 3 additions & 3 deletions app/templates/gulp_tasks/injecting.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gulp.task('inject-all', ['styles', 'wiredep', 'bower-fonts', 'environment', 'bui
{relative: true}))
.pipe(
$.inject( // inject compiled css
gulp.src('.tmp/*/styles/main.css', {read: false}),
gulp.src('.tmp/*/styles/module.css', {read: false}),
{
ignorePath: '../.tmp',
relative: true,
Expand All @@ -35,8 +35,8 @@ gulp.task('inject-all', ['styles', 'wiredep', 'bower-fonts', 'environment', 'bui

// build styles to tmp
gulp.task('styles', function () {
// compile css starting from each module's main.scss
return gulp.src('app/*/styles/main.scss')
// compile css starting from each module's module.scss
return gulp.src('app/*/styles/module.scss')
.pipe($.plumber())
.pipe($.sourcemaps.init())
.pipe($.sass().on('error', $.sass.logError))
Expand Down
2 changes: 1 addition & 1 deletion app/templates/gulp_tasks/watching.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ gulp.task('watch', ['serve', 'linting'], function () {

gulp.watch([
'app/index.html',
'.tmp/*/styles/main.css', // each module's main.css
'.tmp/*/styles/module.css', // each module's module.css
'app/*/assets/**/*',
'app/*/templates/**/*',
].concat(paths.jsFiles),
Expand Down
2 changes: 1 addition & 1 deletion module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var MGenerator = yeoman.generators.NamedBase.extend({
mkdirp.sync(moduleFolder + 'filters/');
mkdirp.sync(moduleFolder + 'services/');
mkdirp.sync(moduleFolder + 'styles/');
this.template('_main.scss', moduleFolder + 'styles/main.scss');
this.template('_module.scss', moduleFolder + 'styles/module.scss');
mkdirp.sync(moduleFolder + 'templates/');

var options = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ $assertive: #ef4e3a !default;
$royal: #8a6de9 !default;
$dark: #444 !default;

// The path for our ionicons font files, relative to the built & temporary main.css
// The path for our ionicons font files, relative to the built & temporary module.css
$ionicons-font-path: "../assets/fonts" !default;

// Include all of Ionic
@import "../../bower_components/ionic/scss/ionic";

// TODO: import scss files from other modules
// @import "../../<module>/styles"
<% } -%>

10 changes: 5 additions & 5 deletions test/test-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('m:module', function () {
modulePath + '/directives',
modulePath + '/filters',
modulePath + '/services',
modulePath + '/styles/main.scss',
modulePath + '/styles/module.scss',
modulePath + '/templates'
]);
});
Expand All @@ -36,8 +36,8 @@ describe('m:module', function () {
]);
});

it('main.scss is empty', function () {
assert.noFileContent(modulePath + '/styles/main.scss', '$light');
it('module.scss is empty', function () {
assert.noFileContent(modulePath + '/styles/module.scss', '$light');
});
};

Expand Down Expand Up @@ -124,8 +124,8 @@ describe('m:module', function () {
]);
});

it('main.scss has ionic includes', function () {
assert.fileContent('app/main/styles/main.scss', '$light');
it('module.scss has ionic includes', function () {
assert.fileContent('app/main/styles/module.scss', '$light');
});
});
});

0 comments on commit e0b4dee

Please sign in to comment.