You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
Use [Sass](http://sass-lang.com/) with [styled-jsx](https://github.com/vercel/styled-jsx) 💥
5
4
6
-
Use [Sass](http://sass-lang.com/) with [styled-jsx](https://github.com/zeit/styled-jsx) 💥
5
+
This is a fixed/updated version of [styled-jsx-plugin-sass](https://github.com/giuseppeg/styled-jsx-plugin-sass) by [@giuseppeg](https://github.com/giuseppeg), made because that package seems to be outdated. It works with [indented sass](#indented-syntax) and dart sass too.
7
6
8
7
## Usage
9
8
@@ -19,14 +18,18 @@ Install the `node-sass` version you need (it is a peer dependency).
19
18
npm install --save-dev node-sass
20
19
```
21
20
22
-
Next, add `styled-jsx-plugin-sass` to the `styled-jsx`'s `plugins` in your babel configuration:
21
+
Next, add `styled-jsx-plugin-sass-2` to the `styled-jsx`'s `plugins` in your babel configuration (e.g. `.babelrc`):
23
22
24
23
```json
25
24
{
26
-
"plugins": [
25
+
"presets": [
27
26
[
28
-
"styled-jsx/babel",
29
-
{ "plugins": ["styled-jsx-plugin-sass"] }
27
+
"next/babel",
28
+
{
29
+
"styled-jsx": {
30
+
"plugins": ["styled-jsx-plugin-sass-2"]
31
+
}
32
+
}
30
33
]
31
34
]
32
35
}
@@ -38,19 +41,40 @@ Node-sass can be configured using `sassOptions`. This is useful for setting opti
38
41
39
42
```json
40
43
{
41
-
"plugins": [
44
+
"presets": [
42
45
[
43
-
"styled-jsx/babel",
46
+
"next/babel",
44
47
{
45
-
"plugins": [
46
-
["styled-jsx-plugin-sass", {
47
-
"sassOptions": {
48
-
"includePaths": ["./styles"],
49
-
"precision": 2
48
+
"styled-jsx": {
49
+
"plugins": [
50
+
["styled-jsx-plugin-sass-2", {
51
+
"sassOptions": {
52
+
"includePaths": ["./styles"],
53
+
"precision": 2
54
+
}
50
55
}
51
-
}
56
+
]
52
57
]
53
-
]
58
+
}
59
+
}
60
+
]
61
+
]
62
+
}
63
+
```
64
+
65
+
### Indented syntax
66
+
67
+
To use indented sytax, you will need to update your `sassOptions` inside your babel configuration file.
0 commit comments