Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Calc" with capital C with variable inside - breaks: "Undefined operation" #3143

Open
yairEO opened this issue Jan 3, 2021 · 0 comments
Open

Comments

@yairEO
Copy link

yairEO commented Jan 3, 2021

Couldn't find a similar issue in the issues page or Google:

The below appear to break node-sass, only if a variable (custom property) exists inside the Calc (capital C).

a{ top: Calc(var(--foo) * 2) }
> node-sass --output-style compressed -o ./ foo.scss

{
  "status": 1,
  "file": "C:/projects/test/foo.scss",
  "line": 1,
  "column": 14,
  "message": "Undefined operation: \"var(--foo) times 2\".",
  "formatted": "Error: Undefined operation: \"var(--foo) times 2\".\n        on line 1 of ui-range.scss\n>> a{ top: Calc(var(--foo) * 2) }\n   -------------^\n"
}

I would expect node-sass to ignore casing of Calc or any known CSS keyword that is capitalized in order to make sure the SASS compiler would not treat it as SCSS in case the same keyword also exists in SCSS-world.

I've tested on sassmeister.com and it works as expected.

  • NPM version: 7.0.15
  • Node version: v15.4.0
  • Node Process:
{
  node: '15.4.0',
  v8: '8.6.395.17-node.22',
  uv: '1.40.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.16.1',
  modules: '88',
  nghttp2: '1.41.0',
  napi: '7',
  llhttp: '2.1.3',
  openssl: '1.1.1g',
  cldr: '38.0',
  icu: '68.1',
  tz: '2020b',
  unicode: '13.0'
}
  • Node Platform: win32
  • Node architecture: x64
  • node-sass version:
node-sass       5.0.0   (Wrapper)       [JavaScript]
libsass         3.5.5   (Sass Compiler) [C/C++]
  • npm node-sass versions: node-sass@5.0.0
@nschonni nschonni transferred this issue from sass/node-sass Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants