Ionic how to use sass variable

I would like to adjust my popover width and height. However from the ionic framework it shows for example, “$popover-md-min-width” how do I use it? As I pasted in the scss file it’s not working. Thankyou.

1 Like


1 Like

in your project theme folder in variables.scss paste ur variable and give it a value. it should be something like this

// Shared Variables
// --------------------------------------------------
// To customize the look and feel of this app, you can override
// the Sass variables found in Ionic's source scss files.
// To view all the possible Ionic variables, see:
$popover-md-min-width: 100px;
1 Like

But I would like it to soley appear on a page and not affect all app

-> But I would like it to soley appear on a page and not affect all app

Then you can’t use a ‘shared variable’.


then i think the best way is to give your page an id… and in the page .scss file style it as you like
for example lets think this is your component html:

<ion-content id="myPage" >
	    <ion-title color="light">your navbar title!</ion-title>

then style everything that you want in the .scss file with css selectors as below:

#myPage myElement{
   some style;

this way not only it applies only to this page… but also it wont get overwritten by ionic default styles.

1 Like

thaankyou guys for all the help much clearer now thankyou.

1 Like

Use the page’s selector so any styles only apply to that page:

  selector: 'page-introduction',
  templateUrl: 'introduction.html'


page-introduction {

  .swiper-pagination-bullet-active {
    background: white;