Skip to content

Instantly share code, notes, and snippets.

@bingyalengxuan
bingyalengxuan / retina-image.less
Last active August 29, 2015 13:57
原来写的需要传递两个完整的图片URL,这次修改后,可以相对智能一些了,顺便也添加了随机串,防止浏览器缓存。
/*定义了两个不同的路径变量,和一个随机串变量*/
@base_image : "/images/" ;
@base_png : "/images/png/" ;
@img_version :201403191458;
/*只需要传递图片的名字,后缀和路径*/
.retina_images(@file_name,@file_extension,@file_url){
/*需要拼接出图片的URL*/
@image-url-1x : url("@{file_url}@{file_name}.@{file_extension}?@{img_version}");
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {