Skip to content

Commit bedbe68

Browse files
authored
Remove stylis-plugin-emotion and use stylis-rule-sheet (#406)
* Switch to stylis-rule-sheet * Remove stylis-plugin-emotion from travis cache * Update rollup config * Fix peer dep warning
1 parent f5d3e1f commit bedbe68

File tree

14 files changed

+603
-747
lines changed

14 files changed

+603
-747
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ cache:
2929
- packages/benchmarks/node_modules
3030
- packages/emotion-server/node_modules
3131
- packages/emotion/node_modules
32-
- packages/stylis-plugin-emotion/node_modules

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@
138138
"^emotion-utils$": "<rootDir>/packages/emotion-utils/src",
139139
"^emotion-server$": "<rootDir>/packages/emotion-server/src",
140140
"^emotion-theming$": "<rootDir>/packages/emotion-theming/src",
141-
"^babel-plugin-emotion": "<rootDir>/packages/babel-plugin-emotion/src",
142-
"^stylis-plugin-emotion": "<rootDir>/packages/stylis-plugin-emotion/src"
141+
"^babel-plugin-emotion": "<rootDir>/packages/babel-plugin-emotion/src"
143142
},
144143
"setupTestFrameworkScriptFile": "<rootDir>/test/testSetup.js",
145144
"coveragePathIgnorePatterns": [

packages/babel-plugin-emotion/test/macro/__snapshots__/react.test.js.snap

+101-44
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`styled basic render 1`] = `
4-
.glamor-1 {
4+
.glamor-0 {
55
color: blue;
66
font-size: 20px;
77
}
88
9-
@media (min-width: 420px) {
10-
.glamor-1 {
9+
@media (min-width:420px) {
10+
.glamor-0 {
1111
color: blue;
1212
}
1313
}
1414
15-
@media (min-width: 420px) and (min-width: 520px) {
16-
.glamor-1 {
17-
color: green;
18-
}
19-
}
20-
2115
<h1
22-
className="glamor-0 glamor-1"
16+
className="glamor-0"
2317
>
2418
hello world
2519
</h1>
@@ -204,6 +198,39 @@ exports[`styled composition based on props 2`] = `
204198
</h1>
205199
`;
206200

201+
exports[`styled composition of nested pseudo selectors 1`] = `
202+
.glamor-0 {
203+
font-size: 2rem;
204+
padding: 16px;
205+
}
206+
207+
.glamor-0:hover {
208+
color: blue;
209+
}
210+
211+
.glamor-0:hover:active {
212+
color: red;
213+
}
214+
215+
.glamor-0:hover {
216+
color: pink;
217+
}
218+
219+
.glamor-0:hover:active {
220+
color: purple;
221+
}
222+
223+
.glamor-0:hover.some-class {
224+
color: yellow;
225+
}
226+
227+
<button
228+
className="glamor-0"
229+
>
230+
Should be purple
231+
</button>
232+
`;
233+
207234
exports[`styled composition with objects 1`] = `
208235
.glamor-0 {
209236
color: #333;
@@ -239,6 +266,18 @@ exports[`styled function in expression 1`] = `
239266
</h1>
240267
`;
241268

269+
exports[`styled function that function returns gets called with props 1`] = `
270+
.glamor-0 {
271+
color: hotpink;
272+
background-color: yellow;
273+
}
274+
275+
<div
276+
className="glamor-0"
277+
color="hotpink"
278+
/>
279+
`;
280+
242281
exports[`styled glamorous style api & composition 1`] = `
243282
.glamor-0 {
244283
font-size: 20px;
@@ -321,49 +360,69 @@ exports[`styled innerRef 1`] = `
321360
`;
322361

323362
exports[`styled input placeholder 1`] = `
324-
.glamor-1::-webkit-input-placeholder {
363+
.glamor-0::-webkit-input-placeholder {
364+
background-color: green;
365+
}
366+
367+
.glamor-0::-moz-placeholder {
325368
background-color: green;
326369
}
327370
328-
.glamor-1:-ms-input-placeholder {
371+
.glamor-0:-ms-input-placeholder {
329372
background-color: green;
330373
}
331374
332-
.glamor-1::placeholder {
375+
.glamor-0::placeholder {
333376
background-color: green;
334377
}
335378
336379
<input
337-
className="glamor-0 glamor-1"
380+
className="glamor-0"
338381
>
339382
hello world
340383
</input>
341384
`;
342385

343386
exports[`styled input placeholder object 1`] = `
344-
.glamor-1::-webkit-input-placeholder {
387+
.glamor-0::-webkit-input-placeholder {
345388
background-color: green;
346389
}
347390
348-
.glamor-1::-moz-placeholder {
391+
.glamor-0::-moz-placeholder {
349392
background-color: green;
350393
}
351394
352-
.glamor-1:-ms-input-placeholder {
395+
.glamor-0:-ms-input-placeholder {
353396
background-color: green;
354397
}
355398
356-
.glamor-1::placeholder {
399+
.glamor-0::placeholder {
357400
background-color: green;
358401
}
359402
360403
<input
361-
className="glamor-0 glamor-1"
404+
className="glamor-0"
362405
>
363406
hello world
364407
</input>
365408
`;
366409

410+
exports[`styled name with class component 1`] = `
411+
.glamor-0 {
412+
color: hotpink;
413+
}
414+
415+
<Styled(SomeComponent)>
416+
<SomeComponent
417+
className="glamor-0"
418+
>
419+
<div
420+
className="glamor-0"
421+
/>
422+
</SomeComponent>
423+
</Styled(SomeComponent)>
424+
`;
425+
367426
exports[`styled nested 1`] = `
368427
.glamor-0 {
369428
font-size: 20px;
@@ -431,31 +490,6 @@ exports[`styled no prop filtering on non string tags 1`] = `
431490
</a>
432491
`;
433492

434-
exports[`styled null interpolation value 1`] = `
435-
.glamor-0 {
436-
color: blue;
437-
font-size: 20;
438-
}
439-
440-
@media (min-width:520px) {
441-
.glamor-0 {
442-
color: green;
443-
}
444-
}
445-
446-
@media (min-width:420px) {
447-
.glamor-0 {
448-
color: blue;
449-
}
450-
}
451-
452-
<h1
453-
className="glamor-0"
454-
>
455-
hello world
456-
</h1>
457-
`;
458-
459493
exports[`styled object as style 1`] = `
460494
.glamor-0 {
461495
font-size: 20px;
@@ -619,6 +653,28 @@ exports[`styled random object expression 1`] = `
619653
</h1>
620654
`;
621655

656+
exports[`styled theme prop exists without ThemeProvider 1`] = `
657+
.glamor-0 {
658+
color: green;
659+
background-color: yellow;
660+
}
661+
662+
<div
663+
className="glamor-0"
664+
/>
665+
`;
666+
667+
exports[`styled theme prop exists without ThemeProvider with a theme prop on the component 1`] = `
668+
.glamor-0 {
669+
color: hotpink;
670+
background-color: yellow;
671+
}
672+
673+
<div
674+
className="glamor-0"
675+
/>
676+
`;
677+
622678
exports[`styled themes 1`] = `
623679
.glamor-0 {
624680
background-color: #ffd43b;
@@ -721,6 +777,7 @@ exports[`styled with higher order component that hoists statics 1`] = `
721777
display: -ms-flexbox;
722778
display: flex;
723779
color: hotpink;
780+
padding: 8px;
724781
}
725782
726783
<div

0 commit comments

Comments
 (0)