I am working on a Parent component that contains two child components. Each component utilizes accordion-groups for its functionality. I have created a specific class for styling purposes in my stylesheets, but I want this class to only apply to the parent component and not the child components. However, despite using the :not selector, the class is being applied to the entire page including the child components.
Custom Class
accordion-group :not(app-child){
.panel-heading {
height: 44px;
display: flex;
align-items: center;
width: 100%;
padding-left: 20px;
}
.panel-body {
padding-top: 0 !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
.panel-title {
width: 100%;
}
}
Example in HTML
<accordian>
<accordion-group>
<div class="panel-heading">
<div class="panel-title">
<app-child>
<accordian>
<accordion-group>
<div class="panel-heading">
<div class="panel-title">
...
</div>
</div>
</accordion-group>
</accordian>
</app-child>
</div>
</div>
</accordion-group>
</accordian>
Adding Another Simple Example
HTML
<div class="acc">
<span class="acc">span1</span><br>
<span class="acc">span2</span>
<div>
<span class="acc">span3</span><br>
<span class="acc">span4</span>
</div>
</div>
CSS
div:not(div){
border:solid black;
}
My goal is to have the class applied only to span1 and span2, and not to span3 and span4.