Skip to content

timbaas/aspect-ratio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Easy Aspect Ratios with SCSS

How to use:

Import the SCSS file:
@import "aspect-ratio";
Adjust your HTML:
<div class="aspect ratio-16-9">
  <div class="aspect-inner">
    Content
  </div>
</div>

Available ratios:

.ratio-1-1    // 1:1
.ratio-1-2    // 1:2
.ratio-2-1    // 2:1
.ratio-4-3    // 4:3
.ratio-16-9   // 16:9

Customize:

You can add ratios by editing the $ratios variable in the file, or specify your own $ratios variable before @import:

$ratios: 3 4, 16 10;

About

SCSS Aspect Ratios

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages