Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews authored Feb 2, 2018
1 parent 1db796d commit 966bd12
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions packages/gatsby-plugin-less/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,41 @@ Adds the ability to load and parse Less-flavored CSS.
Add the plugin to your `gatsby-config.js`.

```javascript
plugins: [`gatsby-plugin-less`];
module.exports = {
plugins: [`gatsby-plugin-less`]
}
```

By default this plugin will compile `*.less` and `*.module.less` files. The plugin can also be used with `modifyVars` as it is explained [here](http://lesscss.org/usage/). By defining a javascript object you can overwrite less-variables. This can be useful when using a component library like [antd](https://ant.design/docs/react/introduce).

```javascript
plugins: [
{
resolve: `gatsby-plugin-less`,
options: {
theme: {
"text-color": `#fff`,
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-less`,
options: {
theme: {
"text-color": `#fff`,
},
},
},
},
];
]
};
```

Or you can specify a file which exports a object in the same form.

```javascript
plugins: [
{
resolve: `gatsby-plugin-less`,
options: {
theme: `./src/theme.js`,
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-less`,
options: {
theme: `./src/theme.js`,
},
},
},
];
]
};
```

In file `./src/theme.js`:
Expand Down

0 comments on commit 966bd12

Please sign in to comment.