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