Module: Playbook::LineHeight

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



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

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

Instance Method Details

#line_height_optionsObject



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

def line_height_options
  {
    line_height: "line_height",
  }
end

#line_height_propsObject



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

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

  selected_props.map do |k|
    line_height_value = send(k)
    "line_height_#{line_height_value}" if line_height_values.include? line_height_value
  end.compact.join(" ")
end

#line_height_valuesObject



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

def line_height_values
  %w[tightest tighter tight normal loose looser loosest]
end