Atualizado em: {{ultimaAtualizacao | date:'dd/MM/yy...">

Can I resize the ion name inside the Ion navigator?

<ion-navbar color="primary">
  <ion-title>Atualizado em: {{ultimaAtualizacao |  date:'dd/MM/yyyy'}}</ion-title>
</ion-navbar>

      

I want to resize the text of the ion, I have already tried using css, but it doesn't change.

+4


source to share


4 answers


  • If you want to change it for every page of the application , you can use sass variables. You need to add the variables.scss

    following to the file :

    $toolbar-ios-title-font-size: 1.7rem;
    $toolbar-md-title-font-size: 2rem;
    $toolbar-wp-title-font-size: 1.5rem;
    
          

    These are the defaults, so you can set the values ​​you want there.

  • If you only want to change on one page , then you shouldn't use sass variables. Use a simple CSS rule in this scss file instead:

    your-page {
    
      toolbar-title toolbar-title-ios { 
        font-size: 1.7rem;
      }
    
      toolbar-title toolbar-title-md { 
        font-size: 2rem;
      }
    
      toolbar-title toolbar-title-wp { 
        font-size: 1.5rem;
      }
    
    }
    
          


EDIT:



If using css rules doesn't work, it may be a problem related to the specifics of those rules. You can try wrapping the page styles like this:

.ios, .md, .wp {

  your-page {

    // Put your css rules here!

  }

}

      

This way you can improve the specificity of your custom CSS rules and overwrite the Ionic css rules.

+6


source


According to the official API docs, it is possible to override SASS variables. Check it...



+2


source


IONIC 3:

Put this voice on your page scss

:

.toolbar-title-md {
    font-size: 1.5rem !important; // Default should be 2.0rem
}

      

0


source


You access the title with:

ion-toolbar .toolbar-title{
  font-size: 100%;
}
      

Run codeHide result


0


source







All Articles