Varibles as default arguments
This commit is contained in:
parent
a7e3040226
commit
54ea212402
@ -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]
|
||||
|
||||
|
@ -48,3 +48,9 @@ body {
|
||||
.arguments2 {
|
||||
border: 0px;
|
||||
}
|
||||
.div-a {
|
||||
color: #ffffff;
|
||||
}
|
||||
.div-ax {
|
||||
color: 10px;
|
||||
}
|
||||
|
2
lesscpy/test/css/mixins-args.min.css
vendored
2
lesscpy/test/css/mixins-args.min.css
vendored
@ -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;}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user