Skip to content

Commit 66f011c

Browse files
committed
fix: do not use view encapsulation to allow customisation by consumers
1 parent 5c45d76 commit 66f011c

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

src/components/ngx-hover-opacity.component.ts

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
1+
import {
2+
ChangeDetectionStrategy,
3+
Component,
4+
Input,
5+
ViewEncapsulation,
6+
} from '@angular/core';
27

38
export interface INgxHoverOpacityComponentCustomStyle {
49
backgroundColor: string;
@@ -19,22 +24,25 @@ export interface INgxHoverOpacityComponentCustomStyle {
1924
`,
2025
styles: [
2126
`
22-
.content {
23-
position: relative;
24-
}
27+
ngx-hover-opacity
28+
.content {
29+
position: relative;
30+
}
2531
26-
.hover {
27-
position: absolute;
28-
background-color: rgba(255, 255, 255, 0.6);
29-
z-index: 1;
30-
top: 0;
31-
left: 0;
32-
right: 0;
33-
bottom: 0;
34-
}
35-
`,
32+
.hover {
33+
position: absolute;
34+
background-color: rgba(255, 255, 255, 0.6);
35+
z-index: 1;
36+
top: 0;
37+
left: 0;
38+
right: 0;
39+
bottom: 0;
40+
}
41+
}
42+
`,
3643
],
3744
changeDetection: ChangeDetectionStrategy.OnPush,
45+
encapsulation: ViewEncapsulation.None,
3846
})
3947
export class NgxHoverOpacityComponent {
4048
@Input() isHoverVisible: boolean;

0 commit comments

Comments
 (0)