@charset "utf-8"; @psd 1024; // 设计稿 尺寸 @basesize: 100; // 分为多少份 @bt: 100rem; // 换算值 @fit: 320px, 360px, 375px, 384px, 400px, 414px, 424px, 450px, 480px, 540px, 640px, 720px, 750px, 1024px, 1920px; .rtrt(@index) when (@index<=length(@fit)) { @media (min-width: extract(@fit,@index)) { html { font-size: extract(@fit,@index)/@psdwidth*@basesize; } } .rtrt(@index+1); } .rtrt(1); html, body { width: 100%; height: 100%; }