]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Reorg @viewport now that we don't need to worry about non-responsive layouts
authorChris Rebert <code@rebertia.com>
Wed, 21 Jan 2015 20:41:11 +0000 (12:41 -0800)
committerChris Rebert <code@rebertia.com>
Wed, 21 Jan 2015 21:05:14 +0000 (13:05 -0800)
docs/getting-started/support.md
scss/_scaffolding.scss
scss/_utilities-responsive.scss

index 348b1893f6fc7389440d11950e45d278fdc764b0..63667fe85d2f12b1cea52fc27ef35c22d99d6bf1 100644 (file)
@@ -128,23 +128,9 @@ This tag is included in all of Bootstrap's documentation and examples to ensure
 
 See [this StackOverflow question](http://stackoverflow.com/questions/6771258/whats-the-difference-if-meta-http-equiv-x-ua-compatible-content-ie-edge) for more information.
 
-### Internet Explorer 10 in Windows 8 and Windows Phone 8
+### Internet Explorer 10 in Windows Phone 8
 
-Internet Explorer 10 doesn't differentiate **device width** from **viewport width**, and thus doesn't properly apply the media queries in Bootstrap's CSS. Normally you'd just add a quick snippet of CSS to fix this:
-
-{% highlight scss %}
-@-ms-viewport { width: device-width; }
-{% endhighlight %}
-
-However, this doesn't work for devices running Windows Phone 8 versions older than [Update 3 (a.k.a. GDR3)](http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/10/14/introducing-windows-phone-preview-for-developers.aspx), as it causes such devices to show a mostly desktop view instead of narrow "phone" view. To address this, you'll need to **include the following CSS and JavaScript to work around the bug**.
-
-{% highlight scss %}
-@-webkit-viewport   { width: device-width; }
-@-moz-viewport      { width: device-width; }
-@-ms-viewport       { width: device-width; }
-@-o-viewport        { width: device-width; }
-@viewport           { width: device-width; }
-{% endhighlight %}
+Internet Explorer 10 in Windows Phone 8 versions older than [Update 3 (a.k.a. GDR3)](http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/10/14/introducing-windows-phone-preview-for-developers.aspx) doesn't differentiate **device width** from **viewport width** in `@-ms-viewport` at-rules, and thus doesn't properly apply the media queries in Bootstrap's CSS. To address this, you'll need to **include the following JavaScript to work around the bug**.
 
 {% highlight js %}
 if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
index a0d73be4054ed6a961a219d53f775fa3e4430ed0..038ee020b76a0973f2ba70df8c4174441d5b0f10 100644 (file)
@@ -20,6 +20,26 @@ html {
 }
 
 
+// Make viewport responsive
+//
+// @viewport is supposed to eventually replace <meta name="viewport">. It's manually prefixed for forward-compatibility.
+//
+// @viewport is also needed because IE 10+ doesn't honor <meta name="viewport"> in some cases.
+// (See http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/)
+//
+// However, `device-width` is broken on IE 10 on Windows (Phone) 8,
+// (see http://timkadlec.com/2013/01/windows-phone-8-and-device-width/
+// and https://github.com/twbs/bootstrap/issues/10497)
+// and the fix for that involves a snippet of JavaScript to sniff the user agent and apply some conditional CSS.
+// See http://getbootstrap.com/getting-started/#support-ie10-width for the relevant hack.
+
+@-moz-viewport      { width: device-width; }
+@-ms-viewport       { width: device-width; }
+@-o-viewport        { width: device-width; }
+@-webkit-viewport   { width: device-width; }
+@viewport           { width: device-width; }
+
+
 // Body reset
 
 html {
index 837cda7b9a5ea944547de83cedde88ad2aaf598e..bb8c784dbd9c220bd16f3b314a6f9fd89ae8b45c 100644 (file)
 }
 
 
-// IE10 in Windows (Phone) 8
-//
-// Support for responsive views via media queries is kind of borked in IE10, for
-// Surface/desktop in split view and for Windows Phone 8. This particular fix
-// must be accompanied by a snippet of JavaScript to sniff the user agent and
-// apply some conditional CSS to *only* the Surface/desktop Windows 8. Look at
-// our Getting Started page for more information on this bug.
-//
-// For more information, see the following:
-//
-// Issue: https://github.com/twbs/bootstrap/issues/10497
-// Docs: http://getbootstrap.com/getting-started/#support-ie10-width
-// Source: http://timkadlec.com/2013/01/windows-phone-8-and-device-width/
-// Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/
-
-@-ms-viewport {
-  width: device-width;
-}
-
-
 // Print utilities
 //
 // Media queries are placed on the inside to be mixin-friendly.