From d0d2037bf3743eb90f95416b53affaae384be9ac Mon Sep 17 00:00:00 2001 From: Deepak Mahakale Date: Mon, 10 Jan 2022 22:36:31 +0000 Subject: [PATCH] Docs: Add more examples for stacked_icon - Add an example for the usage of `base_options` - Add an example for the usage of `icon_options` --- README.md | 11 +++++++++++ app/helpers/font_awesome/rails/icon_helper.rb | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index 34da08e..b20f0f6 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,17 @@ fa_stacked_icon "terminal inverse", base: "square", class: "pull-right", text: " # => # => Hi! +fa_stacked_icon "camera", base: "ban", base_options: { style: "color:Tomato" } +# => +# => +# => +# => + +fa_stacked_icon "flag", base: "circle", icon_options: { style: "color:Green" } +# => +# => +# => +# => ``` ## Misc diff --git a/app/helpers/font_awesome/rails/icon_helper.rb b/app/helpers/font_awesome/rails/icon_helper.rb index a6e541e..c7ba24c 100644 --- a/app/helpers/font_awesome/rails/icon_helper.rb +++ b/app/helpers/font_awesome/rails/icon_helper.rb @@ -62,6 +62,18 @@ def fa_icon(names = "flag", original_options = {}) # # => # # => # # => + # + # fa_stacked_icon "camera", base: "ban", base_options: { style: "color:Tomato" } + # # => + # # => + # # => + # # => + # + # fa_stacked_icon "flag", base: "circle", icon_options: { style: "color:Green" } + # # => + # # => + # # => + # # => def fa_stacked_icon(names = "flag", original_options = {}) options = original_options.deep_dup classes = Private.icon_names("stack").concat(Array(options.delete(:class)))