Purgecss should not remove html style
edwardanthony opened this issue · 1 comments
edwardanthony commented
Version: 1.4.0
Platform: MacOS 10.13.6
How to reproduce
Note: Please notice the difference between "purecss" and "purgecss" as it looks similar.
- Install purecss library
npm install purecss --save
- Add component.js
export default (text = 'Hello world') => {
const element = document.createElement('div');
element.className = 'pure-button';
element.innerHTML = text;
return element;
};
- Add this in index.js entry point.
import 'purecss';
import './main.scss';
import component from './component';
document.body.appendChild(component());
Purgecss wil purge the css, including the html style.
Below you could see the html style that is removed by Purgecss.
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
Because html style is removed, the font will look different after purging.
Deleted user commented
Happened to me too. For some reason deletes all html
tag styles, and I solved it adding the following option:
whitelist: ['html']