PrimeNG v19 with ViewEncapsulation.ShadowDom and web-components

Discussão em 'Angular' iniciado por Jey R, Janeiro 27, 2025.

  1. Jey R

    Jey R Guest

    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?

    Continue reading...

Compartilhe esta Página