-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Try to canonicalize any arbitrary utility to a bare value #19379
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
Try to canonicalize any arbitrary utility to a bare value #19379
Conversation
WalkthroughAdds a new canonicalization path for arbitrary utility values in Tailwind CSS: when rem-based canonicalization is enabled and the candidate is a functional arbitrary value, the code resolves the spacing multiplier from the design system, constant-folds it, canonicalizes the candidate value, compares dimensions, and — if units match and the multiplier is non-zero — computes a bare numeric value and emits a named candidate. This path runs before the existing spacing-map lookup. Test coverage was expanded with cases for default and custom spacing scales and mixed units, and some expected outcomes were updated. Pre-merge checks✅ Passed checks (2 passed)
Comment |
To do this, we check if the `rem` option is provided, then we canonicalize the incoming value. We also canonicalize the spacing multiplier so we can deal with both `--spacing: 0.25rem` as `--spacing: 4px` values (different units). We then compute the bare value, and just try it as a replacement.
25b0b5f to
4bd24e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
CHANGELOG.md (1)
20-20: Polish wording + add example; consider section placementPrefer Tailwind terminology (“arbitrary values in utilities”) and include an example for clarity. Optionally, this reads more like a behavior change than a bug fix, so consider moving to “Changed” if that better matches intent.
- - Try to canonicalize any arbitrary utility to a bare value ([#19379](https://github.com/tailwindlabs/tailwindcss/pull/19379)) + - Canonicalize arbitrary values in utilities to bare values (e.g., `gap-[116px]` → `gap-29`) ([#19379](https://github.com/tailwindlabs/tailwindcss/pull/19379))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
CHANGELOG.md(1 hunks)packages/tailwindcss/src/canonicalize-candidates.test.ts(1 hunks)packages/tailwindcss/src/canonicalize-candidates.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/tailwindcss/src/canonicalize-candidates.ts (2)
packages/tailwindcss/src/constant-fold-declaration.ts (1)
constantFoldDeclaration(8-115)packages/tailwindcss/src/utils/dimensions.ts (1)
dimensions(6-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Linux
- GitHub Check: Linux / upgrade
🔇 Additional comments (2)
packages/tailwindcss/src/canonicalize-candidates.test.ts (2)
533-547: Excellent test coverage for the new canonicalization logic.The new test cases comprehensively verify that arbitrary values can be canonicalized to bare values across different spacing scales and units:
- Default scale (0.25rem/4px):
gap-[116px]→gap-29✓- Custom scale (1px):
gap-[116px]→gap-116✓- Equivalent forms: rem, calc, and px all canonicalize to the same result ✓
The math checks out: 116px ÷ 4px = 29, and the tests verify this works whether the spacing is expressed as
0.25remor4px.
550-550: Correctly updated expectation.The updated expectation
w-[124px]→w-31correctly reflects the new canonicalization behavior (124px ÷ 4px = 31).
Probably will never happen in the real world because a spacing multiplier of 0px (or equivalent) doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/tailwindcss/src/canonicalize-candidates.ts (1)
993-1025: Spacing canonicalization block looks correct; consider simplifying constantFold usage.The new rem‑aware spacing canonicalization logic is well constrained (only for functional + arbitrary values, unit‑matched, and guarded by signature comparison), and the division‑by‑zero check avoids pathological configs cleanly.
One small nit:
constantFoldDeclarationcurrently returns astring, so thecanonicalizedSpacingMultiplier !== nullcheck is a no‑op. You could drop that check and slightly flatten the nesting by computing both folded values up front and early‑returning whendimensions.get(...)fails, e.g.:- let canonicalizedSpacingMultiplier = constantFoldDeclaration( - spacingMultiplier, - options.signatureOptions.rem, - ) - if (canonicalizedSpacingMultiplier !== null) { - let canonicalizedValue = constantFoldDeclaration(value, options.signatureOptions.rem) - let valueDimension = dimensions.get(canonicalizedValue) - let spacingMultiplierDimension = dimensions.get(canonicalizedSpacingMultiplier) - if ( - valueDimension && - spacingMultiplierDimension && - valueDimension[1] === spacingMultiplierDimension[1] && // Ensure the units match - spacingMultiplierDimension[0] !== 0 - ) { - let bareValue = `${valueDimension[0] / spacingMultiplierDimension[0]}` - if (isValidSpacingMultiplier(bareValue)) { - yield Object.assign({}, candidate, { - value: { kind: 'named', value: bareValue, fraction: null }, - }) - } - } - } + let canonicalizedSpacingMultiplier = constantFoldDeclaration( + spacingMultiplier, + options.signatureOptions.rem, + ) + let canonicalizedValue = constantFoldDeclaration(value, options.signatureOptions.rem) + + let valueDimension = dimensions.get(canonicalizedValue) + let spacingMultiplierDimension = dimensions.get(canonicalizedSpacingMultiplier) + if ( + valueDimension && + spacingMultiplierDimension && + valueDimension[1] === spacingMultiplierDimension[1] && // Ensure the units match + spacingMultiplierDimension[0] !== 0 + ) { + let bareValue = `${valueDimension[0] / spacingMultiplierDimension[0]}` + if (isValidSpacingMultiplier(bareValue)) { + yield Object.assign({}, candidate, { + value: { kind: 'named', value: bareValue, fraction: null }, + }) + } + }Purely a readability/maintenance tweak; behavior stays the same.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/tailwindcss/src/canonicalize-candidates.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/tailwindcss/src/canonicalize-candidates.ts (3)
packages/tailwindcss/src/constant-fold-declaration.ts (1)
constantFoldDeclaration(8-115)packages/tailwindcss/src/utils/dimensions.ts (1)
dimensions(6-20)packages/tailwindcss/src/utils/infer-data-type.ts (1)
isValidSpacingMultiplier(356-358)
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [@tailwindcss/postcss](https://tailwindcss.com) ([source](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-postcss)) | [`4.1.17` -> `4.1.18`](https://renovatebot.com/diffs/npm/@tailwindcss%2fpostcss/4.1.17/4.1.18) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>tailwindlabs/tailwindcss (@​tailwindcss/postcss)</summary> ### [`v4.1.18`](https://github.com/tailwindlabs/tailwindcss/blob/HEAD/CHANGELOG.md#4118---2025-12-11) [Compare Source](tailwindlabs/tailwindcss@v4.1.17...v4.1.18) ##### Fixed - Ensure validation of `source(…)` happens relative to the file it is in ([#​19274](tailwindlabs/tailwindcss#19274)) - Include filename and line numbers in CSS parse errors ([#​19282](tailwindlabs/tailwindcss#19282)) - Skip comments in Ruby files when checking for class names ([#​19243](tailwindlabs/tailwindcss#19243)) - Skip over arbitrary property utilities with a top-level `!` in the value ([#​19243](tailwindlabs/tailwindcss#19243)) - Support environment API in `@tailwindcss/vite` ([#​18970](tailwindlabs/tailwindcss#18970)) - Preserve case of theme keys from JS configs and plugins ([#​19337](tailwindlabs/tailwindcss#19337)) - Write source maps correctly on the CLI when using `--watch` ([#​19373](tailwindlabs/tailwindcss#19373)) - Handle special defaults (like `ringColor.DEFAULT`) in JS configs ([#​19348](tailwindlabs/tailwindcss#19348)) - Improve backwards compatibility for `content` theme key from JS configs ([#​19381](tailwindlabs/tailwindcss#19381)) - Upgrade: Handle `future` and `experimental` config keys ([#​19344](tailwindlabs/tailwindcss#19344)) - Try to canonicalize any arbitrary utility to a bare value ([#​19379](tailwindlabs/tailwindcss#19379)) - Validate candidates similarly to Oxide ([#​19397](tailwindlabs/tailwindcss#19397)) - Canonicalization: combine `text-*` and `leading-*` classes ([#​19396](tailwindlabs/tailwindcss#19396)) - Correctly handle duplicate CLI arguments ([#​19416](tailwindlabs/tailwindcss#19416)) - Don’t emit color-mix fallback rules inside `@keyframes` ([#​19419](tailwindlabs/tailwindcss#19419)) - CLI: Don't hang when output is `/dev/stdout` ([#​19421](tailwindlabs/tailwindcss#19421)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xNC4yIiwidXBkYXRlZEluVmVyIjoiNDIuMTQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.csmpro.ru/csmpro/mapban/pulls/74 Co-authored-by: Renovate Bot <renovate@csmpro.ru> Co-committed-by: Renovate Bot <renovate@csmpro.ru>
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ eslint (9.19.0 → 9.20.1) · [Repo](https://github.com/eslint/eslint) · [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/eslint/eslint/releases/tag/v9.20.1">9.20.1</a></h4> <blockquote><h2 dir="auto">Bug Fixes</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/274f054f19f5f490d9496c6eee4bcd8620d2f4be"><code class="notranslate">274f054</code></a> fix: fix <code class="notranslate">RuleContext</code> type (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19417">#19417</a>) (Francesco Trotta)</li> </ul> <h2 dir="auto">Documentation</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/fe3ccb2ff43a9f20a7801c679f7d41f6a7ed3ddc"><code class="notranslate">fe3ccb2</code></a> docs: allow typing in search box while dropdown is open (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19424">#19424</a>) (Amaresh S M)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/93c78a5c58edb7ead9bff87c874d2ff9b824ec04"><code class="notranslate">93c78a5</code></a> docs: Add instructions for pnpm compat (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19422">#19422</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/b476a930bb3a6d644c482747d985f5da0d89e1e9"><code class="notranslate">b476a93</code></a> docs: Fix Keyboard Navigation for Search Results (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19416">#19416</a>) (Amaresh S M)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/ccb60c0b1452e73750e3734c9cd7c7b12c473827"><code class="notranslate">ccb60c0</code></a> docs: Update README (GitHub Actions Bot)</li> </ul></blockquote> <h4><a href="https://github.com/eslint/eslint/releases/tag/v9.20.0">9.20.0</a></h4> <blockquote><h2 dir="auto">Features</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/e89a54a3090f3503daf5e36b02b0035c993e3fd1"><code class="notranslate">e89a54a</code></a> feat: change behavior of inactive flags (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19386">#19386</a>) (Milos Djermanovic)</li> </ul> <h2 dir="auto">Bug Fixes</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/91d4d9f62095e302c71595cc04c47073f366315c"><code class="notranslate">91d4d9f</code></a> fix: Bring types in sync with @eslint/core (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19157">#19157</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/fa25c7a79edee280f275fbc35b83bcde906d1480"><code class="notranslate">fa25c7a</code></a> fix: Emit warning when empty config file is used (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19399">#19399</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/31a9fd03d23aecf2b1e0c9b3df27554aff245723"><code class="notranslate">31a9fd0</code></a> fix: Clearer error message for wrong plugin format (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19380">#19380</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/61d99e38f248f4d9abc09d970c4eebddd1af86ca"><code class="notranslate">61d99e3</code></a> fix: Better error message for unserializable parser (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19384">#19384</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/db1b9a66e387e573f45885687dfefc04ab2877fe"><code class="notranslate">db1b9a6</code></a> fix: Ensure module scope is checked for references in <code class="notranslate">consistent-this</code> (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19383">#19383</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/8bcd820f37f2361e4f7261a9876f52d21bd9de8f"><code class="notranslate">8bcd820</code></a> fix: <code class="notranslate">arrow-body-style</code> crash with single-token body (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19379">#19379</a>) (Milos Djermanovic)</li> </ul> <h2 dir="auto">Documentation</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/b7012c85f3c0f683baeffb6d856faf86c4d41702"><code class="notranslate">b7012c8</code></a> docs: rewrite examples with var using let and const (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19407">#19407</a>) (Mueez Javaid Hashmi)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/64063765afa5bf29855d996ccabfaa93b19bd458"><code class="notranslate">6406376</code></a> docs: Update README (GitHub Actions Bot)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/350f2b9349bc8d2230cd953c14b77071f2961f47"><code class="notranslate">350f2b9</code></a> docs: rewrite some examples with var using let and const (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19404">#19404</a>) (Mueez Javaid Hashmi)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/93c325a7a841d0fe4b5bf79efdec832e7c8f805f"><code class="notranslate">93c325a</code></a> docs: rewrite examples with var using let and const (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19398">#19398</a>) (Mueez Javaid Hashmi)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/56ff4048e053374db39201e7e880bde4c930e19f"><code class="notranslate">56ff404</code></a> docs: replace var with let or const in rules docs (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19396">#19396</a>) (Daniel Harbrueger)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/4053226996bbdec1ffdef8af1b9d7f5aa4b11b86"><code class="notranslate">4053226</code></a> docs: change <code class="notranslate">sourceType</code> in <code class="notranslate">no-eval</code> examples (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19393">#19393</a>) (Milos Djermanovic)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/1324af027986d655848ee1a9dcb89a527917ea3e"><code class="notranslate">1324af0</code></a> docs: replace var with let and const in rules docs (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19392">#19392</a>) (Daniel Harbrueger)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/8b87e007bb2ba59b73061d22ef34baffb5656b79"><code class="notranslate">8b87e00</code></a> docs: replace <code class="notranslate">var</code> with <code class="notranslate">const</code> and <code class="notranslate">let</code> in rules (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19389">#19389</a>) (Tanuj Kanti)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/758c66bc8d83cd4eda9639b0745f0d0fb70f04f4"><code class="notranslate">758c66b</code></a> docs: Explain what frozen rules mean (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19382">#19382</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/0ef8bb859c988e558683c2d8bd9c9606f22e456c"><code class="notranslate">0ef8bb8</code></a> docs: additional checks for rule examples (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19358">#19358</a>) (Milos Djermanovic)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/58ab2f69d2d4cf9b49bf3fd303795040ec761ebd"><code class="notranslate">58ab2f6</code></a> docs: fix order of installation steps in getting started (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19326">#19326</a>) (Tanuj Kanti)</li> </ul> <h2 dir="auto">Chores</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/979097a3b4c656e2d9faabd4a52010d6647911f6"><code class="notranslate">979097a</code></a> chore: upgrade @eslint/js@9.20.0 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19412">#19412</a>) (Francesco Trotta)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/031734efcb27e0d800da7ec32f5d5dae55f80564"><code class="notranslate">031734e</code></a> chore: package.json update for @eslint/js release (Jenkins)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/d4c47c3738f2bf53b4f6a1cf505861b35875ac5f"><code class="notranslate">d4c47c3</code></a> test: avoid empty config warning in test output (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19408">#19408</a>) (Milos Djermanovic)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/67dd82ab88d784b6f36e471b6a5c6f64e37f9485"><code class="notranslate">67dd82a</code></a> chore: update dependency @eslint/json to ^0.10.0 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19387">#19387</a>) (renovate[bot])</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/15ac0e182486f32d63171a310050383e15767697"><code class="notranslate">15ac0e1</code></a> chore: add permissions: read-all to stale.yml workflow (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/19374">#19374</a>) (Josh Goldberg ✨)</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/eslint/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/eslint/eslint/compare/208e0b199f5d5f9dd173e58e3f5db19c1f0c38ed...07b2ffd3c597780eba6297d7735114beb5d0af4a">See the full diff on Github</a>. The new version differs by 32 commits:</p> <ul> <li><a href="https://github.com/eslint/eslint/commit/07b2ffd3c597780eba6297d7735114beb5d0af4a"><code>9.20.1</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/01ff142d5503326336a50d45d324e0b92866f5e2"><code>Build: changelog update for 9.20.1</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/fe3ccb2ff43a9f20a7801c679f7d41f6a7ed3ddc"><code>docs: allow typing in search box while dropdown is open (tailwindlabs#19424)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/274f054f19f5f490d9496c6eee4bcd8620d2f4be"><code>fix: fix `RuleContext` type (tailwindlabs#19417)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/93c78a5c58edb7ead9bff87c874d2ff9b824ec04"><code>docs: Add instructions for pnpm compat (tailwindlabs#19422)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/b476a930bb3a6d644c482747d985f5da0d89e1e9"><code>docs: Fix Keyboard Navigation for Search Results (tailwindlabs#19416)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/ccb60c0b1452e73750e3734c9cd7c7b12c473827"><code>docs: Update README</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/7e78b50dacc3faeacfb8c8dc6ad3359971395d1d"><code>9.20.0</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/588b664536185481e626b061c3c4549dde5e7149"><code>Build: changelog update for 9.20.0</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/979097a3b4c656e2d9faabd4a52010d6647911f6"><code>chore: upgrade @eslint/js@9.20.0 (tailwindlabs#19412)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/031734efcb27e0d800da7ec32f5d5dae55f80564"><code>chore: package.json update for @eslint/js release</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/91d4d9f62095e302c71595cc04c47073f366315c"><code>fix: Bring types in sync with @eslint/core (tailwindlabs#19157)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/b7012c85f3c0f683baeffb6d856faf86c4d41702"><code>docs: rewrite examples with var using let and const (tailwindlabs#19407)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/d4c47c3738f2bf53b4f6a1cf505861b35875ac5f"><code>test: avoid empty config warning in test output (tailwindlabs#19408)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/e89a54a3090f3503daf5e36b02b0035c993e3fd1"><code>feat: change behavior of inactive flags (tailwindlabs#19386)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/fa25c7a79edee280f275fbc35b83bcde906d1480"><code>fix: Emit warning when empty config file is used (tailwindlabs#19399)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/64063765afa5bf29855d996ccabfaa93b19bd458"><code>docs: Update README</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/350f2b9349bc8d2230cd953c14b77071f2961f47"><code>docs: rewrite some examples with var using let and const (tailwindlabs#19404)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/93c325a7a841d0fe4b5bf79efdec832e7c8f805f"><code>docs: rewrite examples with var using let and const (tailwindlabs#19398)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/56ff4048e053374db39201e7e880bde4c930e19f"><code>docs: replace var with let or const in rules docs (tailwindlabs#19396)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/4053226996bbdec1ffdef8af1b9d7f5aa4b11b86"><code>docs: change `sourceType` in `no-eval` examples (tailwindlabs#19393)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/1324af027986d655848ee1a9dcb89a527917ea3e"><code>docs: replace var with let and const in rules docs (tailwindlabs#19392)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/8b87e007bb2ba59b73061d22ef34baffb5656b79"><code>docs: replace `var` with `const` and `let` in rules (tailwindlabs#19389)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/31a9fd03d23aecf2b1e0c9b3df27554aff245723"><code>fix: Clearer error message for wrong plugin format (tailwindlabs#19380)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/61d99e38f248f4d9abc09d970c4eebddd1af86ca"><code>fix: Better error message for unserializable parser (tailwindlabs#19384)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/758c66bc8d83cd4eda9639b0745f0d0fb70f04f4"><code>docs: Explain what frozen rules mean (tailwindlabs#19382)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/67dd82ab88d784b6f36e471b6a5c6f64e37f9485"><code>chore: update dependency @eslint/json to ^0.10.0 (tailwindlabs#19387)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/db1b9a66e387e573f45885687dfefc04ab2877fe"><code>fix: Ensure module scope is checked for references in `consistent-this` (tailwindlabs#19383)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/8bcd820f37f2361e4f7261a9876f52d21bd9de8f"><code>fix: `arrow-body-style` crash with single-token body (tailwindlabs#19379)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/15ac0e182486f32d63171a310050383e15767697"><code>chore: add permissions: read-all to stale.yml workflow (tailwindlabs#19374)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/0ef8bb859c988e558683c2d8bd9c9606f22e456c"><code>docs: additional checks for rule examples (tailwindlabs#19358)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/58ab2f69d2d4cf9b49bf3fd303795040ec761ebd"><code>docs: fix order of installation steps in getting started (tailwindlabs#19326)</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
This PR adds an improvement to our canonicalization logic when dealing with arbitrary values. When trying to canonicalize utilities, we make use of the intellisense suggestions list where we typically use multiples of the spacing scale.
This means that a value like
gap-[128px]gets properly canonicalized togap-32. However, when you try a value that we typically don't suggest such asgap-[116px]then it doesn't get canonicalized at all.This PR fixes that by trying to use the spacing scale and convert
116px / 4pxand try thegap-29utility instead.This is done by canonicalizing the incoming arbitrary value and the spacing multipliers such that
--spacing: 0.25remand--spacing: 4pxboth work as expected.Test plan
0.25rem(which is the default)4px1pxAlso had to update 1 test that now gets canonicalized properly, e.g.:
w-[124px]→w-31.