Skip to content

Instantly share code, notes, and snippets.

@chsh
Created February 24, 2017 01:16
Show Gist options
  • Save chsh/4f420474e5ca4dd0b4fe742d5457ae6b to your computer and use it in GitHub Desktop.
Save chsh/4f420474e5ca4dd0b4fe742d5457ae6b to your computer and use it in GitHub Desktop.
Responsive Media Queries example from "bulma"
// Responsiveness
$tablet: 769px !default
// 960px container + 40px
$desktop: 1000px !default
// 1152px container + 40
$widescreen: 1192px !default
// 960 and 1152 have been chosen because
// they are divisible by both 12 and 16
=from($device)
@media screen and (min-width: $device)
@content
=until($device)
@media screen and (max-width: $device - 1px)
@content
=mobile
@media screen and (max-width: $tablet - 1px)
@content
=tablet
@media screen and (min-width: $tablet)
@content
=tablet-only
@media screen and (min-width: $tablet) and (max-width: $desktop - 1px)
@content
=touch
@media screen and (max-width: $desktop - 1px)
@content
=desktop
@media screen and (min-width: $desktop)
@content
=desktop-only
@media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
@content
=widescreen
@media screen and (min-width: $widescreen)
@content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment