Class: Essence::Skeleton

Inherits:
Essence
  • Object
show all
Defined in:
lib/essence/components/skeleton.rb

Constant Summary collapse

CLASSES =
"animate-pulse bg-gray-200/55 rounded-xs"

Constants inherited from Essence

Essence::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Essence

#attributes

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ Skeleton

Returns a new instance of Skeleton.



6
7
8
9
# File 'lib/essence/components/skeleton.rb', line 6

def initialize(**attributes)
  @attributes = attributes
  @attributes[:class] = @attributes[:class] ? TAILWIND_MERGER.merge([ CLASSES, @attributes[:class] ]) : CLASSES
end

Instance Method Details

#view_templateObject



11
12
13
# File 'lib/essence/components/skeleton.rb', line 11

def view_template(&)
  div(**@attributes, &)
end