Module: ViewComponentScopedCss::Base
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/view_component_scoped_css/base.rb
Overview
A class for providing styles to a view component. If you include this class, you will be able to describe scss in the namespace of each component
Instance Method Summary collapse
- #component_options ⇒ Object
- #component_tag(name = ViewComponentScopedCss.config.component_tag, **tag_options, &block) ⇒ Object
- #component_tag_class ⇒ Object
Instance Method Details
#component_options ⇒ Object
25 26 27 |
# File 'lib/view_component_scoped_css/base.rb', line 25 def {} end |
#component_tag(name = ViewComponentScopedCss.config.component_tag, **tag_options, &block) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/view_component_scoped_css/base.rb', line 33 def component_tag(name = ViewComponentScopedCss.config.component_tag, **, &block) safe_join( [ self.class.component_css_tag, content_tag( name, class: [self.class.component_identifier_for_css, [:class]].compact.join(" "), **, &block ) ].compact ) end |
#component_tag_class ⇒ Object
29 30 31 |
# File 'lib/view_component_scoped_css/base.rb', line 29 def component_tag_class self.class.component_identifier_for_css end |