Initial commit
This commit is contained in:
parent
b6f13ea0ce
commit
a983cb7320
26
index.js
Normal file
26
index.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
var es = require('event-stream')
|
||||||
|
, clone = require('clone')
|
||||||
|
, sass = require('node-sass')
|
||||||
|
, ext = require('gulp-util').replaceExtension
|
||||||
|
;
|
||||||
|
|
||||||
|
module.exports = function (options) {
|
||||||
|
var opts = options ? clone(options) : {};
|
||||||
|
|
||||||
|
function nodeSass (file, cb) {
|
||||||
|
var newFile = clone(file);
|
||||||
|
|
||||||
|
sass.render({
|
||||||
|
data: newFile.contents.toString(),
|
||||||
|
success: function (css) {
|
||||||
|
newFile.path = ext(newFile.path, '.css')
|
||||||
|
newFile.shortened = newFile.shortened && ext(newFile.shortened, '.css');
|
||||||
|
newFile.contents = new Buffer(css);
|
||||||
|
|
||||||
|
cb(null, newFile);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return es.map(nodeSass);
|
||||||
|
}
|
|
@ -17,5 +17,14 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/dlmanning/gulp-sass/issues"
|
"url": "https://github.com/dlmanning/gulp-sass/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"node-sass": "~0.6.4",
|
||||||
|
"event-stream": "~3.0.16",
|
||||||
|
"clone": "~0.1.10",
|
||||||
|
"gulp-util": "0.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"gulp": "~0.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
test/css/inheritance.css
Normal file
10
test/css/inheritance.css
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
.error, .badError {
|
||||||
|
border: 1px red;
|
||||||
|
background: #ffdddd; }
|
||||||
|
|
||||||
|
.error.intrusion {
|
||||||
|
font-size: 1.3em;
|
||||||
|
font-weight: bold; }
|
||||||
|
|
||||||
|
.badError {
|
||||||
|
border-width: 3px; }
|
8
test/css/mixins.css
Normal file
8
test/css/mixins.css
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#data {
|
||||||
|
float: left;
|
||||||
|
margin-left: 10px; }
|
||||||
|
#data th {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold; }
|
||||||
|
#data td, #data th {
|
||||||
|
padding: 2px; }
|
9
test/css/nesting.css
Normal file
9
test/css/nesting.css
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
table.hl {
|
||||||
|
margin: 2em 0; }
|
||||||
|
table.hl td.ln {
|
||||||
|
text-align: right; }
|
||||||
|
|
||||||
|
li {
|
||||||
|
font-family: serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2em; }
|
8
test/css/variables.css
Normal file
8
test/css/variables.css
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
.content-navigation {
|
||||||
|
border-color: #3bbfce;
|
||||||
|
color: #2ca2af; }
|
||||||
|
|
||||||
|
.border {
|
||||||
|
padding: 8px;
|
||||||
|
margin: 8px;
|
||||||
|
border-color: #3bbfce; }
|
13
test/scss/inheritance.scss
Normal file
13
test/scss/inheritance.scss
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
.error {
|
||||||
|
border: 1px #f00;
|
||||||
|
background: #fdd;
|
||||||
|
}
|
||||||
|
.error.intrusion {
|
||||||
|
font-size: 1.3em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badError {
|
||||||
|
@extend .error;
|
||||||
|
border-width: 3px;
|
||||||
|
}
|
17
test/scss/mixins.scss
Normal file
17
test/scss/mixins.scss
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@mixin table-base {
|
||||||
|
th {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
td, th {padding: 2px}
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin left($dist) {
|
||||||
|
float: left;
|
||||||
|
margin-left: $dist;
|
||||||
|
}
|
||||||
|
|
||||||
|
#data {
|
||||||
|
@include left(10px);
|
||||||
|
@include table-base;
|
||||||
|
}
|
14
test/scss/nesting.scss
Normal file
14
test/scss/nesting.scss
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
table.hl {
|
||||||
|
margin: 2em 0;
|
||||||
|
td.ln {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
font: {
|
||||||
|
family: serif;
|
||||||
|
weight: bold;
|
||||||
|
size: 1.2em;
|
||||||
|
}
|
||||||
|
}
|
14
test/scss/variables.scss
Normal file
14
test/scss/variables.scss
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
$blue: #3bbfce;
|
||||||
|
$margin: 16px;
|
||||||
|
|
||||||
|
.content-navigation {
|
||||||
|
border-color: $blue;
|
||||||
|
color:
|
||||||
|
darken($blue, 9%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
padding: $margin / 2;
|
||||||
|
margin: $margin / 2;
|
||||||
|
border-color: $blue;
|
||||||
|
}
|
7
test/test.js
Normal file
7
test/test.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
var gulp = require('gulp')
|
||||||
|
, sass = require('../')
|
||||||
|
;
|
||||||
|
|
||||||
|
gulp.src('./scss/*.scss')
|
||||||
|
.pipe(sass())
|
||||||
|
.pipe(gulp.dest('./css/'));
|
Loading…
Reference in a new issue