Skip to content

Commit 1eee14b

Browse files
committed
Upgrade to stylis 3.2 and use constructor
This prevents bugs with shared options and middleware when different babel plugins use stylis.
1 parent b12bec2 commit 1eee14b

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
"displayName"
3434
],
3535
"dependencies": {
36-
"stylis": "^3.0.19"
36+
"stylis": "^3.2.1"
3737
}
3838
}

src/css/preprocessUtils.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as t from 'babel-types'
2-
import stylis from 'stylis'
2+
import Stylis from 'stylis'
33

44
import {
55
makePlaceholder,
@@ -10,11 +10,7 @@ import {
1010
fixGlobalPlaceholders,
1111
} from './placeholderUtils'
1212

13-
// Reset stylis middleware
14-
stylis.use(null)
15-
16-
// Set stylis options (matching SC options)
17-
stylis.set({
13+
const stylis = new Stylis({
1814
global: false,
1915
cascade: true,
2016
keyframe: false,

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,9 +2508,9 @@ strip-json-comments@~2.0.1:
25082508
version "2.0.1"
25092509
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
25102510

2511-
stylis@^3.0.19:
2512-
version "3.1.7"
2513-
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.1.7.tgz#aba33dc3495784ecd768aed8b638a429a2ad2069"
2511+
stylis@^3.2.1:
2512+
version "3.2.1"
2513+
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.2.1.tgz#7a88988f8ccb5c238be3cc3cec173735cc594740"
25142514

25152515
supports-color@^2.0.0:
25162516
version "2.0.0"

0 commit comments

Comments
 (0)