Kamil Kamil
Kamil Kamil

Reputation: 85

Overriding style that already has !important

If I want to override some css from my component child, I just use:

:host ::ng-deep .y {
     x: !important;
}

but how to override a style that already has !important? The above example in this case won't work

Upvotes: 0

Views: 773

Answers (2)

rrd
rrd

Reputation: 5957

Going from your comment about the original code this should probably work:

:host ::ng-deep .sortable-container .sortable-list ul .active {
  x: value !important;
}

This assumes you're in a 'ul' but it could be ol or dl and replaced just as easily.

Upvotes: 0

Mile Mijatović
Mile Mijatović

Reputation: 3177

Try this

:host /deep/ .y

instead of

:host ::ng-deep .y

I use :host /deep/ .y in my Angular application and works perfectly

Upvotes: 1

Related Questions