Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Update parser to postcss #80

Merged
merged 5 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
193 changes: 82 additions & 111 deletions packages/critters-webpack-plugin/test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,18 @@ exports[`External CSS should match snapshot 1`] = `
<style>:root {
font-size: 10px;
}

html {
height: 100%;
}

body {
padding-left: 11em;
font-family: 'Times New Roman', times, serif;
color: purple;
background-color: #d8da3d;
}

*,
:after,
:before {
box-sizing: inherit;
*,:after,:before{
box-sizing: inherit
}

ul.navbar {
list-style-type: none;
padding: 0;
Expand All @@ -33,35 +27,31 @@ ul.navbar {
left: 1em;
width: 9em;
}

h1 {
font-family: helvetica, arial, sans-serif;
}

ul.navbar li {
background: white;
margin: 0.5em 0;
padding: 0.3em;
border-right: 1em solid black;
}

ul.navbar a {
text-decoration: none;
}

a:link {
color: blue;
}

a:visited {
color: purple;
}

footer {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted;
}</style><link href=\\"main.css\\" rel=\\"preload\\" as=\\"style\\"></head>
}

</style><link href=\\"main.css\\" rel=\\"preload\\" as=\\"style\\"></head>
<body>
<ul class=\\"navbar\\">
<li>
Expand All @@ -80,81 +70,79 @@ footer {
`;

exports[`External CSS should prune external sheet 1`] = `
".extra-style {
"
.extra-style {
font-size: 200%;
}"
}

"
`;

exports[`Inline <style> pruning should remove entire unused stylesheets 1`] = `
"h1 {
color: green;
}"
"
h1 {
color: green;
}
"
`;

exports[`Inline <style> pruning should remove unused rules 1`] = `
"<!DOCTYPE html><html><head>
<title>Basic Demo</title>
<style>body {
padding-left: 11em;
font-family: \\"Times New Roman\\", times, serif;
color: purple;
background-color: #d8da3d;
}

ul.navbar {
list-style-type: none;
padding: 0;
margin: 0;
position: absolute;
top: 2em;
left: 1em;
width: 9em;
}

h1 {
font-family: helvetica, arial, sans-serif;
}

ul.navbar li {
background: white;
margin: 0.5em 0;
padding: 0.3em;
border-right: 1em solid black;
}

ul.navbar a {
text-decoration: none;
}

ul.navbar:not(.hidden) li:hover a {
color: black;
}

ul.navbar:not(:hover) li:hover a {
color: black;
}

ul.navbar li:hover a {
color: red;
}

a:link {
color: blue;
}

a:visited {
color: purple;
}
<style>
body {
padding-left: 11em;
font-family: \\"Times New Roman\\", times, serif;
color: purple;
background-color: #d8da3d;
}
ul.navbar {
list-style-type: none;
padding: 0;
margin: 0;
position: absolute;
top: 2em;
left: 1em;
width: 9em;
}
h1 {
font-family: helvetica, arial, sans-serif;
}
ul.navbar li {
background: white;
margin: 0.5em 0;
padding: 0.3em;
border-right: 1em solid black;
}
ul.navbar a {
text-decoration: none;
}
ul.navbar:not(.hidden) li:hover a {
color: black;
}
ul.navbar:not(:hover) li:hover a {
color: black;
}
ul.navbar li:hover a {
color: red;
}
a:link {
color: blue;
}
a:visited {
color: purple;
}

footer {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted;
}
footer {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted;
}

.clazz\\\\:colon {
color: green;
}</style>
.clazz\\\\:colon {
color: green;
}
</style>
</head>
<body>
<ul class=\\"navbar clazz:colon\\">
Expand All @@ -179,24 +167,18 @@ exports[`options { async:true } should match snapshot 1`] = `
<style>:root {
font-size: 10px;
}

html {
height: 100%;
}

body {
padding-left: 11em;
font-family: 'Times New Roman', times, serif;
color: purple;
background-color: #d8da3d;
}

*,
:after,
:before {
box-sizing: inherit;
*,:after,:before{
box-sizing: inherit
}

ul.navbar {
list-style-type: none;
padding: 0;
Expand All @@ -206,35 +188,31 @@ ul.navbar {
left: 1em;
width: 9em;
}

h1 {
font-family: helvetica, arial, sans-serif;
}

ul.navbar li {
background: white;
margin: 0.5em 0;
padding: 0.3em;
border-right: 1em solid black;
}

ul.navbar a {
text-decoration: none;
}

a:link {
color: blue;
}

a:visited {
color: purple;
}

footer {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted;
}</style><link href=\\"main.css\\" rel=\\"preload\\" as=\\"style\\"></head>
}

</style><link href=\\"main.css\\" rel=\\"preload\\" as=\\"style\\"></head>
<body>
<ul class=\\"navbar\\">
<li>
Expand All @@ -258,24 +236,18 @@ exports[`publicPath should match snapshot 1`] = `
<style>:root {
font-size: 10px;
}

html {
height: 100%;
}

body {
padding-left: 11em;
font-family: 'Times New Roman', times, serif;
color: purple;
background-color: #d8da3d;
}

*,
:after,
:before {
box-sizing: inherit;
*,:after,:before{
box-sizing: inherit
}

ul.navbar {
list-style-type: none;
padding: 0;
Expand All @@ -285,35 +257,31 @@ ul.navbar {
left: 1em;
width: 9em;
}

h1 {
font-family: helvetica, arial, sans-serif;
}

ul.navbar li {
background: white;
margin: 0.5em 0;
padding: 0.3em;
border-right: 1em solid black;
}

ul.navbar a {
text-decoration: none;
}

a:link {
color: blue;
}

a:visited {
color: purple;
}

footer {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted;
}</style><link href=\\"/_public/main.css\\" rel=\\"preload\\" as=\\"style\\"></head>
}

</style><link href=\\"/_public/main.css\\" rel=\\"preload\\" as=\\"style\\"></head>
<body>
<ul class=\\"navbar\\">
<li>
Expand All @@ -332,9 +300,12 @@ footer {
`;

exports[`publicPath should prune external sheet 1`] = `
".extra-style {
"
.extra-style {
font-size: 200%;
}"
}

"
`;

exports[`webpack compilation 1`] = `
Expand Down
Loading