Replies: 2 comments 3 replies
-
Why not just do this? @list1:
'../images/layer1.png',
'../images/layer2.png',
'../images/layer3.png';
@list2:
'../images/layer4.png',
'../images/layer5.png',
'../images/layer6.png';
.test {
list: @list1, @list2;
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hopefully you can adapt this code to suit your needs. function ConcatPlugin() {
this.install = function (less, pluginManager) {
less.functions.functionRegistry.add('concat', function (...args) {
const context = this.context;
const values = [];
for (const arg of args) {
if (arg.value instanceof Array) {
values.push(...arg.value);
} else {
values.push(arg);
}
}
return new less.tree.Value(values);
});
};
}
module.exports = ConcatPlugin; less.render(input, {
plugins: [new ConcatPlugin()]
}).then(output => {
console.log(output.css);
});
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to add a function for concatenating lists:
What do I write in here?
Something with
return new tree.List()
? I cannot find a documentation for writing plugins.Beta Was this translation helpful? Give feedback.
All reactions