I want to setup a dynamic font-size counted from rem value for all my headers and I want to do this in for loop. My problem is that I don't know how to divide number to get this result:
- H1 : 40px (2 rem)
- H2 : 32px (1.51572rem)
- H3 : 26,3902px (1.31951rem)
- H4 : 20px (1 rem)
For loop:
@for $i from 1 through 6 {
h#{$i} {
margin-bottom: 1.4rem;
line-height: (2.8rem / 1.33333333333);
font: {
size: 3.2rem - ($i * 0.8);
family: $header-font;
}
}
}