Skip to content

Commit 1545a89

Browse files
committed
增加$rem方法,px转rem的万金油(这个方法不能保留原有单位)
1 parent f32ce39 commit 1545a89

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/util.styl

+4-3
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ $width-rem(){
130130
}
131131
//rem万金油
132132
$rem(){
133-
if $original-size{
134-
width:arguments;
133+
val = ''
134+
for n in arguments {
135+
val = val+ unit(n /$default-font-size, rem) + ' '
135136
}
136-
return unit(arguments /$default-font-size, rem)
137+
return s(val)
137138
}

0 commit comments

Comments
 (0)