Skip to content
Permalink
Browse files

* Updated Wess to remove prefixes from more modern browsers. (Class-C…

…SS.php)

* Details: Android 4+ browser supports box-shadow unprefixed; Firefox 29+ supports box-sizing unprefixed; Firefox 43+ supports hyphens unprefixed; Firefox 65+ supports column breaks unprefixed; Safari 9+ (also on iOS) supports flex unprefixed. Data courtesy of caniuse.com, as usual. Well, if I had a way to check these things automatically, that'd be nice...
  • Loading branch information...
Nao committed Jul 2, 2019
1 parent 8b92ee8 commit 4b83267768fe881856200653c8969c3d5752b374
Showing with 8 additions and 8 deletions.
  1. +8 −8 core/app/Class-CSS.php
@@ -364,7 +364,7 @@ function process(&$css)
that can be queried with we::is(). Like this:
$variable = "rgba(2,4,6,.5)";
$variable {ie6,ie7,ie8} = rgb(1,2,3);
$variable {ie10,firefox3} = rgb(1,2,3);
The only reason we're not accepting ":" in declarations is that
we want to be able to do this: (Check the last line carefully)
@@ -1475,17 +1475,17 @@ private function fix_rules($matches)
return '';
if (($firefox && $v < 4) || ($ios && $ov < 5) || ($safari && $v < 5.1))
return $prefixed;
if ($android)
if ($android && $v < 4)
return $both;
return $unchanged;
}
// IE6 and IE7 don't support box-sizing, while Mozilla (as of February 2017!), and older Androids and Safaris require a prefix.
// IE6 and IE7 don't support box-sizing, while older Mozillas, Androids and Safaris require a prefix.
if ($matches[1] === 'box-sizing')
{
if ($ie && $v < 8)
return '';
if ($firefox || ($ios && $ov < 5) || ($safari && $v < 5.1) || ($android && $ov < 4))
if (($firefox && $v < 29) || ($ios && $ov < 5) || ($safari && $v < 5.1) || ($android && $ov < 4))
return $prefixed;
return $unchanged;
}
@@ -1503,7 +1503,7 @@ private function fix_rules($matches)
{
if ($ie8down || $ie9 || ($firefox && $v < 3.6) || ($opera && $v < 11.1))
return '';
return $opera || ($ie && $v >= 10) ? $unchanged : $this->prefix . 'column-' . $unchanged;
return $opera || ($firefox && $v >= 65) || ($ie && $v >= 10) ? $unchanged : $this->prefix . 'column-' . $unchanged;
}
// As of April 2014, IE10+, Firefox and WebKit support this prefixed (unprefixed for Chrome 54+). Opera<14 and IE<10 don't.
@@ -1558,7 +1558,7 @@ private function fix_rules($matches)
if (strpos($matches[1], 'hyphens') === 0)
{
if (($chrome && !$operium && $v >= 55) || ($safari && $v > 5) || $firefox || ($ie && $v >= 10))
return $prefixed;
return $chrome || ($firefox && $v >= 43) ? $unchanged : $prefixed;
return '';
}
@@ -1611,8 +1611,8 @@ private function fix_values($matches)
return $unchanged;
}
// The final flexbox model (Chrome 21+, Opera 12.1, IE11+, Safari 7+) is final, as the name says, and shouldn't require a prefix. Silly WebKit...
if ((($b['safari'] && $v >= 7) || ($os['ios'] && $ov >= 7) || ($b['chrome'] && $v >= 21 && $v < 29)) && strpos($matches[1], 'flex') !== false)
// The final flexbox model (Chrome 21+, Opera 12.1, IE11+, Safari 7+) is final, as the name says, and shouldn't require a prefix. WebKit was a bit slow to react.
if ((($b['safari'] && $v >= 7 && $v < 9) || ($os['ios'] && $ov >= 7 && $ov < 9) || ($b['chrome'] && $v >= 21 && $v < 29)) && strpos($matches[1], 'flex') !== false)
return str_replace(['inline-flex', 'flex'], [$this->prefix . 'inline-flex', $this->prefix . 'flex'], $unchanged);
// There's a need for min/max-resolution to be rewritten for some browsers.

0 comments on commit 4b83267

Please sign in to comment.
You can’t perform that action at this time.