Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the unocss-preset-scrollbar preset API and rule set to streamline utilities/autocomplete and adjust compatibility behavior, with corresponding Vitest snapshot updates.
Changes:
- Switch test setup to
presetWind3and adjust generator usage/autocomplete snapshots. - Redesign preset options (
noCompatible->compatible, removeprefix/numberToUnit), and refactor rules (unify thumb/track color rules, add opacity utilities). - Update snapshots to reflect new generated CSS for default + compatible modes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/index.test.ts | Updates generator preset and modifies assertions/snapshots for new rule outputs and autocomplete shape. |
| test/index-compatible.test.ts | Updates option name to compatible and refreshes snapshots for the “compatible” configuration. |
| test/snapshots/index.test.ts.snap | Snapshot updates for new default CSS output and removed tests. |
| test/snapshots/index-compatible.test.ts.snap | Snapshot updates for new “compatible” test output. |
| src/index.ts | Core refactor of preset options, shortcuts, rules, and compatibility behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
@action-hong Would you be able to review this? |
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.
Warning
This PR changes the following:
Optimized previous rules to better conform to Unocss syntax and speed up parsing.
Deprecated
numberToUnit. Unocss has built-in number unit parsing; I recommend aligning it withpresetWind3andpresetWind4. If unit conversion is needed, handle it in other steps, such aspostprocess.Deprecated
prefix. Prefixes are not compatible with shortcuts in sccollbar. sccollbar is already quite special, and I believe prefixes are sufficient; they are redundant and should be removed.Rename
noCompatibletocompatibleUpdated test snapshots.
fixes #20, fixes #15, fixes #16