4
1

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.

font-awesome-sassを使用する[rails, slim, FontAwesome]

Last updated at Posted at 2020-05-30

参考文献

FontAwesome

Get vector icons and social logos on your website with Font Awesome, the web's most popular icon set and toolkit.
webで人気のあるアイコンセットやツールキットのFontAwesomeを使うことで, ベクターアイコンやソーシャルロゴを取得することができます。
FontAwesome公式サイト: (https://fontawesome.com/)

font-awesome-sass

利用手順

今回はfont-awesome-sassを利用します。
詳細な情報については以下のサイトを参照してください。
https://github.com/FortAwesome/font-awesome-sass

Gemfileに記述
Gemfile
gem 'font-awesome-sass', '~> 5.13.0'
実行

terminalで以下のコマンドを入力

bundle install
application.scssへ記述
app/assets/stylesheets/application.scss
@import "font-awesome-sprockets";
@import "font-awesome";

使用例[slim]

今回使用するアイコン

スクリーンショット 2020-05-30 13.16.24.png

記述
p
  |
    test
  = icon 'far', 'surprise'
/<p>
/  test
/  <i class="far fa-surprise"></i>
/</p>
出力結果

スクリーンショット 2020-05-30 13.25.41.png

4
1
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
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?