Skip to content

Instantly share code, notes, and snippets.

@dhruvparmar372
Created April 5, 2014 05:22
Show Gist options
  • Save dhruvparmar372/9987808 to your computer and use it in GitHub Desktop.
Save dhruvparmar372/9987808 to your computer and use it in GitHub Desktop.
Useful Scss Mixin for setting property values dependent on screen width
@mixin property-responsive($property,$small,$medium,$large,$xlarge,$xxlarge:""){
@media (max-width:$small-max-width){ #{$property}: $small; }
@media (min-width:$medium-min-width) and (max-width:$medium-max-width){ #{$property}: $medium; }
@media (min-width:$large-min-width) and (max-width:$large-max-width){ #{$property}: $large; }
@media (min-width:$xlarge-min-width) and (max-width:$xlarge-max-width) { #{$property}: $xlarge; }
@media (min-width:$xxlarge-min-width) { #{$property}: $xxlarge; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment