Module: Ariadne::ViewComponent::StyleVariants

Extended by:
ActiveSupport::Concern
Included in:
BaseComponent
Defined in:
app/lib/ariadne/view_component/style_variants.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#merged_styles(name = self.class.default_style_name, **variants) ⇒ Object

merge Araidne style variants with user provided overrides



60
61
62
63
# File 'app/lib/ariadne/view_component/style_variants.rb', line 60

def merged_styles(name = self.class.default_style_name, **variants)
  default_styles = self.class.style_config.compile(name.to_sym, **variants)
  Ariadne::ViewComponents.tailwind_merger.merge([default_styles, styles.fetch(name, "")])
end