Sha256: fa8e855777136e5e54b975a9f8db3d5c1c6fa349aabe94a202691385bcec2e87
Contents?: true
Size: 548 Bytes
Versions: 10
Compression:
Stored size: 548 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 raise Sass::SyntaxError, "Cannot determine the opposite of #{pos}" end end Sass::Script::String.new(opposite.join(" "), position.type) end end
Version data entries
10 entries across 10 versions & 1 rubygems