Skip to content

[CSS minifier] The infinity keyword should be preserved in calc() #1839

Closed

Description

@yisibl
.foo {
  width: calc(infinity * 2);
  height: calc(infinity * 1px);
  padding: calc(InFiNiTy);
}

esbuild 0.14.2 output:

.foo{width:Infinity;height:Infinitypx;padding:Infinity}

Expectations

Maintain the output as is.

CSS Spec: https://drafts.csswg.org/css-values/#calc-error-constants

I'm not sure if infinity/-infinity will trigger this bug in other calculation functions.
Perhaps we should do a thorough check of similar issues to ensure that the new CSS syntax is not broken.

Activity

  1. yisibl commented on Dec 13, 2021

    @yisibl
    ContributorAuthor
  2. added a commit that references this issue on Sep 17, 2026
    034a56f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions