jonkemp / jonkemp/inline-css

Smarter preserve/remove [fr]

Open
#109 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
438
Forks
77
PR merge metrics
No merged PRs in 30d

Description

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:
```html

.c1 { color: blue; }
.c1:hover { color: red }
.c2 { color: blue; }
@media (min-width: 100px) {
.c2 { color: red }
}
.c3: { color: blue; }

c1
c2
c3
```
would result:
```html

.c1:hover { color: red }
@media (min-width: 100px) {
.c2 { color: red }
}

c1
c2
c3
```
Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.