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

Smarter preserve/remove [fr] #109

Open
PRR24 opened this issue Jan 19, 2022 · 0 comments
Open

Smarter preserve/remove [fr] #109

PRR24 opened this issue Jan 19, 2022 · 0 comments

Comments

@PRR24
Copy link

PRR24 commented Jan 19, 2022

It would be great if:

  • there was an option to preserve all non-inlineable CSS, which in addition to existing preserveMediaQueries would also preserve selectors like a:hover etc.
  • removeHtmlSelectors would cooperate with the preserved CSS, so it would remove only classes that are not addressed in preserved CSS.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant