Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Purgecss should not remove html style #69

Open
edwardanthony opened this issue Feb 21, 2019 · 1 comment
Open

Purgecss should not remove html style #69

edwardanthony opened this issue Feb 21, 2019 · 1 comment

Comments

@edwardanthony
Copy link

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.

  1. Install purecss library
npm install purecss --save
  1. Add component.js
export default (text = 'Hello world') => {
    const element = document.createElement('div');

    element.className = 'pure-button';
    element.innerHTML = text;

    return element;
};
  1. 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.

@ghost
Copy link

ghost commented Jan 8, 2020

Happened to me too. For some reason deletes all htmltag styles, and I solved it adding the following option:

whitelist: ['html']

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

No branches or pull requests

1 participant