Module: Playbook::AlignContent

Included in:
KitBase
Defined in:
lib/playbook/align_content.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/playbook/align_content.rb', line 5

def self.included(base)
  base.prop :align_content
end

Instance Method Details

#align_content_optionsObject



19
20
21
22
23
# File 'lib/playbook/align_content.rb', line 19

def align_content_options
  {
    align_content: "align_content",
  }
end

#align_content_propsObject



9
10
11
12
13
14
15
16
17
# File 'lib/playbook/align_content.rb', line 9

def align_content_props
  selected_props = align_content_options.keys.select { |sk| try(sk) }
  return nil unless selected_props.present?

  selected_props.map do |k|
    align_content_value = send(k)
    "align_content_#{align_content_value}" if align_content_values.include? align_content_value
  end.compact.join(" ")
end

#align_content_valuesObject



25
26
27
# File 'lib/playbook/align_content.rb', line 25

def align_content_values
  %w[start end center space_between space_around space_evenly]
end