0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

FontAwesomeの導入と使い方解説

Posted at

今回はFontAwesomeの導入方法から表示させるまでについてを解説していきます。

#FontAwesomeの導入

1.Gemfileに以下の記述を追記


gem "font-awesome-sass"
$ bundle install

2.application.scssに以下を記述。


@import "font-awesome-sprockets";
@import "font-awesome";

これで導入は完了です。

#ビューで表示
iconヘルパーメソッドを使っていきます。
使い方の模範はこんな感じです。

icon('接頭辞名', 'アイコン名')

実際に使うとこんな感じです。

= icon('fab', 'facebook-square') #例

###参考資料

接頭辞名とアイコン名については以下のサイトで調べて使いましょう!
https://fontawesome.com/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?