Created
October 19, 2017 16:13
-
-
Save shisama/7c714add73a7ddaaa802a84072468a98 to your computer and use it in GitHub Desktop.
compile sasst to css with gulp and autoprefixer
This file contains 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 characters
const gulp = require("gulp"); | |
const sass = require("gulp-sass"); | |
const autoprefixer = require("gulp-autoprefixer"); | |
const plumber = require("gulp-plumber"); | |
const path = require("path"); | |
gulp.task("build-css", function() { | |
gulp.src(path.join(__dirname, "src", "css", "*.sass")) | |
.pipe(plumber()) | |
.pipe(sass()) | |
.pipe(autoprefixer({browsers: [">= 0.1%"]})) | |
.pipe(gulp.dest(path.join(__dirname, "public", "css"))); | |
}); |
This file contains 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 characters
{ | |
"name": "sass-autoprefixer-sample", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build-css": "rm -rf public && gulp build-css" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"gulp": "^3.9.1", | |
"gulp-autoprefixer": "^4.0.0", | |
"gulp-plumber": "^1.1.0", | |
"gulp-sass": "^3.1.0" | |
} | |
} |
This file contains 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 characters
.sample { | |
color: #00008B; | |
font-size: large; | |
display: -webkit-box; | |
display: -ms-flexbox; | |
display: flex; | |
background-image: -webkit-linear-gradient(left, red, orange, yellow, green, blue, indigo, violet); | |
background-image: linear-gradient(left, red, orange, yellow, green, blue, indigo, violet); | |
-webkit-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; } |
This file contains 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 characters
@charset "UTF-8" | |
$darkblue: #00008B | |
.sample | |
color: $darkblue | |
font-size: large | |
display: flex | |
background-image: linear-gradient(left, red, orange, yellow, green, blue, indigo, violet) | |
user-select: none |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment