Created
December 10, 2015 02:41
-
-
Save laziel/2e8b545023b47ce14cd2 to your computer and use it in GitHub Desktop.
css variables
This file contains 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
$a: 4; | |
$b: 3; | |
.slide { | |
position: absolute; | |
top: 0; | |
left: calc(50vw - #{$a/$b/2*100vh}); | |
width: $a/$b*100vh; | |
height: 100vh; | |
@media (max-aspect-ratio: #{$a}/#{$b}) { | |
top: calc(50vh - #{$b/$a/2*100vw}); | |
left: 0; | |
width: 100vw; | |
height: $b/$a*100vw; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment