Skip to content

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

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

Closed
wongjn opened this issue Apr 1, 2025 · 1 comment · Fixed by #17491
Closed

Comments

@wongjn
Copy link
Collaborator

wongjn commented Apr 1, 2025

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| 
@philipp-spiess
Copy link
Member

Thanks for writing this up! We're going to ship a patch for this shortly.

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

Successfully merging a pull request may close this issue.

2 participants