Skip to content

Commit b47bc5e

Browse files
committed
Add support for vue-emotion
1 parent 0b4beda commit b47bc5e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

extract.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ const supports = {
4343
// import styled from "react-emotion";
4444
'react-emotion': true,
4545

46+
// import styled from 'vue-emotion';
47+
// Also see:
48+
// - https://github.com/stylelint/stylelint/issues/4247
49+
// - https://github.com/gucong3000/postcss-jsx/issues/63
50+
// - https://github.com/stylelint/postcss-css-in-js/issues/22
51+
'vue-emotion': true,
52+
4653
// import styled from 'preact-emotion'
4754
'preact-emotion': true,
4855

test/emotion.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,35 @@ describe('javascript tests', () => {
6767
});
6868
});
6969
});
70+
71+
it('works with vue-emotion', () => {
72+
// Related issues:
73+
// - https://github.com/stylelint/stylelint/issues/4247
74+
// - https://github.com/gucong3000/postcss-jsx/issues/63
75+
// - https://github.com/stylelint/postcss-css-in-js/issues/22
76+
const parsed = syntax.parse(`
77+
import styled from 'vue-emotion';
78+
79+
const Wrapper = styled('div')\`
80+
left: 0;
81+
top: 0;
82+
width: 100%;
83+
height: 100%;
84+
\`;
85+
`);
86+
87+
expect(parsed.nodes).toHaveLength(1);
88+
});
89+
90+
it('works with @emotion/styled', () => {
91+
const parsed = syntax.parse(`
92+
import styled from '@emotion/styled';
93+
94+
const Wrapper = styled.div\`
95+
left: 0;
96+
\`;
97+
`);
98+
99+
expect(parsed.nodes).toHaveLength(1);
100+
});
70101
});

0 commit comments

Comments
 (0)