Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 6b65a31

Browse files
committed
Added documentation for imports and partials
1 parent ad12387 commit 6b65a31

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SASS plugin for [gulp](https://github.com/wearefractal/gulp).
99
npm install gulp-sass
1010
```
1111

12-
#Usage
12+
#Basic Usage
1313

1414
Something like this:
1515

@@ -26,3 +26,42 @@ gulp.task('sass', function () {
2626

2727
Options passed as a hash into ```sass()``` will be passed along to [```node-sass```](https://github.com/andrew/node-sass)
2828

29+
#Imports and Partials
30+
31+
If you want to use imports or partials templates, you'll need to pass the ```includePaths``` option along to node-sass. So if you have files like this:
32+
33+
scss/includes/_settings.scss:
34+
35+
```sass
36+
$blue: #3bbfce;
37+
$margin: 16px;
38+
```
39+
40+
scss/style.scss:
41+
42+
```sass
43+
@import "settings";
44+
45+
.content-navigation {
46+
border-color: $blue;
47+
color:
48+
darken($blue, 9%);
49+
}
50+
51+
.border {
52+
padding: $margin / 2;
53+
margin: $margin / 2;
54+
border-color: $blue;
55+
}
56+
```
57+
58+
Your code should look something like this:
59+
60+
```javascript
61+
gulp.task('sass', function () {
62+
gulp.src('./scss/*.scss')
63+
.pipe(sass({includePaths: ['scss/includes']}))
64+
.pipe(gulp.dest('./css'));
65+
});
66+
```
67+

0 commit comments

Comments
 (0)