Skip to content

Commit

Permalink
feat(gatsby-plugin-sass): Support Dart SASS (#10159)
Browse files Browse the repository at this point in the history
* feat: support dart sass

* fix: handle module not found error

* chore: update dart-sass

* chore: revert peerDependencies
  • Loading branch information
sibiraj-s authored and pieh committed Dec 6, 2018
1 parent 747943c commit a48843e
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions packages/gatsby-plugin-sass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,33 @@ Provides drop-in support for SASS/SCSS stylesheets

## How to use

1. Include the plugin in your `gatsby-config.js` file.
2. Write your stylesheets in SASS/SCSS and require or import them as normal.
1. Include the plugin in your `gatsby-config.js` file.
2. Write your stylesheets in SASS/SCSS and require or import them as normal.

```javascript
// in gatsby-config.js
plugins: [`gatsby-plugin-sass`]
```

If you need to pass options to Sass use the plugins options, see [node-sass](https://github.com/sass/node-sass)
By Default `node-sass` is used. To use `dart-sass`.

```bash
npm i -D sass
```

```javascript
// in gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-sass`,
options: {
implementation: require("sass"),
},
},
]
```

If you need to pass options to Sass use the plugins options, see [node-sass](https://github.com/sass/node-sass)/[dart-sass](https://github.com/sass/dart-sass) docs
for all available options.

```javascript
Expand All @@ -26,6 +44,7 @@ plugins: [
resolve: `gatsby-plugin-sass`,
options: {
includePaths: ["absolute/path/a", "absolute/path/b"],
...
},
},
]
Expand Down

0 comments on commit a48843e

Please sign in to comment.