Jey R
Jey R

Reputation: 21

PrimeNG v19 with ViewEncapsulation.ShadowDom and web-components

According to the PrimeNG documentation, to connect styles and a custom theme, you need to add the following to app.config.ts:

const appConfig: ApplicationConfig = {
  providers: [
    provideAnimationsAsync(),
    providePrimeNG({
      theme: {
        preset: primengCustomPreset // my custom styles
      }
    })
  ]
};

I am developing a web component with custom elements and want to use Shadow DOM, but this approach does not work with ViewEncapsulation.ShadowDom since styles are added to the global .

The theme.css and primeng/resources no longer exist, so importing them in CSS is also not an option.

Everything works fine without ViewEncapsulation.ShadowDom. Are there any solutions for this?

Upvotes: 1

Views: 54

Answers (0)

Related Questions