ndalpe
6/30/2015 - 9:19 AM

#font utilities

#font utilities

// .size        : convert the given size to its em equivalent
// .family      : output font-family, font-weight and, if true, the default letter spacing
// .line-height : convert leading Photoshop value into em
#font {

	.size ( @target: unit(@font-size-base) ) {
		font-size: (@target / unit(@font-size-base)) + 0em;
	}

	.family(@font, @weight:400, @kerning:true) {
		font-family: @font, sans-serif;
		font-weight: @weight;
		& when (@kerning = true) {
			& when (@weight = 600) {
				letter-spacing: 0.04em;
			}
			& when (@weight = 700) {
				letter-spacing: 0.025em;
			}
		}
	}

	.line-height(@leading) {
		line-height: (@leading/unit(@font-size-base)) + 0em;
	}
}