I am creating a library using angular CDK for custom modal. I want the application which would use the library to pass the CSS class name with other configuration for the modal window. So that I can apply the class like this in the library.
this.overlayContainer.getContainerElement().classList.add(modalConfig.overlayContainerClass);
I can see the class is applied to the element but no class present.
<div class="cdk-overlay-container overlay-material-design-theme mat-typography custom">
I have defined this in the application component CSS file.
.custom{
width: 100%;
}
The question is how the CSS which is present in the application component would be accessible to library component?
customclass should be defined in a file that's not subject to the encapsulation rules. Usually that's the global styles.scss file in the root folder. Or in a file that is imported in there if you want more structure.