forked from michaeltaranto/basekick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mixin.less
23 lines (19 loc) · 939 Bytes
/
mixin.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.basekick(@bk-type-size-modifier; @bk-type-row-span; @bk-descender-height-scale; @sk-base-font-size; @bk-grid-row-height; @bk-line-height-override: false) {
font-size: unit(@bk-type-size-modifier * @sk-base-font-size, px);
.calculate-line-height-as-scale(@line-height) {
@line-height-scale: (@line-height / (@bk-type-size-modifier * @sk-base-font-size));
line-height: unit(@line-height-scale, em);
}
.calculate-type-offset(@line-height-scale) {
@offset: ((@line-height-scale - 1) / 2) + @bk-descender-height-scale;
transform: translateY(unit(@offset, em));
}
& when not (isNumber(@bk-line-height-override)) {
.calculate-line-height-as-scale((@bk-type-row-span * @bk-grid-row-height));
.calculate-type-offset(@line-height-scale);
}
& when (isNumber(@bk-line-height-override)) {
.calculate-line-height-as-scale(@bk-line-height-override);
.calculate-type-offset(@line-height-scale);
}
};