Module: AmberComponent::Helpers::CssHelper
- Included in:
- Base
- Defined in:
- lib/amber_component/helpers/css_helper.rb
Overview
Adds a few utility methods for working with CSS inside components.
Instance Method Summary collapse
-
#css_identifier(name) ⇒ String
(also: #css_id)
Helper method which creates a name for a css class or id which is scoped to the current component class.
Instance Method Details
#css_identifier(name) ⇒ String Also known as: css_id
Helper method which creates a name for a css class or id which is scoped to the current component class.
self.class #=> Navigation::DropdownMenuComponent
css_id(:list_item) #=> "navigation-dropdown_menu_component--list_item"
18 19 20 |
# File 'lib/amber_component/helpers/css_helper.rb', line 18 def css_identifier(name) "#{self.class.name.underscore.gsub('/', '-')}--#{name.to_s.underscore}" end |