Last active
August 29, 2015 13:57
-
-
Save hectorpalmatellez/9442370 to your computer and use it in GitHub Desktop.
Mixin para anchos condicionales a ancho del dispositivo (usando media queries)
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 tipodecelular($breakpoint, $ancho, $alto) { | |
@media screen and (max-width: $breakpoint) { | |
width: $ancho; | |
height: $alto; | |
} | |
} | |
// Teniendo algo como lo siguiente: | |
// Breakpoints | |
$break-small: 320px; | |
$break-small-medium: 480px; | |
$break-medium: 768px; | |
$break-large: 1200px; | |
//Y un elemento así: | |
.logo { | |
h1 { | |
background-color: red; | |
width: 300px; | |
height: 600px; | |
text-indent: -9999px; | |
display: block; | |
@include tipodecelular($break-small, 100px, 20px); | |
} | |
} | |
// El ancho de la imagen se ajustará cuando se llegue al ancho máximo dado por $breakpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment