Font Awesome with Ionic2

后端 未结 1 888
温柔的废话
温柔的废话 2021-01-19 15:12

How to use Font Awesome icons with ?

What I am trying:


    

        
相关标签:
1条回答
  • 2021-01-19 15:27

    Here is my solution to add Font Awesome <ion-tab></ion-tab>

    Note: Make sure you have properly installed font awesome in your ionic project.

    your-example.html

    <ion-tabs tabsPlacement="top" >
      <ion-tab [root]="tabAlgorithms" tabTitle="Algorithms" tabIcon="fa-sitemap" ></ion-tab>   
    </ion-tabs>
    

    your-example.scss

    .fa-icons-general {
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        transform: translate(0, 0);
    }
    
    .ion-ios-fa-sitemap::before,
        .ion-ios-fa-sitemap-outline::before,
        .ion-md-fa-sitemap::before {
            @extend .fa-icons-general;
            content: "\f0e8";
        }
    

    Hope this will solve your problem.

    0 讨论(0)
提交回复
热议问题