Journal entries tagged “Media Queries”
Breakpoint Helper with SASS/SCSS
February 17, 2015
When I’m building a new site, I usually spend a fair amount of time showing and hiding things at various breakpoints. This code defines the major breakpoints in use, then prints out a bunch of helper classes to make the showing/hiding easier. First create a sass map of all the breakpoints. $breakpoints: ( small:550px, medium:800px, […]
Javascript Media Query Hack
December 2, 2014
I’ve seen this somewhere before… HTML <span id=”smScreenIndicator”></span> CSS #smScreenIndicator { float: left; } @media (min-width: 400px) { /* whatever width suits the project */ #smScreenIndicator { float: none; } } JQuery function isMobile() { if ( $(‘#smScreenIndicator’).css(‘float’) == ‘left’ ) return true; else return false; }