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

Invalid calc() crashes #626

Closed
atirip opened this issue Nov 14, 2023 · 1 comment
Closed

Invalid calc() crashes #626

atirip opened this issue Nov 14, 2023 · 1 comment

Comments

@atirip
Copy link

atirip commented Nov 14, 2023

This invalid calc

div {
	height: calc(100% - 2 (2 * var(--card-margin)));
}

crashes in playground with:

/* ERROR: Unreachable code should not be executed (evaluating 'n(i.id,o)') */

and in node with:

thread '<unnamed>' panicked at 'internal error: entered unreachable code', src/values/percentage.rs:81:12

That is only number crashes, anything else instead of 2 will pass. Stylelint passes on that calc() and this error in syntax crashes whole css workflow without no clear hint.

@tipiirai
Copy link

I also received this error with this example code

.lighten-by-25 {
  background: oklch(from blue calc(l + 25) c h);
}

taken directly from this chrome developer page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants