Module: Playbook::PositionPropsCss

Included in:
Bottom, Left, Right, Top
Defined in:
lib/playbook/position_props_css.rb

Constant Summary collapse

POSITION_VALUES =
%w[0 xxs xs sm md lg xl auto initial inherit].freeze

Instance Method Summary collapse

Instance Method Details

#positioning_css(property, value) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/playbook/position_props_css.rb', line 7

def positioning_css(property, value)
  if value.is_a?(String)
    "#{property}_#{value}"
  elsif value.is_a?(Hash) && value.key?(:inset)
    "#{property}_#{value[:value]}_inset"
  elsif value.is_a?(Hash)
    "#{property}_#{value[:value]}"
  end
end