Sha256: 06bed1cb31c36ef44da847959a9d0699ab631bcf2e9b91cdf227e042aa643679

Contents?: true

Size: 485 Bytes

Versions: 1

Compression:

Stored size: 485 Bytes

Contents

module Compass::SassExtensions::Functions::Constants
  # returns the opposite position of a side or corner.
  def opposite_position(position)
    opposite = position.value.split(/ +/).map do |pos|
      case pos
      when "top" then "bottom"
      when "bottom" then "top"
      when "left" then "right"
      when "right" then "left"
      when "center" then "center"
      else
        pos
      end
    end
    Sass::Script::String.new(opposite.join(" "), position.type)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
compass-0.11.alpha.0 lib/compass/sass_extensions/functions/constants.rb