Skip to content

Instantly share code, notes, and snippets.

@pongstr
Last active February 5, 2020 09:02
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 pongstr/42b10eea817db96f18f0f1d1e60eaafd to your computer and use it in GitHub Desktop.
Save pongstr/42b10eea817db96f18f0f1d1e60eaafd to your computer and use it in GitHub Desktop.
Utilized for divs with background image that scales
// #==
// 4:3 Aspect Ratio
@mixin box-ratio-calc($width: ""){
@if ($width == "") {
width: 185px;
height: 118px;
} @else {
width: $width;
height: ($width / 4) * 3;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment