Skip to content

Instantly share code, notes, and snippets.

@KatieMFritz
Last active October 3, 2019 13:48
Show Gist options
  • Select an option

  • Save KatieMFritz/38dda99e71bb7cef7afa2ff57f63f2f4 to your computer and use it in GitHub Desktop.

Select an option

Save KatieMFritz/38dda99e71bb7cef7afa2ff57f63f2f4 to your computer and use it in GitHub Desktop.

Revisions

  1. KatieMFritz revised this gist May 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 0_Sassy_Pattern_Lab.md
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,4 @@ Once everything is updated, test with `gulp patternlab:build`.
    For `bootstrap-sass`:
    ```scss
    @import '../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss';
    ``
    ```
  2. KatieMFritz revised this gist May 10, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion 0_Sassy_Pattern_Lab.md
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,9 @@ Then update `gulpfile.js`, then `patternlab-config.json`.

    If you're renaming your default stylesheet, update it in `source/_meta/_00-head.mustache`.

    Once everything is updated, test with `gulp patternlab:build`.
    Once everything is updated, test with `gulp patternlab:build`.

    For `bootstrap-sass`:
    ```scss
    @import '../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss';
    ``
  3. KatieMFritz renamed this gist May 10, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. KatieMFritz renamed this gist May 10, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. KatieMFritz revised this gist May 9, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,6 @@ Then update `package.json` and run `npm install` in the command line.

    Then update `gulpfile.js`, then `patternlab-config.json`.

    If you're renaming your default stylesheet, update it in `source/_meta/_00-head.mustache`.

    Once everything is updated, test with `gulp patternlab:build`.
  6. KatieMFritz revised this gist May 9, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,6 @@ First [install patternlab/edition-node-gulp](https://github.com/pattern-lab/edit

    Then update `package.json` and run `npm install` in the command line.

    Then update `gulpfile.json`.
    Then update `gulpfile.js`, then `patternlab-config.json`.

    Once everything is updated, test with `gulp patternlab:build`.
  7. KatieMFritz revised this gist May 9, 2017. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions patternlab-config.json
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,5 @@
    /**
    Update paths > source to add
    **/
    /* Update paths > source to add */

    "scss" : "./source/css/scss"

    /** or whatever your scss path will be */
    /* or whatever your scss path will be */
  8. KatieMFritz revised this gist May 9, 2017. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions patternlab-config.json
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    /***
    "paths" : {
    "source" : {
    ...
    ***/
    "scss" : "./source/css/scss"
    /**
    Update paths > source to add
    **/

    "scss" : "./source/css/scss"

    /** or whatever your scss path will be */
  9. KatieMFritz revised this gist May 9, 2017. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions patternlab-config.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    /***
    "paths" : {
    "source" : {
    ...
    ***/
    "scss" : "./source/css/scss"
  10. KatieMFritz revised this gist May 9, 2017. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -22,17 +22,6 @@ gulp.task('pl-sass', function(){



    ADD TO BEGINNING OF WATCHERS RIGHT AFTER `const watchers = [`

    {
    name: 'Sass',
    paths: [normalizePath(paths().source.scss, '**', '*.scss')],
    config: { awaitWriteFinish: true },
    tasks: gulp.series('pl-sass', reloadCSS)
    },



    UPDATE `GULP.TASK('PL-ASSETS')` TO BE THIS

    gulp.task('pl-assets', gulp.series(
    @@ -43,4 +32,15 @@ gulp.task('pl-assets', gulp.series(
    gulp.series('pl-sass', 'pl-copy:css', function(done){done();}),
    'pl-copy:styleguide',
    'pl-copy:styleguide-css'
    ));
    ));



    ADD TO BEGINNING OF WATCHERS RIGHT AFTER `const watchers = [`

    {
    name: 'Sass',
    paths: [normalizePath(paths().source.scss, '**', '*.scss')],
    config: { awaitWriteFinish: true },
    tasks: gulp.series('pl-sass', reloadCSS)
    },
  11. KatieMFritz revised this gist May 9, 2017. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -22,15 +22,15 @@ gulp.task('pl-sass', function(){



    ADD TO BEGINNING OF WATCHERS

    {
    name: 'Sass',
    paths: [normalizePath(paths().source.scss, '**', '*.scss')],
    config: { awaitWriteFinish: true },
    tasks: gulp.series('pl-sass', reloadCSS)
    },
    ADD TO BEGINNING OF WATCHERS RIGHT AFTER `const watchers = [`

    {
    name: 'Sass',
    paths: [normalizePath(paths().source.scss, '**', '*.scss')],
    config: { awaitWriteFinish: true },
    tasks: gulp.series('pl-sass', reloadCSS)
    },



    UPDATE `GULP.TASK('PL-ASSETS')` TO BE THIS
  12. KatieMFritz revised this gist May 9, 2017. 2 changed files with 11 additions and 11 deletions.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,5 @@
    First [install patternlab/edition-node-gulp](https://github.com/pattern-lab/edition-node-gulp#use-npm).
    First [install patternlab/edition-node-gulp](https://github.com/pattern-lab/edition-node-gulp#use-npm).

    Then update `package.json` and run `npm install` in the command line.

    Then update `gulpfile.json`.
    16 changes: 6 additions & 10 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,12 @@
    BEGINNING


    //Add Sass support
    var sass = require('gulp-sass');
    sourcemaps = require('gulp-sourcemaps');


    /**
    AFTER PL-COPY:FONT AND BEFORE PL-COPY:CSS
    **/

    AFTER PL-COPY:FONT AND BEFORE PL-COPY:CSS

    // SASS Compilation
    // http://www.brianmuenzenmeyer.com/adding-common-gulp-tasks-to-pattern-lab-node
    @@ -24,20 +22,18 @@ gulp.task('pl-sass', function(){




    /**
    ADD TO BEGINNING OF WATCHERS
    **/

    {
    name: 'Sass',
    paths: [normalizePath(paths().source.scss, '**', '*.scss')],
    config: { awaitWriteFinish: true },
    tasks: gulp.series('pl-sass', reloadCSS)
    },

    /**
    UPDATE GULP.TASK('PL-ASSETS') TO BE THIS
    **/


    UPDATE `GULP.TASK('PL-ASSETS')` TO BE THIS

    gulp.task('pl-assets', gulp.series(
    'pl-copy:js',
  13. KatieMFritz revised this gist May 9, 2017. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1 @@
    Command Line:
    `npm install node-sass`

    Gulp
    First [install patternlab/edition-node-gulp](https://github.com/pattern-lab/edition-node-gulp#use-npm).
  14. KatieMFritz revised this gist May 9, 2017. 1 changed file with 19 additions and 2 deletions.
    21 changes: 19 additions & 2 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,15 @@
    /** Add Sass support **/
    BEGINNING


    //Add Sass support
    var sass = require('gulp-sass');
    sourcemaps = require('gulp-sourcemaps');


    /**
    AFTER PL-COPY:FONT AND BEFORE PL-COPY:CSS
    **/

    // SASS Compilation
    // http://www.brianmuenzenmeyer.com/adding-common-gulp-tasks-to-pattern-lab-node
    // https://www.sitepoint.com/simple-gulpy-workflow-sass/
    @@ -14,14 +22,23 @@ gulp.task('pl-sass', function(){
    .pipe(gulp.dest(path.resolve(paths().source.css)));
    });

    // add to watchers



    /**
    ADD TO BEGINNING OF WATCHERS
    **/
    {
    name: 'Sass',
    paths: [normalizePath(paths().source.scss, '**', '*.scss')],
    config: { awaitWriteFinish: true },
    tasks: gulp.series('pl-sass', reloadCSS)
    },

    /**
    UPDATE GULP.TASK('PL-ASSETS') TO BE THIS
    **/

    gulp.task('pl-assets', gulp.series(
    'pl-copy:js',
    'pl-copy:img',
  15. KatieMFritz revised this gist May 9, 2017. 2 changed files with 4 additions and 0 deletions.
    File renamed without changes.
    4 changes: 4 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    "devDependencies": {
    "gulp-sourcemaps": "^2.6.0",
    "gulp-sass": "^3.1.0"
    }
  16. KatieMFritz revised this gist May 9, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Command Line:
    `npm install node-sass'
    `npm install node-sass`

    Gulp
  17. KatieMFritz created this gist May 9, 2017.
    33 changes: 33 additions & 0 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    /** Add Sass support **/
    var sass = require('gulp-sass');
    sourcemaps = require('gulp-sourcemaps');

    // SASS Compilation
    // http://www.brianmuenzenmeyer.com/adding-common-gulp-tasks-to-pattern-lab-node
    // https://www.sitepoint.com/simple-gulpy-workflow-sass/
    gulp.task('pl-sass', function(){
    return gulp
    .src(path.resolve(paths().source.scss, '**/*.scss'))
    .pipe(sourcemaps.init())
    .pipe(sass().on('error', sass.logError))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest(path.resolve(paths().source.css)));
    });

    // add to watchers
    {
    name: 'Sass',
    paths: [normalizePath(paths().source.scss, '**', '*.scss')],
    config: { awaitWriteFinish: true },
    tasks: gulp.series('pl-sass', reloadCSS)
    },

    gulp.task('pl-assets', gulp.series(
    'pl-copy:js',
    'pl-copy:img',
    'pl-copy:favicon',
    'pl-copy:font',
    gulp.series('pl-sass', 'pl-copy:css', function(done){done();}),
    'pl-copy:styleguide',
    'pl-copy:styleguide-css'
    ));
    4 changes: 4 additions & 0 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    Command Line:
    `npm install node-sass'

    Gulp