jonkemp / extract-css

This module has moved and is now available at
https://github.com/jonkemp/inline-css/tree/master/packages/extract-css
MIT License
16 stars 8 forks source link

inline CSS not being extracted #2

Open anuragphadke opened 6 years ago

anuragphadke commented 6 years ago

Hi, I am running css-extract for the following input:

<p style="color:black;">hi</p>

Shouldn't the expected output remove the inline style and replace it with an equivalent class?

Sample code from runkit below: https://runkit.com/embed/wumuo7i0nft6 Updated correct runkit link.

Any idea what might be wrong here?

jonkemp commented 6 years ago

Shouldn't the expected output remove the inline style and replace it with an equivalent class?

No, but it should be outputting the CSS.

Any idea what might be wrong here?

No, my guess is something is happening in runkit. I would have to dig in to it. Tests pass though, so I'm not seeing any problems with the module.

anuragphadke commented 6 years ago

@jonkemp does the module remove the inlined CSS from HTML, aka:

<p class="<class_name>"hi</p>

btw, I did try to run the above script on my laptop, same output.

jonkemp commented 6 years ago

does the module remove the inlined CSS from HTML

No

I did try to run the above script on my laptop, same output.

Did you get any errors? Did the tests pass?

anuragphadke commented 6 years ago

Didn't get any errors, output below:

html: <p style="color:black;">hi</p>
css:

Let me run the tests and update the ticket in a bit.

jonkemp commented 6 years ago

Ok, I'll accept the possibility that you are right and the docs are wrong and it doesn't extract inline css. 😄

PawelGlow commented 6 years ago

@jonkemp @anuragphadke any update on this issue? I am also seeing that the inline css is not being extracted... I though that is what this code is supposed to do. If possible, please provide a example that works. There is no test for extracting inline css, which is a bit frustrating.