3

Chrome v73. Webpack v4.29.6.

I am trying to wrap an ag-grid in a web component with a shadow dom. In order to do so, I need to load the theme .css files in the context of shadow dom.

I want to do this as a module import via a Constructable Stylesheet. I know these are a fairly new concept, but is there anything in webpack that will take a css file and as part of an import convert it to a exported Constructable Stylesheet javascript module that is then imported as part of the webpack build

Eugene
  • 10,957
  • 20
  • 69
  • 97
Cheetah
  • 13,785
  • 31
  • 106
  • 190
  • Are you using any class helpers like LitElement or Stencil, or composing your web-components with vanilla JS? I've accomplished what you are trying with the help of some LitElement functionality and a couple small tools, notably `wc-sass-render` (to make your styles into a JS module you can import) and `static get styles()` that is LitElement's stylesheet constructor which will put your imported style into the component's shadow-root's adoptedStylesheets. – Kevin H. Mar 13 '20 at 19:48

0 Answers0