Class: SolidusAdmin::SkipLink::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/solidus_admin/skip_link/component.rb

Overview

Skip to content link

Instance Method Summary collapse

Constructor Details

#initialize(href:) ⇒ Component

Returns a new instance of Component.

Parameters:

  • href (String)

    the href attribute for the skip link



6
7
8
# File 'app/components/solidus_admin/skip_link/component.rb', line 6

def initialize(href:)
  @href = href
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/components/solidus_admin/skip_link/component.rb', line 10

def call
  link_to t(".skip_link"),
          @href,
          class: %{
            sr-only
            focus:not-sr-only
            inline-block
            focus:p-2
            focus:absolute
            body-small
            text-white
            bg-black
          }
end