Class: PhlexUI::ThemeToggle

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/theme_toggle.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template, #initialize

Constructor Details

This class inherits a constructor from PhlexUI::Base

Instance Method Details

#dark_mode(**user_attrs) ⇒ Object



14
15
16
17
# File 'lib/phlex_ui/theme_toggle.rb', line 14

def dark_mode(**user_attrs, &)
  dark_attrs = PhlexUI::AttributeMerger.new(default_dark_attrs, user_attrs).call
  div(**dark_attrs, &)
end

#light_mode(**user_attrs) ⇒ Object



9
10
11
12
# File 'lib/phlex_ui/theme_toggle.rb', line 9

def light_mode(**user_attrs, &)
  light_attrs = PhlexUI::AttributeMerger.new(default_light_attrs, user_attrs).call
  div(**light_attrs, &)
end

#view_templateObject



5
6
7
# File 'lib/phlex_ui/theme_toggle.rb', line 5

def view_template(&)
  div(**attrs, &)
end