ngx-responsive
ngx-responsive copied to clipboard
Add a css class based on device
Hi, Is there a way to add a class such as 'iphone' or 'ipad' to an element using code logic?
For instance something like:
[class.iphone]="device.iphone == true"
Hi, I'm interested in the same question. Currently Im doing a horrorous hack
<component-nav *isMobile [ngClass]="{'fixed': isFixed === true }"></component-nav>
<component-nav *isDesktop></component-nav>
I calculated isFixed based in the scroll, in this view I have other elements that use the same variable isFixed.
Hello,
I would also need this with responsive-window feature:
<div [responsive-window]="'parent'">
<p [class.max-width-sm]="{ sizes:{ window: 'parent', min:900, max:1400} }"></p>
</div>
or maybe :
<div [responsive-window]="'parent'">
<p [responsive-class]="{ 'max-width-sm': { sizes:{ window: 'parent', min:900, max:1400} } }"></p>
</div>