em / rem fixing

This commit is contained in:
Raphael Goetter 2014-05-03 12:38:15 +02:00
parent 03f6bb2263
commit 5fbfa64a19
2 changed files with 9 additions and 10 deletions

View File

@ -53,15 +53,14 @@
@gutter : 20px; // gutter value (%, px, em, rem) for grid layouts
// LESS mixins : don't touch or you'll be banned ;)
// px to em/rem
.rem(@size, @bf: @basefont){
@rem: @size / 10;
font-size: @basefont * @size / 10;
@rem: @size;
font-size: unit(round(@basefont * @size), px);
font-size: unit(@rem, rem);
}
.em(@size, @bf: @basefont){
@em: @size / @bf;
font-size: unit(@em, em);
font-size: unit(round(@em,2), em);
}

View File

@ -84,22 +84,22 @@ hgroup {
line-height: @lh;
}
h1, .h1-like {
.rem(@h1-size);
.rem(@h1-size / 10);
}
h2, .h2-like {
.rem(@h2-size);
.rem(@h2-size / 10);
}
h3, .h3-like {
.rem(@h3-size);
.rem(@h3-size / 10);
}
h4, .h4-like {
.rem(@h4-size);
.rem(@h4-size / 10);
}
h5, .h5-like {
.rem(@h5-size);
.rem(@h5-size / 10);
}
h6, .h6-like {
.rem(@h6-size);
.rem(@h6-size / 10);
}
/* alternate font-sizing */