Created
May 5, 2017 20:43
-
-
Save patrykgruszka/db35f42374ec1e05be4ab994b8e1ccc0 to your computer and use it in GitHub Desktop.
Scss mixin for responsive backgrounds (Bootstrap 3)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin responsive-background($img: 'img', $ext: 'jpg') { | |
background-image: url("#{$img}-xs.#{$ext}"); | |
@media(min-width: $screen-sm-min) { | |
background-image: url("#{$img}-sm.#{$ext}"); | |
} | |
@media(min-width: $screen-md-min) { | |
background-image: url("#{$img}-md.#{$ext}"); | |
} | |
@media(min-width: $screen-lg-min) { | |
background-image: url("#{$img}-lg.#{$ext}"); | |
} | |
@media(min-width: 1600px) { | |
background-image: url("#{$img}-xl.#{$ext}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment