Skip to content

Instantly share code, notes, and snippets.

@timiles
Created May 29, 2012 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timiles/2829059 to your computer and use it in GitHub Desktop.
Save timiles/2829059 to your computer and use it in GitHub Desktop.
nice css snippets
/*-- 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