extract-css icon indicating copy to clipboard operation
extract-css copied to clipboard

inline CSS not being extracted

Open anuragphadke opened this issue 6 years ago • 6 comments

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?

anuragphadke avatar May 12 '18 20:05 anuragphadke

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.

jonkemp avatar May 14 '18 15:05 jonkemp

@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.

anuragphadke avatar May 14 '18 15:05 anuragphadke

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?

jonkemp avatar May 14 '18 15:05 jonkemp

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.

anuragphadke avatar May 14 '18 15:05 anuragphadke

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

jonkemp avatar May 14 '18 15:05 jonkemp

@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.

PawelGlow avatar Sep 03 '18 11:09 PawelGlow