MCPcopy
hub / github.com/less/less.js / styleExpression

Function styleExpression

packages/less/lib/less/functions/style.js:5–16  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

3
4/** @param {*[]} args */
5const styleExpression = function (args) {
6 args = Array.prototype.slice.call(args);
7 if (args.length === 0) {
8 throw { type: 'Argument', message: 'one or more arguments required' };
9 }
10
11 const entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)];
12
13 const result = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');
14
15 return new Anonymous(`style(${result})`);
16};
17
18export default {
19 /** @param {...*} args */

Callers

nothing calls this directly

Calls 5

callMethod · 0.80
mapMethod · 0.80
joinMethod · 0.65
evalMethod · 0.45
toCSSMethod · 0.45

Tested by

no test coverage detected