Build reusable, tweakable UI elements out of atomic-CSS classes
Classes: Compound
'0.1.0'.freeze
Button = Compound.new(bg: 'bg-blue', color: 'white') <button class="<%= Button %>">A blue button</button> <button class="<%= Button.(bg: 'bg-red') %>">A red button</button>
Parameters:
values are the CSS class names that get chained
keys define the API you’ll use to apply alternate classes
@return [Molecular::Compound]
16 17 18
# File 'lib/molecular.rb', line 16 def compound(atoms) Compound.new(atoms) end