Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scottjehl/323136 to your computer and use it in GitHub Desktop.
Save scottjehl/323136 to your computer and use it in GitHub Desktop.
//EnhanceJS (enhancejs.googlecode.com)
//Quick idea for loading CSS depending on Screen resolution with EnhanceJS.
//Smart phones that pass capabilities tests would get mobile.css
//enhance page based on capabilities and serve different CSS based on screen resolution
enhance({
loadStyles: screen.availWidth < 500 ? ['css/mobile.css'] : ['css/screen.css']
});
/*
result:
- newer desktop browsers get screen.css
- iPhone gets mobile.css.
- older browsers, bag phones get basic.css
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment