From a8457c99db544d8aab4071fca019e15b9bc24e4e Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Tue, 16 Feb 2010 22:14:10 -0800 Subject: [PATCH] Fix some x-browser issues in the gradient point code. --- .../sass_extensions/functions/gradient_support.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/compass/sass_extensions/functions/gradient_support.rb b/lib/compass/sass_extensions/functions/gradient_support.rb index 75e6efbb..764e679b 100644 --- a/lib/compass/sass_extensions/functions/gradient_support.rb +++ b/lib/compass/sass_extensions/functions/gradient_support.rb @@ -92,17 +92,22 @@ module Compass::SassExtensions::Functions::GradientSupport def grad_point(position) position = position.value position = if position[" "] - position + if position =~ /(top|bottom) (left|right)/ + "#{$2} #{$1}" + else + position + end else case position when /top|bottom/ - "#{position} left" + "left #{position}" when /left|right/ - "top #{position}" + "#{position} top" end end Sass::Script::String.new position.gsub(/top/, "0%").gsub(/bottom/, "100%").gsub(/left/,"0%").gsub(/right/,"100%") end + def color_stops(*args) List.new(*args.map do |arg| case arg