Are you adding the code to the component or master stylesheet? That type of CSS would likely need to be in the project master style sheet to work.
Note that > * > might not be working simply because your DOM is more complex once the app is rendered. Would need to see an inspection in browser to know for sure. Have you tried:
first-child third-child
Though Angular components are encapsulated by design, I believe that this kind of CSS may be considered going against the grain of the Angular design philosophy. A more "Angular way" might be to have a parameter on the third-child specifying a mode.
<component-parent>
<first-child>
<second-child>
<third-child mode="nested"></third-child>
</second-child>
</first-child>
</component-parent>
And choose your style based on the variable.
A more CSS approach, might be to target the elements in the view instead of the tag names, for example in the view of third-child have:
<div class="third-child">
... component body here
</div>
(and repeat for other components) and target your CSS
.first-child .third-child {
display: flex;
flex-direction: row;
}
Another option is to change the ViewEncapsulation settings, maybe set it to none in all of the components
@Component({
...
encapsulation: ViewEncapsulation.None
})
And gradually remove by trial and error until it works with the minimum number of components. I use this when I have a 3rd party component I can't change nested in one of my own, no known side effects in my project.
from the <component-parent></component-parent>s point of view.scss-file of<component-parent></component-parent>is meant by that.