-
-
Save kellishouts/ff388040dab1a06da26c2af83b0f7ee1 to your computer and use it in GitHub Desktop.
Revisions
-
sgnl revised this gist
Mar 26, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ server: "./public" }); gulp.watch("scss/**/*.scss", ['sass']); gulp.watch("public/*.html").on('change', browserSync.reload); }); @@ -58,7 +58,7 @@ <head> <meta charset="UTF-8"> <title>Sass Gulp Workshop</title> <link rel="stylesheet" href="/css/styles.css"> </head> <body> <h1>Hello Syntatically Awesome Style Sheets!</h1> -
sgnl revised this gist
Mar 26, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,6 +51,7 @@ } ``` 8. Add the following code into the `public/index.html` file: ```html <!DOCTYPE html> <html lang="en"> @@ -64,6 +65,7 @@ </body> </html> ``` 9. enter the command: `$ gulp` 10. ??? 11. PROFIT! -
sgnl revised this gist
Mar 26, 2016 . 1 changed file with 9 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ 1. `$ mkdir sass_gulp_workshop` 2. `cd` into the new directory 3. Initialize NPM: `$ npm init --yes` 4. Install gulp and gulp-sass packages: `$ npm install -D gulp gulp-sass browser-sync` 5. Install gulp globally `npm install -g gulp` 5. Recreate this file structure in this directory: - `public` (directory) @@ -23,18 +23,18 @@ gulp.task('serve', ['sass'], function() { browserSync.init({ server: "./public" }); gulp.watch("scss/*.scss", ['sass']); gulp.watch("public/*.html").on('change', browserSync.reload); }); // Compile sass into CSS & auto-inject into browsers gulp.task('sass', function() { return gulp.src("scss/styles.scss") .pipe(sass()) .pipe(gulp.dest("public/css")) .pipe(browserSync.stream()); }); @@ -64,5 +64,6 @@ </body> </html> ``` 9. enter the command: `$ gulp` 10. ??? 11. PROFIT! -
sgnl created this gist
Mar 26, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ # Create a new temp project 1. `$ mkdir sass_gulp_workshop` 2. `cd` into the new directory 3. Initialize NPM: `$ npm init --yes` 4. Install gulp and gulp-sass packages: `$ npm install -D gulp gulp-sass` 5. Install gulp globally `npm install -g gulp` 5. Recreate this file structure in this directory: - `public` (directory) - `css` (directory) - `index.html` (file) - `scss` (directory) - `partials` (directory) - `styles.scss` (file) - `gulpfile.js` (file) 6. Add the following code into the `gulpfile.js` file: ```javascript var gulp = require('gulp'); var browserSync = require('browser-sync').create(); var sass = require('gulp-sass'); // Static Server + watching scss/html files gulp.task('serve', ['sass'], function() { browserSync.init({ server: "./app" }); gulp.watch("app/scss/*.scss", ['sass']); gulp.watch("app/*.html").on('change', browserSync.reload); }); // Compile sass into CSS & auto-inject into browsers gulp.task('sass', function() { return gulp.src("app/scss/*.scss") .pipe(sass()) .pipe(gulp.dest("app/css")) .pipe(browserSync.stream()); }); gulp.task('default', ['serve']); ``` 7. Add the following code into the file located at `scss/styles.scss`: ```css body { background-color: red; h1 { color: purple; } } ``` 8. Add the following code into the `public/index.html` file: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Sass Gulp Workshop</title> <link rel="stylesheet" href="/css/styles.scss"> </head> <body> <h1>Hello Syntatically Awesome Style Sheets!</h1> </body> </html> ``` 9. enter the command: `$ gulp sass:watch` 10.