//适配主流设备十几种 @adapterDeviceList:750px,720px,640px,540px,480px,424px,414px,400px,384px,375px,360px,320px; //设计稿尺寸 @psdWidth:750px; //预设基准值 @baseFontSize:100px; //设备的种类 @len:length(@adapterDeviceList); //适配函数 .adapterMixin(@index) when ( @index > 0){ @media (min-width: extract(@adapterDeviceList,@index)){ html{ font-size: @baseFontSize / @psdWidth * extract(@adapterDeviceList,@index); } } .adapterMixin( @index - 1); }