Created
June 24, 2014 00:29
-
-
Save Elbone/e5b79f02d7e77851aca5 to your computer and use it in GitHub Desktop.
metaQuery custom prefix example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <!-- | |
| Thanks NASA. http://www.jpl.nasa.gov/spaceimages/details.php?id=PIA12765 | |
| --> | |
| <head> | |
| <meta name="breakpoint-prefix" content="@media-"> | |
| <meta name="breakpoint" content="phone" media="(max-width: 480px)"> | |
| <meta name="breakpoint" content="small-tablet" media="(min-width: 480px) and (max-width: 600px)"> | |
| <meta name="breakpoint" content="tablet" media="(min-width: 600px) and (max-width: 1024px)"> | |
| <meta name="breakpoint" content="widescreen" media="(min-width: 1024px)"> | |
| <script src="./vendor/modernizr.js"></script> | |
| <style> | |
| body { background-size: cover; margin: 0; padding: 0; } | |
| .\@media-phone body { background-color: red; } | |
| .\@media-small-tablet body { background-color: yellow; } | |
| .\@media-tablet body { background-color: green;} | |
| .\@media-widescreen body { background-color: lime; } | |
| </style> | |
| </head> | |
| <body> | |
| <script> | |
| Modernizr.load([ | |
| { | |
| test: (!!window.matchMedia), | |
| nope: ['./vendor/matchMedia-oldie.js'] | |
| }, | |
| { | |
| load: './metaquery.js' | |
| } | |
| ]); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment