DEV Community

Discussion on: 10 Awesome SASS (SCSS) Mixins

Collapse
ronakjethwa profile image
Ronak Jethwa

How about these for the font-sizes?

$font-sizes: [20px, 22px, 24px, 26px, 28px, 30px, 36px, 40px, 50px];
@each $size in $font-sizes {
  .is-#{$size} {
    font-size: $size;

    @if $size > 35 {
      line-height: $size - 5px;
    }
  }
}
Enter fullscreen mode Exit fullscreen mode