Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@laziel
Created December 10, 2015 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laziel/2e8b545023b47ce14cd2 to your computer and use it in GitHub Desktop.
Save laziel/2e8b545023b47ce14cd2 to your computer and use it in GitHub Desktop.
css variables
$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