标签:原创 后缀 嵌套 osi 样式 button blog 避免 bundle
<link rel="stylesheet/less" type="text/css" href="styles.less" /> <script src="less.js" type="text/javascript"></script>
@body_width:300px; body{width:@body_width;}
.border{ border:1px solid red; } .box{ width:30px; hight:30px; .border; }
.border(@color){ border:1px solid @color; } .box{ width:30px; hight:30px; .border(red); }
.border(@color:red){ border:1px solid @color; } .box{ width:30px; hight:30px; .border(green); }
//绝对定位 .pox(a){position:absolute;} //相对定位 .pox(r){position:relative;} //固定定位 .pox(f){position:fixed;} //所有的pox方法都要引入的css属性 .pox(@_){width:20px;} //混合 .box{ .pox(r); } //输出的css: .box { position: relative; width: 20px; }
@width:300px; .body{ width: (@width - 20)*5;// 注意(@width - 20)减号之间要有空格 }
#header { color: black; } #header .navigation {font-size: 12px;} #header .logo { width: 300px; } #header .logo:hover {text-decoration: none;}
#header { color: black; .navigation { font-size: 12px; } .logo { width: 300px; &:hover { text-decoration: none } } }
.border_arg (@w:30px,@c:red,@xx:solid){ border:@arguments;//等价于border:@w @c @xx; }
.test_03{ width:~’calc(300px -30px)’; }
.test_Important{ .border_redius() !important; }
#bundle { .button () { display: block; border: 1px solid black; background-color: grey; &:hover { background-color: white } } .tab { ... } .citation { ... } }
#header a { color: orange; #bundle > .button; }
@var: red; #page { @var: white; #header { color: @var; // white } } #footer { color: @var; // red }
@import "lib.less";
@import "lib";
@import "lib.css";
@base-url: "http://assets.fnord.com"; background-image: url("@{base-url}/images/bg.png");
精品原创,谢谢打赏...
标签:原创 后缀 嵌套 osi 样式 button blog 避免 bundle
原文地址:http://www.cnblogs.com/yysbolg/p/6703049.html