In my development process, I am currently working on creating a library using Angular CDK specifically for custom modals. One feature I want to implement is the ability for applications using the library to pass a CSS class name along with other modal configurations. This way, I can easily apply the specified class within the library like this:
this.overlayContainer.getContainerElement().classList.add(modalConfig.overlayContainerClass);
Although I can confirm that the class is being applied to the element, it seems that the class itself is not present.
<div class="cdk-overlay-container overlay-material-design-theme mat-typography custom">
I have already defined the ".custom" class in the application component's CSS file:
.custom{
width: 100%;
}
My main question revolves around how the CSS styles from the application component can be accessed and utilized in the library component effectively?