Fallback to blocks from deferred calls
This commit is contained in:
@@ -54,17 +54,25 @@ class Deferred(Node):
|
||||
break
|
||||
scope.deferred.parsed[-1].pop()
|
||||
scope.deferred.parsed[-1] = store
|
||||
|
||||
if not mixins:
|
||||
# Fallback to blocks
|
||||
block = scope.blocks(ident.raw())
|
||||
if block:
|
||||
res = block.copy_inner(scope)
|
||||
|
||||
if mixins:
|
||||
for mixin in mixins:
|
||||
res = mixin.call(scope, args)
|
||||
if res: break
|
||||
if res:
|
||||
[scope.add_variable(v) for v in mixin.vars]
|
||||
scope.deferred = ident
|
||||
if res:
|
||||
[scope.add_variable(v) for v in mixin.vars]
|
||||
scope.deferred = ident
|
||||
break
|
||||
|
||||
if res:
|
||||
res = [p.parse(scope) for p in res if p]
|
||||
while(any(t for t in res if type(t) is Deferred)):
|
||||
res = [p.parse(scope) for p in res if p]
|
||||
while(any(t for t in res if type(t) is Deferred)):
|
||||
res = [p.parse(scope) for p in res if p]
|
||||
|
||||
if error and not res:
|
||||
raise SyntaxError('NameError `%s`' % mixin.raw(True))
|
||||
|
||||
@@ -86,3 +86,18 @@ div.nest a:hover .deep p, div.nest a:focus .deep p {
|
||||
padding: 3px;
|
||||
padding: 3px;
|
||||
}
|
||||
.clear {
|
||||
padding: -100px;
|
||||
}
|
||||
.clear:before {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
.fallback {
|
||||
margin: 2px;
|
||||
padding: -100px;
|
||||
}
|
||||
.fallback:before {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
4
lesscpy/test/css/mixin-blocks.min.css
vendored
4
lesscpy/test/css/mixin-blocks.min.css
vendored
@@ -25,3 +25,7 @@ div.nest a:hover .deep p,div.nest a:focus .deep p{widows:3;}
|
||||
.secure-zone{color:transparent;}
|
||||
.outer .inner{padding:3px;}
|
||||
.tx{padding:3px;padding:3px;}
|
||||
.clear{padding:-100px;}
|
||||
.clear:before{display:table;content:"";}
|
||||
.fallback{margin:2px;padding:-100px;}
|
||||
.fallback:before{display:table;content:"";}
|
||||
|
||||
@@ -105,4 +105,18 @@ div.nest {
|
||||
.outer .inner;
|
||||
// Same
|
||||
.outer > .inner;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Fallbacks
|
||||
//
|
||||
.clear {
|
||||
padding: -100px;
|
||||
&:before {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
.fallback {
|
||||
margin: 2px;
|
||||
.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user