I am trying to apply styles to the ngbTooltip component in my Angular 2 application. I am applying the directive as:
<div [ngbTooltip]="tooltipText"> Element text </div>
But since Angular 2 applies the style definition, I cannot directly style the .tooltip class in my component template.
How can I give hints for this particular component custom style?
EDIT:
I have a scss stylesheet attached to my component. My styles (simplified):
.license-circle { width: 10px; ... other styles } /deep/ .tooltip { &.in { opacity: 1; } }
But then my rendered styles look like this:
<style> .license-circle[_ngcontent-uvi-11] { width: 10px; } .tooltip.in { opacity: 1; } </style>
Which makes me believe that tooltip styles are not encapsulated (instead of just flashing these child components).
Note. I tried :host >>> .tooltip and it did not work, so I used /deep/ .
Thanks!
source share