Created
May 29, 2012 15:27
-
-
Save timiles/2829059 to your computer and use it in GitHub Desktop.
nice css snippets
This file contains 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
/*-- js/nojs with Modernizr --*/ | |
html.js .js-hide, .no-js-hide | |
{ | |
display: none; | |
} | |
html.js .no-js-hide | |
{ | |
display: inherit; | |
} | |
/*-- to detect mobile size in js --*/ | |
/* credit: http://bricss.net/post/22198838298/easily-checking-in-javascript-if-a-css-media-query-has */ | |
@media (max-width: 767px) | |
{ | |
body:after | |
{ | |
content: 'mobile'; | |
display: none; | |
} | |
} | |
/* | |
function isMobileSize() { | |
var size = window.getComputedStyle(document.body, ':after').getPropertyValue('content'); | |
return size.indexOf('mobile') != -1; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment