postcss-less icon indicating copy to clipboard operation
postcss-less copied to clipboard

CssSyntaxError: not support functions be called at any level

Open igauch opened this issue 3 years ago • 1 comments

As of Less 3.0, functions can return any kind of Node type, and can be called at any level. but postcss-less not support. plugin-atrules-feature

  • Node Version: v16.14.0
  • NPM Version: 8.13.2
  • postcss Version: 8.4.14
  • postcss-less Version: 6.0.0

If you have a large amount of code to share which demonstrates the problem you're experiencing, please provide a link to your repository rather than pasting code. Otherwise, please paste relevant short snippets below.

LESS

:root {
  fontSize();
}

JavaScript

    functions.add('fontSize', () => {
      return Object.entries(fontSize).reduce((prev, [key, val]) => {
        return prev + `--font-size-${key}: ${val}px;`
      }, '')
    })

Errors

Unknown word  CssSyntaxError

Expected Behavior

passed

Actual Behavior

failed

How can we reproduce the behavior?

igauch avatar Aug 22 '22 02:08 igauch

Happy to review a PR that resolves this.

shellscape avatar Aug 22 '22 02:08 shellscape