Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash tryouts #336

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ exports[`babel css prop basic object 1`] = `
exports[`babel css prop basic with extractStatic 1`] = `
"import { css as _css } from \\"emotion\\";
import \\"./css-prop.test.emotion.css\\";
<div className={\\"css-jf1v9l\\" + \\" a\\"}></div>;"
<div className={\\"css-jk1t8f\\" + \\" a\\"}></div>;"
`;

exports[`babel css prop basic with extractStatic 2`] = `".css-jf1v9l{color:brown;}"`;
exports[`babel css prop basic with extractStatic 2`] = `".css-jk1t8f{color:brown;}"`;

exports[`babel css prop className as expression 1`] = `
"import { merge as _merge } from \\"emotion\\";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ exports[`babel css extract basic object support 1`] = `"/*#__PURE__*/css({ displ
exports[`babel css extract css basic 1`] = `
"import \\"./css.test.emotion.css\\";

\\"css-153l48f\\";"
\\"css-gj2524\\";"
`;

exports[`babel css extract css basic 2`] = `".css-153l48f{margin:12px 48px;color:#ffffff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;color:blue;}"`;
exports[`babel css extract css basic 2`] = `".css-gj2524{margin:12px 48px;color:#ffffff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;color:blue;}"`;

exports[`babel css extract dynamic property objects 1`] = `
"
Expand Down
10 changes: 5 additions & 5 deletions packages/babel-plugin-emotion/test/__snapshots__/fs.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`babel plugin fs creates and writes to the css file when it does not exist 1`] = `".css-1yfv4zm{margin:12px 48px;color:#ffffff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;color:blue;name:class;}"`;
exports[`babel plugin fs creates and writes to the css file when it does not exist 1`] = `".css-qol3we{margin:12px 48px;color:#ffffff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;color:blue;name:class;}"`;

exports[`babel plugin fs creates and writes to the css file when it does not exist 2`] = `
"import \\"./fs.test.emotion.css\\";

\\"css-1yfv4zm\\";"
\\"css-qol3we\\";"
`;

exports[`babel plugin fs does not write to the css file when it is the same as is already written 1`] = `
"import \\"./fs.test.emotion.css\\";

\\"css-1yfv4zm\\";"
\\"css-qol3we\\";"
`;

exports[`babel plugin fs writes to the css file when it does exist 1`] = `".css-1yfv4zm{margin:12px 48px;color:#ffffff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;color:blue;name:class;}"`;
exports[`babel plugin fs writes to the css file when it does exist 1`] = `".css-qol3we{margin:12px 48px;color:#ffffff;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;color:blue;name:class;}"`;

exports[`babel plugin fs writes to the css file when it does exist 2`] = `
"import \\"./fs.test.emotion.css\\";

\\"css-1yfv4zm\\";"
\\"css-qol3we\\";"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
exports[`babel keyframes extract keyframes basic 1`] = `
"import \\"./keyframes.test.emotion.css\\";

const rotate360 = \\"css-rotate360-f35ahc\\";"
const rotate360 = \\"css-rotate360-g7mydp\\";"
`;

exports[`babel keyframes extract keyframes basic 2`] = `"@-webkit-keyframes css-rotate360-f35ahc{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes css-rotate360-f35ahc{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}"`;
exports[`babel keyframes extract keyframes basic 2`] = `"@-webkit-keyframes css-rotate360-g7mydp{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes css-rotate360-g7mydp{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}"`;

exports[`babel keyframes extract keyframes with interpolation 1`] = `
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
exports[`babel styled component extract basic 1`] = `
"import \\"./styled.test.emotion.css\\";
const H1 = styled(\\"h1\\", {
e: \\"css-10x82eg\\"
e: \\"css-1cab7uf\\"
})();"
`;

exports[`babel styled component extract basic 2`] = `".css-10x82eg{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:var(--css-hash-0);}.css-10x82eg:hover{background-color:green;}@media (max-width:500px){.css-10x82eg{height:var(--css-hash-1);position:fixed;}}@media print{.css-10x82eg{display:none;}}.css-10x82eg::before{color:blue;width:20px;height:20px;content:'pseudo';}"`;
exports[`babel styled component extract basic 2`] = `".css-1cab7uf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:var(--css-hash-0);}.css-1cab7uf:hover{background-color:green;}@media (max-width:500px){.css-1cab7uf{height:var(--css-hash-1);position:fixed;}}@media print{.css-1cab7uf{display:none;}}.css-1cab7uf::before{color:blue;width:20px;height:20px;content:'pseudo';}"`;

exports[`babel styled component extract no use 1`] = `
"import \\"./styled.test.emotion.css\\";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ exports[`css flushes correctly 1`] = `

exports[`css flushes correctly 2`] = `
<div
className="css-k008qs"
className="css-78u8jt"
/>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

exports[`keyframes - macro keyframes with interpolation 1`] = `
.glamor-0 {
-webkit-animation: animation-1q8eu9e 2s linear infinite;
animation: animation-1q8eu9e 2s linear infinite;
-webkit-animation: animation-qyaey5 2s linear infinite;
animation: animation-qyaey5 2s linear infinite;
}

<h1
Expand All @@ -14,7 +14,7 @@ exports[`keyframes - macro keyframes with interpolation 1`] = `
`;

exports[`keyframes - macro keyframes with interpolation 2`] = `
"@-webkit-keyframes animation-1q8eu9e {
"@-webkit-keyframes animation-qyaey5 {
from {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
Expand All @@ -28,7 +28,7 @@ exports[`keyframes - macro keyframes with interpolation 2`] = `
}
}

