Fix brace expansion with range going down#17591
Merged
RobinMalfait merged 6 commits intomainfrom Apr 7, 2025
Merged
Conversation
Just a tiny change so it is easier to focus on a single test for debugging purposes.
This now completes all versions:
- a/{0..10..5}/b — increasing, positive step
- a/{0..10..-5}/b — increasing, negative step
- a/{10..0..5}/b — decreasing, positive step
- a/{10..0..-5}/b — decreasing, negative step
thecrypticace
approved these changes
Apr 7, 2025
Contributor
thecrypticace
left a comment
There was a problem hiding this comment.
I really should unify the brace expansion code in IntelliSense with the one we've got here.
Looks good 👍
vaernion
pushed a commit
to Arbeidstilsynet/brevgen2
that referenced
this pull request
Dec 3, 2025
…patch) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@tailwindcss/postcss](https://tailwindcss.com) ([source](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-postcss)) | [`4.1.3` -> `4.1.4`](https://renovatebot.com/diffs/npm/@tailwindcss%2fpostcss/4.1.3/4.1.4) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [tailwindcss](https://tailwindcss.com) ([source](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss)) | [`4.1.3` -> `4.1.4`](https://renovatebot.com/diffs/npm/tailwindcss/4.1.3/4.1.4) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>tailwindlabs/tailwindcss (@​tailwindcss/postcss)</summary> ### [`v4.1.4`](https://github.com/tailwindlabs/tailwindcss/blob/HEAD/CHANGELOG.md#414---2025-04-14) [Compare Source](tailwindlabs/tailwindcss@v4.1.3...v4.1.4) ##### Added - Add experimental `@tailwindcss/oxide-wasm32-wasi` target for running Tailwind in browser environments like StackBlitz ([#​17558](tailwindlabs/tailwindcss#17558)) ##### Fixed - Ensure `color-mix(…)` polyfills do not cause used CSS variables to be removed ([#​17555](tailwindlabs/tailwindcss#17555)) - Ensure `color-mix(…)` polyfills create fallbacks for theme variables that reference other theme variables ([#​17562](tailwindlabs/tailwindcss#17562)) - Fix brace expansion in declining ranges like `{10..0..5}` and `{0..10..-5}` ([#​17591](tailwindlabs/tailwindcss#17591)) - Work around a Chrome rendering bug when using the `skew-*` utilities ([#​17627](tailwindlabs/tailwindcss#17627)) - Ensure container quer...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where a test was setup wrong. While fixing the test, I also noticed that the actual computation was wrong. There are a few cases we have to make sure they work when working with ranges:
0..10..5— range going from low to high, with a positive step. This should result in0 5 10. Already worked.0..10..-5— range going from low to high, with a negative step. This should result in10 5 0. This one was broken.10..0..5— range going from high to low, with a positive step. This should result in10 5 0. This one was broken.10..0..-5— range going from high to low, with a negative step. This should result in0 5 10. Already worked.This technically means that there are multiple ways to do the same thing. And in case of Tailwind CSS the order doesn't really matter because we apply custom sort rules for utilities. Luckily, the order here doesn't have any influence on the actual generated CSS so it's not the end of the world to support it.
Intellisense does use a more heavy brace expansion library, and if we don't support this, it also means that you can see a preview of generated classes without generating the actual classes. This also fixes that.
E.g.: Note how the preview shows the correct values, but nothing has been generated (this is before the change of this PR).
Fixes: #17576
Test plan
a/{10..0..5}/b), which faileda/{10..0..-5}/b)