Class: Navtastic::Renderer::Bulma

Inherits:
Navtastic::Renderer show all
Defined in:
lib/navtastic/renderer/bulma.rb

Overview

This renderer adds css classes and structure for the bulma.io framework

Instance Method Summary collapse

Methods inherited from Navtastic::Renderer

#menu_inside_container?, render

Instance Method Details

#item_content(item) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/navtastic/renderer/bulma.rb', line 29

def item_content(item)
  element = super(item)

  element.class_list << 'is-active' if item.current?

  element
end

#item_tag(item) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/navtastic/renderer/bulma.rb', line 21

def item_tag(item)
  if headers? && item.menu.root?
    para(class: 'menu-label') { yield }
  else
    li { yield }
  end
end


13
14
15
16
17
18
19
# File 'lib/navtastic/renderer/bulma.rb', line 13

def menu_tag(menu)
  if headers? && menu.root?
    nav(class: 'menu') { yield }
  else
    ul(class: 'menu-list') { yield }
  end
end

Returns:

  • (Boolean)


9
10
11
# File 'lib/navtastic/renderer/bulma.rb', line 9

def submenu_inside_container?(item)
  !(headers? && item.menu.root?)
end