In my shared folder . Auth folder. components are there in auth .we write some css in 'auth.component.scss',it is like parent to all components it will affect all component scss, but i don't wont effect 'y' component means all pages effecting max width :'35rem' but i want seperate for this page width:100% ; if i use /deep/ concept . when 'y' component loads width :100% effecting ,after returning to another component it will not change to actual max width 35 rem
Asked
Active
Viewed 94 times
-1
-
1Did you tried with view encapsulation setting to none for your y component ? – sunilbaba Jun 26 '20 at 17:27
-
yes .but it is getting an error ts lint . it can't load a page. – Yemineni Hanumantha Rao Jun 27 '20 at 04:53
1 Answers
0
You can just add a specific class to children where you want/don't want the child to be applied.
::ng-deep container .page
{
max-width: 35rem; /* Max width for all page elements */
}
::ng-deep container .apply .page
{
/* Max width for all page elements which have a parent with
max-width: 35rem; 'apply' class*/
}
::ng-deep container :not(.dont-apply) .page
{
/* Max width for all page elements except these which have a parent with 'dont-apply' class*/
max-width: 35rem;
}

David
- 33,444
- 11
- 80
- 118
-
-
Not necessarily. But if you want these styles to only apply to child components of a parent component, you need to use `:host ::ng-deep .....` – David Jun 27 '20 at 06:52
-
thanks for answer .. i'm new for this deep concept i'm done with another way by using
divided parent and child by using the condtion window.location.path by using path i put an condtion to divide components ..any way thanks – Yemineni Hanumantha Rao Jun 29 '20 at 13:15 -
do you know recordrtc? is there any refrence code send me please !! – Yemineni Hanumantha Rao Jul 01 '20 at 08:31
-
Accept this answer if it solved your problem and open another question if it's something unrelated – David Jul 01 '20 at 08:44