font-awesome-sassを使用する[rails, slim, FontAwesome]
参考文献
- RailsでFontAwesomeを使う (https://qiita.com/fumikao/items/59ab20af33047d06e6e3)
- gem 'font-awesome-rails'は最新版に対応してない... 代わりにfont-awesome-sassを使おう!
(https://qiita.com/paudorino/items/d54348f6d48eefcee6c7)
- FontAwesome::Sass (https://github.com/FortAwesome/font-awesome-sass)
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
利用手順
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]
今回使用するアイコン
記述
p
|
test
= icon 'far', 'surprise'
/<p>
/ test
/ <i class="far fa-surprise"></i>
/</p>
出力結果
Author And Source
この問題について(font-awesome-sassを使用する[rails, slim, FontAwesome]), 我々は、より多くの情報をここで見つけました https://qiita.com/Ham4690/items/7774557577368ac60f4b著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .