jonkemp / inline-css

Inline css into an html file.
MIT License
429 stars 84 forks source link

Smarter preserve/remove [fr] #109

Open PRR24 opened 2 years ago

PRR24 commented 2 years ago

It would be great if:

For example:

<style>
.c1 { color: blue; }
.c1:hover { color: red }
.c2 { color: blue; }
@media (min-width: 100px) {
  .c2 { color: red }
}
.c3: { color: blue; }
</style>
<a class="c1">c1</a>
<a class="c2">c2</a>
<a class="c3">c3</a>

would result:

<style>
.c1:hover { color: red }
@media (min-width: 100px) {
  .c2 { color: red }
}
</style>
<a class="c1" style="color: blue;">c1</a>
<a class="c2" style="color: blue;">c2</a>
<a style="color: blue;">c3</a>

Thank you.