How can i use fontawesome with ionic 2
, i've following this tutorial but it's not working.
fas - solid icons are usually filled with transparent outlines. far regular and fal light are similar. These icons are different than fas solid because they are mostly outlines and differ only in outline width. fal light icons have thinner outline compared to far regular.
Flutter gives an inbuilt icon pack to use in your app, but it has very few icon sets, so you have to depend on other icon packs. Font Awesome is one of the best icon packs for flutter or web applications.
Update in ionic 2 RC.0
@import "scss/font-awesome"; @font-face { font-family: 'FontAwesome'; src: url('../assets/fonts/fontawesome-webfont.eot?v=#{$fa-version}');
src: url('../assets/fonts/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
url('../assets/fonts/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'),
url('../assets/fonts/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
url('../assets/fonts/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
url('../assets/fonts/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; }
To include your icon in HTML
<i primary class="fa fa-cart-plus fa-lg"></i>
Ionic Beta
Install fontAwesome from the npm library.
Modify the below changes to your gulpfile.ts.
gulp.task('myCss', function(){ return gulp.src('path-to-your-font-lib/style.css') .pipe(gulp.dest('www/build/css')) }); gulp.task('myFonts', function(){ return gulp.src('path-to-your-font-lib/fonts/**/*.+(eot|svg|ttf|woff)') .pipe(gulp.dest('www/build/fonts')) });
gulp.task('watch', ['clean'], function(done){ //existing ionic2 code } gulp.task('build', ['clean','myCss','myFonts'], function(done){ //existing ionic2 code }
Include @import "../../node_modules/font-awesome/scss/font-awesome";
in app.core.scss file
To include your icon in HTML
<i primary class="fa fa-cart-plus fa-lg"></i>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With