From 119ce9d018ef25bf08531114ce22307306dfc212 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 27 Mar 2011 21:03:14 -0700 Subject: [PATCH] Don't output transparent in css2 ouput. Closes GH-309 --- .../monkey_patches/browser_support.rb | 18 ++++++++++++++++++ test/sass_extensions_test.rb | 1 + 2 files changed, 19 insertions(+) diff --git a/lib/compass/sass_extensions/monkey_patches/browser_support.rb b/lib/compass/sass_extensions/monkey_patches/browser_support.rb index 6dfa63d8..95d8997e 100644 --- a/lib/compass/sass_extensions/monkey_patches/browser_support.rb +++ b/lib/compass/sass_extensions/monkey_patches/browser_support.rb @@ -92,4 +92,22 @@ module Sass::Script end end + class String < Literal + def supports?(aspect) + aspect == "css2" && value == "transparent" && type == :identifier + end + + def has_aspect? + true + end + + def to_css2(options = self.options) + if value == "transparent" && type == :identifier + Sass::Script::String.new("") + else + dup + end + end + end + end diff --git a/test/sass_extensions_test.rb b/test/sass_extensions_test.rb index cbd75f8a..3d129d87 100644 --- a/test/sass_extensions_test.rb +++ b/test/sass_extensions_test.rb @@ -87,6 +87,7 @@ class SassExtensionsTest < Test::Unit::TestCase assert_equal "true", evaluate("blank('')") assert_equal "true", evaluate("blank(' ')") assert_equal "true", evaluate("blank(-compass-space-list(' '))") + assert_equal " ", evaluate("-css2(transparent linear-gradient(#fff,#000))") end protected