@keyframes animation-1q8eu9e {
@keyframes animation-qyaey5 {
from {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
Expand All @@ -42,16 +42,16 @@ exports[`keyframes - macro keyframes with interpolation 2`] = `
}
}

.css-l8b5qg {
-webkit-animation: animation-1q8eu9e 2s linear infinite;
animation: animation-1q8eu9e 2s linear infinite;
.css-mxg6dn {
-webkit-animation: animation-qyaey5 2s linear infinite;
animation: animation-qyaey5 2s linear infinite;
}"
`;

exports[`keyframes - macro renders 1`] = `
.glamor-0 {
-webkit-animation: animation-16qlhaj 2s linear infinite;
animation: animation-16qlhaj 2s linear infinite;
-webkit-animation: animation-qx4yjh 2s linear infinite;
animation: animation-qx4yjh 2s linear infinite;
}

<h1
Expand All @@ -62,7 +62,7 @@ exports[`keyframes - macro renders 1`] = `
`;

exports[`keyframes - macro renders 2`] = `
"@-webkit-keyframes animation-16qlhaj {
"@-webkit-keyframes animation-qx4yjh {
from, 20%, 53%, 80%, to {
-webkit-animation-timing-function: cubic-bezier(0.215,0.610,0.355,1.000);
animation-timing-function: cubic-bezier(0.215,0.610,0.355,1.000);
Expand Down Expand Up @@ -94,7 +94,7 @@ exports[`keyframes - macro renders 2`] = `
}
}

@keyframes animation-16qlhaj {
@keyframes animation-qx4yjh {
from, 20%, 53%, 80%, to {
-webkit-animation-timing-function: cubic-bezier(0.215,0.610,0.355,1.000);
animation-timing-function: cubic-bezier(0.215,0.610,0.355,1.000);
Expand Down Expand Up @@ -126,8 +126,8 @@ exports[`keyframes - macro renders 2`] = `
}
}

.css-1qpx6jr {
-webkit-animation: animation-16qlhaj 2s linear infinite;
animation: animation-16qlhaj 2s linear infinite;
.css-1wtfl3h {
-webkit-animation: animation-qx4yjh 2s linear infinite;
animation: animation-qx4yjh 2s linear infinite;
}"
`;
Loading