Skip to content

Conversation

@zyyv
Copy link
Member

@zyyv zyyv commented Jan 8, 2026

close #5044

I added the keyword stretch, but I can't find a more elegant way to handle compatibility prefixes across different browsers.

I recommend using it in pair with https://github.com/unocss-community/unocss-preset-autoprefixer for better compatibility.

Refer to Lightingcss Playground

/cc @jods4

Copilot AI review requested due to automatic review settings January 8, 2026 03:04
@zyyv zyyv requested a review from antfu as a code owner January 8, 2026 03:04
@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit feb223c
🔍 Latest deploy log https://app.netlify.com/projects/unocss/deploys/695f1ed575ad6c0008099327
😎 Deploy Preview https://deploy-preview-5048--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the CSS stretch keyword for width and height utilities in preset-mini and preset-wind4. The stretch value allows elements to fill the available space in the containing block, which is particularly useful for modern layout scenarios.

Key Changes:

  • Added stretch case handling in the getSizeValue function for both presets
  • Added test cases for w-stretch and max-w-stretch utilities
  • Updated expected CSS output snapshots

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages-presets/preset-mini/src/_rules/size.ts Added stretch case to return 'stretch' value in getSizeValue function
packages-presets/preset-wind4/src/rules/size.ts Added stretch case to set 'stretch' value in getSizeValue function
test/assets/preset-mini-targets.ts Added test cases for w-stretch and max-w-stretch utilities
test/assets/output/preset-mini-targets.css Updated expected CSS output for preset-mini with stretch utilities
test/assets/output/preset-wind4-targets.css Updated expected CSS output for preset-wind4 with stretch utilities

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'w-none',
'w-auto',
'w-unset',
'w-stretch',
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test coverage is incomplete. While w-stretch is added here, the implementation in the size.ts files also supports h-stretch, min-h-stretch, and max-h-stretch utilities since they use the same getSizeValue function. These test cases should be added for consistency and completeness.

Copilot uses AI. Check for mistakes.
'max-w-20',
'max-w-lg',
'max-w-full',
'max-w-stretch',
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test coverage is incomplete. The max-h-stretch and min-h-stretch test cases are missing, even though the implementation supports them. For completeness, these should be added alongside max-w-stretch.

Copilot uses AI. Check for mistakes.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 8, 2026

Open in StackBlitz

commit: feb223c

@zyyv zyyv merged commit 126d15a into main Jan 9, 2026
24 of 26 checks passed
@zyyv zyyv deleted the stretch branch January 9, 2026 02:55
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.

Add w-stretch and h-stretch

2 participants