!(function(doc, win) {
var pixclPatio = 1 / win.devicePixelRatio;
doc.write('<meta name="viewport" content="width=device-width,initial-scale='+pixclPatio+',minimum-scale='+pixclPatio+',maximum-scale='+pixclPatio+',user-scalable=no" />');
var docEle = doc.documentElement,evt = "onorientationchange" in window ? "orientationchange" : "resize",
fnLoad = function() {
var docWidth = docEle.clientWidth;
docWidth && (docEle.style.fontSize = docWidth / 16 + "px");
};
win.addEventListener(evt,fnLoad, false);
doc.addEventListener("DOMContentLoaded",fnLoad, false);
}(document, window));
@function toRem($n) {
$base-fontSize: 45 !default;
$len: length($n);
$remValues: ();
@if $len == 1 {
@return append($remValues, ($n / $base-fontSize) * 1rem);
}
@for $i from 1 through $len {
$remValues: append($remValues, (nth($n, $i) / $base-fontSize) * 1rem);
}
@return $remValues;
}
@function toRem($n) {
$base-fontSize: 45 !default;
$len: length($n);
$remValues: ();
@if $len == 1 {
@if type-of( $n ) == number{
@return append($remValues, ($n / $base-fontSize) * 1rem);
}@else{
@return append($remValues, unquote($n));
}
}
@for $i from 1 through $len {
@if type-of( nth($n, $i) ) == number{
$remValues: append($remValues, (nth($n, $i) / $base-fontSize) * 1rem);
}@else{
$remValues: append($remValues, unquote(nth($n, $i)) );
}
}
@return $remValues;
}