Class: Icon::Component
- Inherits:
-
Lookbook::BaseComponent
- Object
- Lookbook::BaseComponent
- Icon::Component
- Defined in:
- app/components/lookbook/icon/component.rb
Instance Method Summary collapse
-
#initialize(name:, size: 4, **html_attrs) ⇒ Component
constructor
A new instance of Component.
- #size_rems ⇒ Object
Constructor Details
#initialize(name:, size: 4, **html_attrs) ⇒ Component
Returns a new instance of Component.
3 4 5 6 7 |
# File 'app/components/lookbook/icon/component.rb', line 3 def initialize(name:, size: 4, **html_attrs) @alpine_data = name.is_a?(Symbol) ? alpine_encode(name.to_s.tr("_", "-")) : name @size = size || 4 super(**html_attrs) end |
Instance Method Details
#size_rems ⇒ Object
9 10 11 |
# File 'app/components/lookbook/icon/component.rb', line 9 def size_rems "#{@size * 0.25}rem" end |