Module: Irelia::Options::Flex::Items

Included in:
Flex::Component, Stack::Component
Defined in:
lib/irelia/options/flex/items.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/irelia/options/flex/items.rb', line 5

def self.included(base)
  base.class_eval do
    option :items, default: -> { nil }, in: %i[start center end baseline stretch]

    after_initialize do
      add_css_classes(
        class_names(
          "irelia-items-start": items == :start,
          "irelia-items-center": items == :center,
          "irelia-items-end": items == :end,
          "irelia-items-baseline": items == :baseline,
          "irelia-items-stretch": items == :stretch,
        )
      )
    end
  end
end