In my app.component.css I have the following:
* ~ * {
margin-top: 24px;
}
which does apply some margin-top to all elements following the first one. This is not quite what I want, as I only need to target the direct children of my host. So I did the following :
:host > * ~ :host > * {
margin-top: 24px;
}
Unfortunately that doesn't do anything. What am I missing here ?
:hostwith the actual selector (tag name) of your component. I don't know how to address the direct children of a component, because you need to use::ng-deepto pierce through the component boundary and use>to address direct children. I don't know if and how these can be combined.