Skip to content

Commit 4eafd3d

Browse files
committed
Handle single-version browser ranges. Closes Compass#1853.
1 parent 595f075 commit 4eafd3d

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

core/stylesheets/compass/_support.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ $css-sel2-support-threshold: $critical-usage-threshold !default;
275275
$old-range: map-get($ranges, $browser);
276276
@if $old-range {
277277
$old-min: nth($old-range, 1);
278-
$old-max: nth($old-range, 2);
278+
$old-max: if(length($old-range) == 1, $old-min, nth($old-range, 2));
279279
$new-min: nth($new-range, 1);
280-
$new-max: nth($new-range, 2);
280+
$new-max: if(length($new-range) == 1, $new-min, nth($new-range, 2));
281281
$maximin: if(compare-browser-versions($browser, $old-min, $new-min) > 0,
282282
$old-min, $new-min);
283283
$minimax: if(compare-browser-versions($browser, $old-max, $new-max) < 0,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.use-case {
2+
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmMDAwMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDBmZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
3+
background-size: 100%;
4+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ff0000), color-stop(100%, #0000ff));
5+
background-image: -moz-linear-gradient(#ff0000, #0000ff);
6+
background-image: -webkit-linear-gradient(#ff0000, #0000ff);
7+
background-image: linear-gradient(#ff0000, #0000ff); }
8+
9+
.simple {
10+
content: (ie: "9" "9"); }
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import "compass/support";
2+
@import "compass/css3/images";
3+
4+
// An actual use-case that demonstrates the problem
5+
.use-case {
6+
@include with-browser-ranges(css-mediaqueries) {
7+
@include background-image(linear-gradient(red, blue));
8+
}
9+
}
10+
11+
// A simplification of the issue
12+
$ranges: (ie: "9" "11");
13+
$new-ranges: (ie: "9");
14+
.simple {
15+
content: inspect(intersect-browser-ranges($ranges, $new-ranges));
16+
}

0 commit comments

Comments
 (0)