Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-sass.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2013-11-15 01:30:59 +0400
committerGleb Mazovetskiy <glex.spb@gmail.com>2013-11-15 01:30:59 +0400
commit8c7b1a9f3876b3f064b5d8c4baa40002756fe1f0 (patch)
tree5844eb7bf43ec73e61443621eacf6ae6f9d3932a
parentc58415eef00a708b25f6f7ee32573de038be4a50 (diff)
ie-hex-str
-rw-r--r--lib/bootstrap-sass/sass_functions.rb19
-rw-r--r--tasks/converter/less_conversion.rb2
-rw-r--r--vendor/assets/stylesheets/bootstrap/_mixins.scss8
3 files changed, 14 insertions, 15 deletions
diff --git a/lib/bootstrap-sass/sass_functions.rb b/lib/bootstrap-sass/sass_functions.rb
index ce1eda68..cca2489b 100644
--- a/lib/bootstrap-sass/sass_functions.rb
+++ b/lib/bootstrap-sass/sass_functions.rb
@@ -24,17 +24,16 @@ module Sass::Script::Functions
Sass::Script::String.new(url, :string)
end
declare :twbs_asset_path, [:source]
-
- # 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 twbs_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)
+
+ unless Sass::Script::Functions.instance_methods.include?(:ie_hex_str)
+ # polyfill sass < 3.2.6 (taken from sass 3.2.12):
+ def ie_hex_str(color)
+ assert_type color, :Color, :color
+ alpha = (color.alpha * 255).round.to_s(16).rjust(2, '0')
+ Sass::Script::String.new("##{alpha}#{color.send(:hex_str)[1..-1]}".upcase)
+ end
+ declare :ie_hex_str, [:color]
end
- declare :twbs_ie_hex_str, [:color]
protected
diff --git a/tasks/converter/less_conversion.rb b/tasks/converter/less_conversion.rb
index 725a32fc..131bf235 100644
--- a/tasks/converter/less_conversion.rb
+++ b/tasks/converter/less_conversion.rb
@@ -355,7 +355,7 @@ class Converter
log_transform
file.gsub(
/filter: e\(%\("progid:DXImageTransform.Microsoft.gradient\(startColorstr='%d', endColorstr='%d', GradientType=(\d)\)",argb\(([\-$\w]+)\),argb\(([\-$\w]+)\)\)\);/,
- %Q(filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='\#{twbs-ie-hex-str(\\2)}', endColorstr='\#{twbs-ie-hex-str(\\3)}', GradientType=\\1);)
+ %Q(filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='\#{ie-hex-str(\\2)}', endColorstr='\#{ie-hex-str(\\3)}', GradientType=\\1);)
)
end
diff --git a/vendor/assets/stylesheets/bootstrap/_mixins.scss b/vendor/assets/stylesheets/bootstrap/_mixins.scss
index 4ca16a7e..443c97e9 100644
--- a/vendor/assets/stylesheets/bootstrap/_mixins.scss
+++ b/vendor/assets/stylesheets/bootstrap/_mixins.scss
@@ -282,7 +282,7 @@
background-image: -moz-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{twbs-ie-hex-str($start-color)}', endColorstr='#{twbs-ie-hex-str($end-color)}', GradientType=1); // IE9 and down
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
}
// Vertical gradient, from top to bottom
@@ -295,7 +295,7 @@
background-image: -moz-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{twbs-ie-hex-str($start-color)}', endColorstr='#{twbs-ie-hex-str($end-color)}', GradientType=0); // IE9 and down
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
}
@mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
@@ -310,7 +310,7 @@
background-image: -moz-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
background-repeat: no-repeat;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{twbs-ie-hex-str($start-color)}', endColorstr='#{twbs-ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback
}
@mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
background-image: -webkit-gradient(linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
@@ -318,7 +318,7 @@
background-image: -moz-linear-gradient(top, $start-color, $mid-color $color-stop, $end-color);
background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
background-repeat: no-repeat;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{twbs-ie-hex-str($start-color)}', endColorstr='#{twbs-ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
}
@mixin gradient-radial($inner-color: #555, $outer-color: #333) {
background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($inner-color), to($outer-color));