nuxt-community / fontawesome-module

Module to use Font Awesome icons in Nuxt.js
MIT License
110 stars 12 forks source link

Brand icons are not loading #40

Open gregmarzio opened 3 years ago

gregmarzio commented 3 years ago

Solid icons are loading but Brand icons are not. Any ideas if this is a bug?

Screenshot-2021-09-11-171158

nuxt.config.js file

...
buildModules: [
    '@nuxtjs/fontawesome',
],
...
fontawesome: {
    icons: {
        brands: [
            'faFacebookSquare',
            'faGithubSquare',
            'faInstagram',
            'faLinkedin',
            'faPinterestSquare',
            'faTelegram',
            'faTwitterSquare',
            'faVimeoSquare',
            'faWhatsappSquare',
        ],
        solid: [
            'faCircle',
            'faDesktop',
            'faFilePdf',
            'faMobileAlt',
            'faPhoneSquareAlt',
            'faPencilRuler',
            'faServer',
        ],
    },
},

package.json

...
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-regular-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/vue-fontawesome": "^2.0.2",
"@nuxtjs/fontawesome": "^1.1.2",
...
skyler-saville commented 2 years ago

Hey! not sure if you found a fix for this. But I believe the issue lies with the prefix being incorrect. The brand prefix is 'fab' instead of 'fas' (i.e. 'fontawesome brands' instead of 'fontawesome solid'). Hope that helps.
<font-awesome-icon :icon="['fab', 'twitter']" />

gregmarzio commented 2 years ago

Yes, I had to add for the brand icons. The solid icons did not require this.