Skip to content
Permalink
Browse files

- I'm officially giving up on @Viewport support. This great little bi…

…t of CSS never took off and browser support is as obscure as ever. No need to waste time on it then. (sections.css, Class-CSS.php, index.template.php)

* Updated @Keyframes and flexbox support to remove prefixes on some browsers that were updated since the last time I looked into it. (Class-CSS.php)
  • Loading branch information...
Nao committed Oct 24, 2017
1 parent 18fd99a commit 2ebdde896079aee06076eba3a915ea46099f7472
Showing with 5 additions and 19 deletions.
  1. +4 −8 core/app/Class-CSS.php
  2. +1 −2 core/html/index.template.php
  3. +0 −9 core/skins/sections.css
@@ -1090,7 +1090,7 @@ function ($m) use ($regular_css) {
foreach ($this->rules as &$node)
{
// Is this rule actually an at-rule? They need special treatment.
if ($node['selector'][0] === '@' && stripos($node['selector'], '@viewport') !== 0)
if ($node['selector'][0] === '@')
{
if (stripos($node['selector'], '@import') === 0 || stripos($node['selector'], '@charset') === 0)
{
@@ -1702,16 +1702,12 @@ function process(&$css)
if ($b['ie'] && $v == 6)
$css = preg_replace('~\bmin-height\b~', 'height', $css);
// IE 6-9 don't support keyframes; IE 10, Firefox 16+ and Opera 12.10+ support them unprefixed, other browsers require a prefix.
if (($b['opera'] && $v < 12.1) || ($b['firefox'] && $v < 16) || $b['webkit'])
// IE 6-9 don't support keyframes; IE 10, Firefox 16+, Chrome 43+, Safari 9+ and Opera 12.10/30+ support them unprefixed, other browsers require a prefix.
if (($b['opera'] && $v > 12.1 && $v < 30) || ($b['chrome'] && $v < 43) || ($b['firefox'] && $v < 16) || ($b['safari'] && $v < 9))
$css = str_replace('@keyframes ', '@' . $this->prefix . 'keyframes ', $css);
// IE 10+ and Presto 11+ (Opera Classic) support @viewport, but prefixed. Other browsers...? No idea.
if (($b['opera'] && $v >= 11) || ($b['ie'] && $v >= 10))
$css = str_replace('@viewport', '@' . $this->prefix . 'viewport', $css);
// Chrome 21-28 and Safari 7+ support the final flexbox model... But with a prefix.
if (($b['safari'] && $v >= 7) || ($os['ios'] && $ov >= 7) || ($b['chrome'] && $v >= 21 && $v < 29))
if (($b['safari'] && $v >= 7 && $v < 9) || ($os['ios'] && $ov >= 7 && $ov < 9) || ($b['chrome'] && $v >= 21 && $v < 29))
$css = preg_replace('~\b(order|justify-content|align-(?:content|items|self)|flex(?:-[a-z]+)?)\h*:~', $this->prefix . '$1:', $css);
// IE 10 is a special case for flexboxing. It supports an older syntax, which we'll convert below,
@@ -84,8 +84,7 @@ function template_html_before()
<link rel="next" href="', $context['links']['next'], '">';
}
if (!we::is('opera[11-], ie[10-]'))
echo '
echo '
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2,minimum-scale=0.7">';
if (!empty($context['meta_description']))
@@ -1474,15 +1474,6 @@ body.waiting *
border: 1px solid #dcc
border-radius: 5px

// Old Opera and IE 10+ Mobile support a special tag that saves some HTML calls.
@if opera[11-], ie[10-]
@viewport
width: device-width
zoom: 1 // initial-scale
min-zoom: .7 // minimum-scale
max-zoom: 2 // maximum-scale
@endif

@if !ie[-7]
@media $responsive
body

0 comments on commit 2ebdde8

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