4

I'm developing a web application that uses HTML 5 native web components. My problem is that I have a lot of common CSS for all of these and I use font awesome to have nice icons. Right now I put all my styles inside "/deep" shadow piercing but Chrome says : "/deep/ combinator is deprecated." Do you have any suggestions on how can I have global CSS and CSS libraries (like font awesome) available on the whole app ?

Thanks :)

Supersharp
  • 29,002
  • 9
  • 92
  • 134
Nicolas Garin
  • 213
  • 3
  • 11

1 Answers1

6

You could include the CSS font file globally, with the <link rel="stylesheet"> element.

Then, you'll have to import it locally in every Custom Element's <template>, in a <style> element, using the @import url CSS rule.

There's a running example in this answer.

captDaylight
  • 2,224
  • 4
  • 31
  • 42
Supersharp
  • 29,002
  • 9
  • 92
  • 134
  • Thank you for your response, I think indeed that this is the cleaner solution. I didn't wanted to do it because I need to include it in all my components. – Nicolas Garin Jul 22 '16 at 13:02