I'm using Ionic2: I use a popover and I want to customize the size of every popover. This is the popover:
I want to decrease it's widt. I used this code in variable.scss
file:
$popover-md-width:50%;
It works fine but it is applied for every popover in my application. I want to customize the width of some popover. What should I do?
The
create
method accepts a third parameter:create(component, data, opts)
Where
opts
is of typePopoverOptions
And one of these options, is the
cssClass
property:So you can add a custom class when creating the popover:
And then use that class to apply the custom styling.