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(<LENGTH> - 0) should be simplified to <LENGTH> #928

Open
Jisu-Woniu opened this issue Mar 9, 2025 · 0 comments
Open

calc(<LENGTH> - 0) should be simplified to <LENGTH> #928

Jisu-Woniu opened this issue Mar 9, 2025 · 0 comments

Comments

@Jisu-Woniu
Copy link

I encountered this code snippet in my CSS:

.foo {
  margin: calc(100px - 0);
}

This should be simplified to:

.foo{margin:100px}

cssnano playground

But Lightning CSS outputs:

.foo{margin:calc(100px - 0)}

Lightning CSS playground

A input of 0px instead of 0 gives .foo{margin:100px} on both minifiers.

.foo {
  margin: calc(100px - 0px);
}

If this is an unsafe operation, let me know what the possible corner case is.

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

1 participant