Skip to content

Instantly share code, notes, and snippets.

@wangqs1990
wangqs1990 / px2rem.mixin.less
Created May 17, 2016 08:27
less px2rem function
@base-font-size: 100;
.rem (@property; @values...) {
// This is a workaround, inspired by https://github.com/borodean/less-properties
@{property}: ~`(function () {
var baseFontSize=@{base-font-size};
var sizeList = @{values};
if (!Array.isArray(sizeList)) {
sizeList = [sizeList];
}