Class: Matestack::Ui::Bootstrap::Components::Icon

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/matestack/ui/bootstrap/components/icon.rb

Instance Method Summary collapse

Instance Method Details

#get_sizeObject



15
16
17
# File 'lib/matestack/ui/bootstrap/components/icon.rb', line 15

def get_size
  context.size || 20
end

#responseObject



9
10
11
12
13
# File 'lib/matestack/ui/bootstrap/components/icon.rb', line 9

def response
  svg class: "bi #{context.bs_class}", width: get_size, height: get_size, fill: 'currentColor' do
    unescape("<use xlink:href='#{asset_path("icons/bootstrap-icons.svg")}##{context.name}'/>")
  end
end