I want to have a clean HTML, only the component content and not the container, because I want to use ITCSS and RSCSS methodologies.
So, thinking that I have 2 components: app-simple-card and app-superior-header; I want have the following structure.
simple-card.component.scss
.simple-card {
> .header {
@extends .superior-header;
@extends .superior-header.-compact;
}
}
superior-header.component.scss
.superior-header {
> .title {}
&.-compact {}
}
The problem
Angular renders a "container" for the component content, forcing me to use the component name as part of the selector. It is against the RSCSS methodology, so I don't want to do it that way, and it would awful to reuse the styles in another project.
Right now, the scss file would look like this:
.simple-card {
> app-superior-header > .header {...}
}
I also don't want to use the component as an attribute, because it wouldn't solve my problem, and it's not considered a good practice. I need to completely remove/replace the component "container" only showing it's content.
Within the component styling, you can target the component element with
If you want to target children within a component use