Module: NfgUi::Components::Traits::Icon
- Included in:
- Foundations::Icon
- Defined in:
- lib/nfg_ui/components/traits/icon.rb
Overview
Access to pre-designed Icon traits
Constant Summary collapse
- TRAITS =
%i[loader tip].freeze
Instance Method Summary collapse
- #loader_trait ⇒ Object
-
#tip_trait ⇒ Object
The defacto “(?)” tip icon Usage: ui.nfg :icon, :tip, tooltip: ‘The tip’.
Instance Method Details
#loader_trait ⇒ Object
10 11 12 |
# File 'lib/nfg_ui/components/traits/icon.rb', line 10 def loader_trait [:icon] = 'spinner spin fw' end |
#tip_trait ⇒ Object
The defacto “(?)” tip icon Usage: ui.nfg :icon, :tip, tooltip: ‘The tip’
17 18 19 20 21 22 23 24 25 |
# File 'lib/nfg_ui/components/traits/icon.rb', line 17 def tip_trait [:icon] = NfgUi::DEFAULT_TIP_ICON [:theme] = NfgUi::DEFAULT_TIP_THEME if [:text].present? [:right] = true [:class] += ' fa-fw' end end |