Skip to content

@source inline(…) incorrectly pads number values for unequal significant number ranges #17492

@wongjn

Description

@wongjn

What version of Tailwind CSS are you using?

v4.1.0

What build tool (or framework if it abstracts the build tool) are you using?

@tailwindcss/cli

What version of Node.js are you using?

v20.11.0

What browser are you using?

N/A

What operating system are you using?

Ubuntu 20.04.6 LTS in WSL2

Reproduction URL

Not needed, see below.

Describe your issue

In packages/tailwindcss/src/utils/brace-expansion.test.ts, add the following test:

[
  'z-{10..100..10}',
  [
    'z-10',
    'z-20',
    'z-30',
    'z-40',
    'z-50',
    'z-60',
    'z-70',
    'z-80',
    'z-90',
    'z-100',
  ],
],

The relevant test output is as follows:

 FAIL  |tailwindcss| src/utils/brace-expansion.test.ts > expand(…) > should expand z-{10..100..10}
AssertionError: expected [ 'z-010', 'z-020', 'z-030', …(7) ] to deeply equal [ 'z-10', 'z-100', 'z-20', …(7) ]

- Expected
+ Received

  Array [
-   "z-10",
+   "z-010",
+   "z-020",
+   "z-030",
+   "z-040",
+   "z-050",
+   "z-060",
+   "z-070",
+   "z-080",
+   "z-090",
    "z-100",
-   "z-20",
-   "z-30",
-   "z-40",
-   "z-50",
-   "z-60",
-   "z-70",
-   "z-80",
-   "z-90",
  ]

 ❯ src/utils/brace-expansion.test.ts:81:34
     79|     ['{1.1..2.2}', ['1.1..2.2']],*/
     80|   ])('should expand %s', (input, expected) => {
     81|     expect(expand(input).sort()).toEqual(expected.sort())
       |                                  ^
     82|   })
     83| 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions