Last active
August 29, 2015 14:17
-
-
Save kadmil/cb60c5e78ad75874a2aa to your computer and use it in GitHub Desktop.
PostCSS-only gulp setup
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
"dependencies": { | |
"autoprefixer-core": "^5.1.8", | |
"csswring": "^3.0.2", | |
"gulp": "~3.8.10", | |
"postcss": "^4.0.4", | |
"postcss-custom-properties": "^3.0.1", | |
"postcss-import": "^5.0.2", | |
"postcss-mixins": "^0.1.1", | |
"postcss-nested": "^0.2.1", | |
}, |
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
var gulp = require('gulp'); | |
var postcss = require('gulp-postcss'); | |
gulp.task('css', function() { | |
var processors = [ | |
require("postcss-import")(), | |
require("autoprefixer-core"), | |
require("postcss-custom-properties")(), | |
require("postcss-calc")(), | |
require("postcss-mixins"), | |
require("postcss-nested"), | |
require("csswring").postcss | |
]; | |
return gulp.src(['./src/styles/styles.css']) | |
.pipe(postcss(processors)) | |
.pipe(gulp.dest(paths.dest.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
@define-mixin nomargin { | |
margin: calc(100000 * 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
:root{ | |
--main-color: #00AEFF | |
} | |
@import "/mixin.css" | |
*, *:before, *:after { | |
box-sizing: border-box; | |
} | |
body { | |
@mixin nomargin; | |
} | |
.model { | |
display: flex; | |
flex-direction: column; | |
@mixin nomargin; | |
color: var(--main-color); | |
font-family: 'Noto Serif', serif; | |
header { | |
display: flex; | |
justify-content: space-around; | |
h3 { | |
flex:1; | |
} | |
} | |
} |
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
body { | |
margin: 0 | |
} | |
.model { | |
display: -webkit-box; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
-webkit-box-orient: vertical; | |
-webkit-box-direction: normal; | |
-webkit-flex-direction: column; | |
-ms-flex-direction: column; | |
flex-direction: column; | |
margin: 0; | |
color: #00aeff | |
} | |
.model header { | |
display: -webkit-box; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
-webkit-justify-content: space-around; | |
-ms-flex-pack: distribute; | |
justify-content: space-around | |
} | |
.model header h3 { | |
-webkit-box-flex: 1; | |
-webkit-flex: 1; | |
-ms-flex: 1; | |
flex: 1 | |
} |
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
body{margin:0}.model{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin:0;color:#00aeff;font-family:Noto Serif,serif}.model header{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.model header h3{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment