purifycss / gulp-purifycss

Removed unused CSS with the gulp build tool
MIT License
336 stars 21 forks source link

Contents inside element tags are also being scanned #27

Open jeytii opened 6 years ago

jeytii commented 6 years ago

It seems that the plugin is reading the text contents as well. Consider the code below:

HTML: <h1 class="text">Hello</h1>

Compiled CSS:

.text {
    color: red;
}
.hello {
    background: blue;
}

The .hello class is supposed to be removed from the compiled CSS since such class name doesn't exist in the HTML file, but it's still there because of h1's text content, which is "Hello".