stencil icon indicating copy to clipboard operation
stencil copied to clipboard

No styling(SCSS) is generated in Edge/IE11

Open nbgmtin opened this issue 7 years ago • 5 comments

Stencil version:

 @stencil/[email protected]

I'm submitting a:

[x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

Building a web component (Stencil --prod build mode) and then using it within a Vue app . After starting up the Vue app and looking in Chrome/Firefox it looks fine. But for some reason in Edge/IE11 styling for the web component is not generated.

It was working fine until I integrated it with my Vue app. Then the styling was gone.

Expected behavior:

It should produce CSS for Edge/IE11.

Steps to reproduce:

  1. Create a web component in Stencil and add some SCSS files to some component.
  2. Import your web component to a Vue app (I was using VUE CLI 3)
  3. Boot up your Vue app in Edge/IE11

Related code:

// insert any relevant code here

Other information:

nbgmtin avatar Aug 13 '19 14:08 nbgmtin

I tried changing the SCSS to a normal CSS and using that instead. When doing so it works with Edge/IE11. So there seems to be some problem compiling that SCSS in EdgeHTML.

nbgmtin avatar Aug 14 '19 09:08 nbgmtin

Ok after digging around I've come to the conclusion that I tried to use globalStyle with shadowdom. I didn't understand I had to use the new syntax ::part/::theme etc to style internally.

nbgmtin avatar Aug 14 '19 12:08 nbgmtin

The other issue I had when importing it to Vue was that I also had to import the generated global css into the vue app/page as well.

nbgmtin avatar Aug 14 '19 13:08 nbgmtin

@nbgmtin What was the solution for this? Could you please share this on the issue so others can apply it?

warapitiya avatar Aug 29 '19 13:08 warapitiya

Like I said: There wasn't any problem. I did not understand the new ::part/theme CSS selectors. The globalStyle is a generated .css file when you build for production. Remember to include that CSS file.

nbgmtin avatar Aug 29 '19 13:08 nbgmtin