Skip to content

Allow multiples of .25 in aspect-* fractions#19688

Merged
RobinMalfait merged 3 commits intomainfrom
fix/issue-19663
Feb 17, 2026
Merged

Allow multiples of .25 in aspect-* fractions#19688
RobinMalfait merged 3 commits intomainfrom
fix/issue-19663

Conversation

@RobinMalfait
Copy link
Member

This PR reduces the restrictions of the aspect-* utilities when dealing with fractional values.

Up until now, the numbers had to be positive integers, so aspect-1/2 was valid, but aspect-8.5/11 was not.

This PR allows for any multiple of .25 as a valid value, so aspect-8.5/11 is now valid, but aspect-8.3/11 is not, this will still require aspect-[8.3/11] arbitrary value syntax to be valid.

This behavior of allowing multiples of .25 is consistent with other utilities that handle bare values such as w-2.5.

Test plan

  1. Existing tests pass
  2. Added a test for aspect-8.5/11

Fixes: #19663
Closes: #19680, #19669

If you want something more crazy, then you would still have to use
`aspect-[1.23/4.56]`. Using multiples of `.25` matches how the other
bare values like `w-2.5` work.
@RobinMalfait RobinMalfait requested a review from a team as a code owner February 17, 2026 17:32
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

This pull request adds support for decimal fractions in aspect-ratio utilities. The CHANGELOG documents the addition of multiples of .25 in aspect-* fractions. The validation logic in utilities.ts is updated to accept decimal values by replacing integer-only validation with isValidSpacingMultiplier checks. A test case is added to utilities.test.ts to verify the new aspect-[8.5/11] class generates the correct CSS rule aspect-ratio: 8.5 / 11;.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Allow multiples of .25 in aspect-* fractions' accurately summarizes the main change: relaxing aspect-ratio utility validation to accept decimal values that are multiples of 0.25.
Description check ✅ Passed The description is well-related to the changeset. It explains the purpose (allowing multiples of .25 in aspect-* utilities), provides context (previous integer-only restriction), and references the test plan and linked issues.
Linked Issues check ✅ Passed The PR implementation aligns with linked issues #19663, #19680, and #19669. It addresses the core requirement to allow decimal aspect ratios by accepting multiples of 0.25 [#19663, #19680] while maintaining consistency with other utilities accepting bare decimal values.
Out of Scope Changes check ✅ Passed All changes are in-scope: CHANGELOG.md documents the feature, utilities.ts implements the validation change using isValidSpacingMultiplier for both fraction components, and utilities.test.ts adds the required test case for aspect-8.5/11.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@RobinMalfait RobinMalfait merged commit 6eb3b32 into main Feb 17, 2026
9 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-19663 branch February 17, 2026 18:32
@shtse8
Copy link

shtse8 commented Feb 17, 2026

Hey @RobinMalfait, thanks for picking this up! Would you mind adding a Co-authored-by credit since I raised the issue and submitted the original PR (#19669)? Would appreciate it 🙏

Co-authored-by: shtse8 <shtse8@gmail.com>

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 this pull request may close these issues.

aspect ignored when decimals included in ratio

2 participants

Comments