Skip to content

Release 0.5.0

Latest

Choose a tag to compare

@HectorMF HectorMF released this 30 Mar 02:09
· 1 commit to master since this release

Breaking changes in the naming scheme of the DSL.
Ability to set attributes on the fly inside your components:

class MyComponent
  variants do
    base class: %w[border w-full]
  end

  def initialize()
    variant[:style] = "width:100%"
  end
  
  def set_tags(tags)
    variant[:data][:tags] = tags.map(&:downcase).join(",")
  end
end

# View

<div <%= attributes %></div>
comes out to 
<div class="border w-full" style="width:100%" data-tags="...."></div

Full Changelog: https://github.com/HectorMF/attrify/commits/0.5.0