user220409
user220409

Reputation: 184

Cascading styles change in angular4+

// component parent - template
<div class="parent">
    <ng-content></ng-content>
</div>


// somewhere in the code
<parent>
    <label>Some Text</label>
</parent>

As in the style of the parent component to set the color for the label?

.parent label
    color: red

Upvotes: 0

Views: 90

Answers (1)

Denys Reshetniak
Denys Reshetniak

Reputation: 382

You need to specify styles for elements which will go in ng-content in parent of parent component. And for everything else - in parent component. Please have a look on the plunker example

Upvotes: 1

Related Questions