Skip to content

Commit

Permalink
Invalid set html-font-size
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 20, 2016
1 parent a256fab commit ad8bb67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/stylus-px2rem/mixins.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit ad8bb67

Please sign in to comment.