Varibles as default arguments

This commit is contained in:
jtm 2012-02-18 12:18:55 +00:00
parent a7e3040226
commit 54ea212402
4 changed files with 22 additions and 0 deletions

View File

@ -205,6 +205,7 @@ class LessParser(object):
def p_block_mixin_arg_def(self, p):
""" block_mixin_arg : less_variable ':' block_mixin_factor
| less_variable ':' less_variable
"""
p[0] = list(p)[1:4]

View File

@ -48,3 +48,9 @@ body {
.arguments2 {
border: 0px;
}
.div-a {
color: #ffffff;
}
.div-ax {
color: 10px;
}

View File

@ -11,3 +11,5 @@ body{padding:30px;color:#f00;}
#var-inside{width:10px;}
.arguments{border:1px solid black;}
.arguments2{border:0px;}
.div-a{color:#ffffff;}
.div-ax{color:10px;}

View File

@ -108,3 +108,16 @@ body {
.arguments2 {
.mixin-arguments();
}
//
// Variable argument
//
@var: #aaa;
.var-arg(@color: @var) {
color: @color;
}
.div-a {
.var-arg(#fff);
}
.div-ax {
.var-arg();
}