Skip to content

Commit 634e9c2

Browse files
piehm-allanson
authored andcommitted
[v2] re-add tests for sass and less plugins + update using-sass example (#5223)
* update "using-sass" example * [gatsby-plugin-sass] add tests * [gatsby-plugin-less] update tests and README * commit missing file * add missing snapshot
1 parent 5c6363a commit 634e9c2

File tree

13 files changed

+1561
-196
lines changed

13 files changed

+1561
-196
lines changed

examples/using-sass/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
"author": "Daniel Farrell <[email protected]>",
1111
"license": "MIT",
1212
"dependencies": {
13-
"gatsby": "canary",
14-
"gatsby-plugin-google-analytics": "latest",
15-
"gatsby-plugin-offline": "latest",
16-
"gatsby-plugin-sass": "canary",
17-
"react": "^16.2.0",
18-
"react-dom": "^16.2.0",
13+
"gatsby": "next",
14+
"gatsby-plugin-google-analytics": "next",
15+
"gatsby-plugin-offline": "next",
16+
"gatsby-plugin-sass": "next",
17+
"react": "^16.3.0",
18+
"react-dom": "^16.3.0",
1919
"tachyons-sass": "^4.7.1"
2020
}
2121
}

examples/using-sass/src/layouts/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from "prop-types"
33

44
import "../styles/main.scss"
55

6-
const Layout = ({ children }) => <div>{children()}</div>
6+
const Layout = ({ children }) => <div>{children}</div>
77

88
Layout.propTypes = {
99
children: PropTypes.any,

examples/using-sass/src/pages/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
import React from "react"
22

3+
import Layout from "../layouts/index"
4+
35
class Index extends React.Component {
46
render() {
57
return (
6-
<div>
8+
<Layout>
79
<h1 className="tu">Hi sassy friends</h1>
810
<div className="sass-nav-example">
911
<h2>Nav example</h2>
1012
<ul className="pa0 ma0 list">
1113
<li>
14+
{/* eslint-disable-next-line */}
1215
<a href="#">Store</a>
1316
</li>
1417
<li>
18+
{/* eslint-disable-next-line */}
1519
<a href="#">Help</a>
1620
</li>
1721
<li>
22+
{/* eslint-disable-next-line */}
1823
<a href="#">Logout</a>
1924
</li>
2025
<li>
@@ -24,7 +29,7 @@ class Index extends React.Component {
2429
</li>
2530
</ul>
2631
</div>
27-
</div>
32+
</Layout>
2833
)
2934
}
3035
}

packages/gatsby-plugin-less/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,41 @@ plugins: [
5454
},
5555
]
5656
```
57+
58+
## Breaking changes history
59+
60+
<!-- Please keep the breaking changes list ordered with the newest change at the top -->
61+
62+
### v2.0.0
63+
64+
`theme` option has been removed. You can pass configuration object to less-loader:
65+
66+
```diff
67+
plugins: [
68+
{
69+
resolve: `gatsby-plugin-less`,
70+
options: {
71+
- theme: {
72+
- "text-color": `#fff`,
73+
- }
74+
+ modifyVars: {
75+
+ "text-color": `#fff`,
76+
+ }
77+
},
78+
},
79+
]
80+
```
81+
82+
```diff
83+
plugins: [
84+
{
85+
resolve: `gatsby-plugin-less`,
86+
options: {
87+
- theme: `./src/theme.js`,
88+
+ modifyVars: require(`./src/theme.js`),
89+
},
90+
},
91+
]
92+
```
93+
94+

0 commit comments

Comments
 (0)