From ad8bb67bb4087c6e05c81aa037342ca300d0d00b Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Wed, 21 Dec 2016 00:52:12 +0800 Subject: [PATCH] Invalid set html-font-size --- lib/stylus-px2rem/mixins.styl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/stylus-px2rem/mixins.styl b/lib/stylus-px2rem/mixins.styl index d62a6e2..e088597 100644 --- a/lib/stylus-px2rem/mixins.styl +++ b/lib/stylus-px2rem/mixins.styl @@ -3,8 +3,9 @@ 兼容报告: http://caniuse.com/#feat=rem 设置html的字体大小 font-size =10px 那么此时 1rem = 10px + 小于 12px 或者 75% 的字体大小 rem 确实不支持这种换算 */ -html-font-size ?= 10px; +html-font-size ?= 16px; // style-names ?= width height min-height max-height min-width max-width border margin margin-top margin-bottom margin-left margin-right padding padding-left padding-right padding-bottom padding-top line-height; style-names ?= "min-height" "max-height" "min-width" "max-width" "width" "height" "border" "margin" "margin-top" "margin-bottom" "margin-left" "margin-right" "padding" "padding-left" "padding-right" "padding-bottom" "padding-top" "line-height" // value less then ignore_limit will be ignored and return the original value @@ -20,9 +21,9 @@ px2rem(prop,values){ if(abs(value) <= px2rem_ignore_limit){ value-rem = value; }else if(!need_normalize){ - value-rem = unit(value / 16,'rem'); - }else{ value-rem = unit(value / html-font-size,'rem'); + }else{ + value-rem = unit(value ,'rem'); } push(values-rem,value-rem) } else {