Module: Proscenium::CssModule::ClassMethods
- Defined in:
- lib/proscenium/css_module.rb
Instance Method Summary collapse
Instance Method Details
#class_names(*names, path: nil) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/proscenium/css_module.rb', line 27 def class_names(*names, path: nil) path ||= respond_to?(:css_module_path) ? css_module_path : path names = names.flatten.compact cssm = Transformer.new(path) cssm.class_names(*names).map { |name, _| name }.join(' ') unless names.empty? end |
#css_module(*names, path: nil) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/proscenium/css_module.rb', line 20 def css_module(*names, path: nil) path ||= respond_to?(:css_module_path) ? css_module_path : path cssm = Transformer.new(path) cssm.class_names(*names, require_prefix: false).map { |name, _| name }.join(' ') end |