Skip to content

Instantly share code, notes, and snippets.

@christophemarois
Last active December 17, 2015 18:49
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 christophemarois/9a964fe7f4f619a5fe75 to your computer and use it in GitHub Desktop.
Save christophemarois/9a964fe7f4f619a5fe75 to your computer and use it in GitHub Desktop.
.viewportRatio(@x, @y) {
width: 100vw;
height: @y * 100vw / @x;
max-width: @x / @y * 100vh;
max-height: 100vh;
}
.first {
.viewportRatio(5, 1);
background-color: blue;
margin: 0;
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment