Skip to content

Conversation

@zyyv
Copy link
Member

@zyyv zyyv commented Dec 30, 2025

close #5029

Copilot AI review requested due to automatic review settings December 30, 2025 03:35
@zyyv zyyv requested a review from antfu as a code owner December 30, 2025 03:35
@netlify
Copy link

netlify bot commented Dec 30, 2025

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit 52b5649
🔍 Latest deploy log https://app.netlify.com/projects/unocss/deploys/695366a46be7d1000863b4f3
😎 Deploy Preview https://deploy-preview-5030--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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 30, 2025

Open in StackBlitz

commit: 52b5649

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 fixes the columns utility in preset-wind3 and preset-wind4 to generate values from container theme configuration instead of only accepting generic values. The change allows using responsive container breakpoint names (like sm, md) with the columns utility.

  • Updated columns rule to check container theme values first before falling back to standard handlers
  • Added support for CSS variable syntax with the $variable pattern
  • Modified test targets to include columns-sm and columns-$variable examples

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages-presets/preset-wind4/src/rules/columns.ts Added theme.container lookup before handler chain; updated handler to remove .global and .auto; added explicit columns-auto rule
packages-presets/preset-wind3/src/rules/columns.ts Added theme.containers lookup before handler chain; updated handler to remove .global and .auto; added explicit columns-auto rule
test/assets/preset-wind4-targets.ts Replaced columns-unset with columns-sm and columns-$variable test cases
test/assets/preset-wind3-targets.ts Replaced columns-unset with columns-sm and columns-$variable test cases
test/assets/output/preset-wind4-targets.css Updated CSS output showing columns-sm using CSS variable, columns-$variable support, and removed columns-unset
test/assets/output/preset-wind3-targets.css Updated CSS output showing columns-sm with direct value (24rem), columns-$variable support, and removed columns-unset
test/snapshots/postcss.test.ts.snap Updated snapshot reflecting the new columns behavior with container values
packages-engine/autocomplete/test/snapshots/autocomplete.test.ts.snap Updated autocomplete suggestions to show columns-auto first in the list

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


return { columns: h.bracket.numberWithUnit.number.cssvar(v) }
}, { autocomplete: 'columns-<num>' }],
['columns-auto', { columns: 'auto' }],
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The new implementation removes support for CSS global keywords like 'inherit', 'initial', 'revert', 'revert-layer', and 'unset'. The test files show 'columns-unset' was removed. To preserve this functionality, add ...makeGlobalStaticRules('columns') after line 14 (the columns-auto rule), similar to how break-before, break-inside, and break-after handle global keywords.

Suggested change
['columns-auto', { columns: 'auto' }],
['columns-auto', { columns: 'auto' }],
...makeGlobalStaticRules('columns'),

Copilot uses AI. Check for mistakes.

return { columns: h.bracket.numberWithUnit.number.cssvar(v) }
}, { autocomplete: 'columns-<num>' }],
['columns-auto', { columns: 'auto' }],
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The new implementation removes support for CSS global keywords like 'inherit', 'initial', 'revert', 'revert-layer', and 'unset'. The test files show 'columns-unset' was removed. To preserve this functionality, add ...makeGlobalStaticRules('columns') after line 13 (the columns-auto rule), similar to how break-before, break-inside, and break-after handle global keywords in other presets.

Suggested change
['columns-auto', { columns: 'auto' }],
['columns-auto', { columns: 'auto' }],
...makeGlobalStaticRules('columns'),

Copilot uses AI. Check for mistakes.
}

return { columns: h.bracket.numberWithUnit.number.cssvar(v) }
}, { autocomplete: 'columns-<num>' }],
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The autocomplete configuration should include container theme values. Consider updating the autocomplete to include 'columns-$container' similar to how other theme-aware rules like perspective-$perspective are configured. This would help users discover that container values like 'sm', 'md', etc. can be used with the columns utility.

Suggested change
}, { autocomplete: 'columns-<num>' }],
}, { autocomplete: 'columns-<num> columns-$container' }],

Copilot uses AI. Check for mistakes.
}

return { columns: h.bracket.numberWithUnit.number.cssvar(v) }
}, { autocomplete: 'columns-<num>' }],
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The autocomplete configuration should include container theme values. Consider updating the autocomplete to include 'columns-$containers' similar to how other theme-aware rules are configured. This would help users discover that container values like 'sm', 'md', etc. can be used with the columns utility.

Suggested change
}, { autocomplete: 'columns-<num>' }],
}, { autocomplete: 'columns-<num> columns-$containers' }],

Copilot uses AI. Check for mistakes.
@zyyv zyyv merged commit 46860e6 into main Dec 30, 2025
12 checks passed
@zyyv zyyv deleted the rule-columns branch December 30, 2025 05:49
This was referenced Jan 13, 2026
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.

columns-[breakpoint] not working

2 participants