Skip to content

Instantly share code, notes, and snippets.

@Mao8a
Last active August 25, 2022 17:33
Show Gist options
  • Save Mao8a/b3e54f6d6f9f46986bc1 to your computer and use it in GitHub Desktop.
Save Mao8a/b3e54f6d6f9f46986bc1 to your computer and use it in GitHub Desktop.
SCSS: Common proportions
/*
Frequently used proportions:
Square: 1:1 -> 1 -> 100% example: 400x400px
Portrait: 4:3 -> 1.333...:1 -> 75% example: 800x600px
Divine: 5:3~ -> 1.618:1 -> 61.8% example: 1110x686px
Landscape: 16:9 -> 1.777...:1 -> 56.25% example: 1280x720px
Film A: 37:20 -> 1.85:1 -> 54.05% example: 1140x616px
Film B: 21:9 -> 2.4:1 -> 41.84% example: 1140x477px
*/
$prop-1-1: 100%;
$prop-4-3: 75%;
$prop-5-3: 61.8%;
$prop-16-9: 56.25%;
$prop-177: 54.05%;
$prop-239: 41.84%;
%square {aspect-ratio: 1/1;}
%portrait {aspect-ratio: 4/3;}
%divine {aspect-ratio: 5/3.09023486;}
%landscape {aspect-ratio: 1/1;}
%film-a {aspect-ratio: 1/1;}
%film-b {aspect-ratio: 1/1;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment