diff options
Diffstat (limited to 'less/responsive-utilities.less')
| -rw-r--r-- | less/responsive-utilities.less | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/less/responsive-utilities.less b/less/responsive-utilities.less index bf43e8ef7..4275264d9 100644 --- a/less/responsive-utilities.less +++ b/less/responsive-utilities.less @@ -5,11 +5,27 @@ // IE10 Metro responsive // Required for Windows 8 Metro split-screen snapping with IE10 +// // Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/ @-ms-viewport{ width: device-width; } +// IE10 on Windows Phone 8 +// IE10 on WP8 doesn't report CSS pixels, but actual device pixels. In +// other words, say on a Lumia, you'll get 768px as the device width, +// meaning users will see the tablet styles and not phone styles. +// +// Alternatively you can override this with JS (see source below), but +// we won't be doing that here given our limited scope. +// +// Source: http://timkadlec.com/2013/01/windows-phone-8-and-device-width/ +@media screen and (max-width: 400px) { + @-ms-viewport{ + width: 320px; + } +} + // Hide from screenreaders and browsers // Credit: HTML5 Boilerplate .hidden { @@ -19,34 +35,36 @@ // Visibility utilities -// For desktops -.visible-phone { display: none !important; } +// For Phones +.visible-phone { display: inherit !important; } .visible-tablet { display: none !important; } -.hidden-phone { } -.hidden-tablet { } -.hidden-desktop { display: none !important; } -.visible-desktop { display: inherit !important; } +.visible-desktop { display: none !important; } + +.hidden-phone { display: none !important; } +.hidden-tablet { display: inherit !important; } +.hidden-desktop { display: inherit !important; } + // Tablets & small desktops only @media (min-width: 768px) and (max-width: 979px) { - // Hide everything else - .hidden-desktop { display: inherit !important; } - .visible-desktop { display: none !important ; } - // Show + .visible-phone { display: none !important; } .visible-tablet { display: inherit !important; } - // Hide + .visible-desktop { display: none !important; } + + .hidden-phone { display: inherit !important; } .hidden-tablet { display: none !important; } + .hidden-desktop { display: inherit !important; } } -// Phones only -@media (max-width: 767px) { - // Hide everything else - .hidden-desktop { display: inherit !important; } - .visible-desktop { display: none !important; } - // Show - .visible-phone { display: inherit !important; } // Use inherit to restore previous behavior - // Hide - .hidden-phone { display: none !important; } +// For desktops +@media (min-width: 980px) { + .visible-phone { display: none !important; } + .visible-tablet { display: none !important; } + .visible-desktop { display: inherit !important; } + + .hidden-phone { display: inherit !important; } + .hidden-tablet { display: inherit !important; } + .hidden-desktop { display: none !important; } } // Print utilities @@ -56,4 +74,4 @@ @media print { .visible-print { display: inherit !important; } .hidden-print { display: none !important; } -} +}
\ No newline at end of file |
