diff --git a/lib/bootstrap-sass.rb b/lib/bootstrap-sass.rb index 38d1c8835e7d..f490f020ee31 100644 --- a/lib/bootstrap-sass.rb +++ b/lib/bootstrap-sass.rb @@ -4,6 +4,8 @@ module Bootstrap module Rails class Engine < ::Rails::Engine # Rails, will you please look in our vendor? kthx + + paths["config/initializers"] << 'lib/bootstrap-sass/config' end end end diff --git a/lib/bootstrap-sass/config/sass-ie_hex_str.rb b/lib/bootstrap-sass/config/sass-ie_hex_str.rb new file mode 100644 index 000000000000..51bb904faa77 --- /dev/null +++ b/lib/bootstrap-sass/config/sass-ie_hex_str.rb @@ -0,0 +1,14 @@ +require 'sass' + +module Sass::Script::Functions + # LARS: Snatched from compass - 2011-11-29 - used for gradients in IE6-9 + # returns an IE hex string for a color with an alpha channel + # suitable for passing to IE filters. + def ie_hex_str(color) + assert_type color, :Color + alpha = (color.alpha * 255).round + alphastr = alpha.to_s(16).rjust(2, '0') + Sass::Script::String.new("##{alphastr}#{color.send(:hex_str)[1..-1]}".upcase) + end + declare :ie_hex_str, [:color] +end \ No newline at end of file diff --git a/vendor/assets/stylesheets/bootstrap/mixins.css.scss b/vendor/assets/stylesheets/bootstrap/mixins.css.scss index b55dd764792e..054b2dee5657 100644 --- a/vendor/assets/stylesheets/bootstrap/mixins.css.scss +++ b/vendor/assets/stylesheets/bootstrap/mixins.css.scss @@ -166,7 +166,7 @@ background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+ background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10 background-image: linear-gradient(left, $startColor, $endColor); // Le standard - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1); // IE9 and down + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie_hex_str($startColor)}', endColorstr='#{ie_hex_str($endColor)}', GradientType=1); // IE9 and down } @mixin vertical-gradient($startColor: #555, $endColor: #333) { background-color: $endColor; @@ -178,7 +178,7 @@ background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+ background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10 background-image: linear-gradient(top, $startColor, $endColor); // The standard - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=0); // IE9 and down + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie_hex_str($startColor)}', endColorstr='#{ie_hex_str($endColor)}', GradientType=0); // IE9 and down } @mixin directional-gradient($startColor: #555, $endColor: #333, $deg: 45deg) { background-color: $endColor; @@ -198,7 +198,7 @@ background-image: -ms-linear-gradient($startColor, $midColor $colorStop, $endColor); background-image: -o-linear-gradient($startColor, $midColor $colorStop, $endColor); background-image: linear-gradient($startColor, $midColor $colorStop, $endColor); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie_hex_str($startColor)}', endColorstr='#{ie_hex_str($endColor)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback } // Reset filters for IE