Skip to content

Commit

Permalink
Add support for grid-specific builds
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed Jun 15, 2015
1 parent 9dd6177 commit 57fa9c7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
24 changes: 23 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,28 @@ gulp.task('styles', ['styletemplates'], function () {
.pipe($.size({title: 'styles'}));
});


// Only generate CSS styles for the MDL grid
gulp.task('styles-grid', function () {
return gulp.src(['src/material-design-lite-grid.scss'])
.pipe($.sass({
precision: 10,
onError: console.error.bind(console, 'Sass error:')
}))
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
.pipe(gulp.dest('.tmp'))
// Concatenate Styles
.pipe($.concat('material-grid.css'))
.pipe($.header(banner, {pkg: pkg}))
.pipe(gulp.dest('./dist'))
// Minify Styles
.pipe($.if('*.css', $.csso()))
.pipe($.concat('material-grid.min.css'))
.pipe($.header(banner, {pkg: pkg}))
.pipe(gulp.dest('./dist'))
.pipe($.size({title: 'styles-grid'}));
});

// Concatenate And Minify JavaScript
gulp.task('scripts', function () {
var sources = [
Expand Down Expand Up @@ -210,7 +232,7 @@ gulp.task('default', ['clean', 'mocha'], function (cb) {
runSequence(
'styles',
['jshint', 'jscs', 'scripts', 'styles', 'assets', 'pages', 'demos', 'templates',
'images'],
'images', 'styles-grid'],
cb);
});

Expand Down
21 changes: 21 additions & 0 deletions src/material-design-lite-grid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* Material Design Lite Grid*/

@import "variables";
@import "mixins";
@import "grid/grid";

0 comments on commit 57fa9c7

Please sign in to comment.