-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
fix(preset-mini): support composite props #3810
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for unocss ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -840,6 +840,9 @@ export const presetMiniTargets: string[] = [ | |||
'transition-property-[border]', | |||
'transition-200', | |||
'transition-opacity-200', | |||
'transition-colors', | |||
'transition-colors,opacity', | |||
'transition-colors,opacity-200', | |||
'transition-color,background-color-200', |
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.
I don't know why vitest not update those snap.
Since this PR adds a composite prop to the CSS props array in handler utils, it more or less breaks the whole prop resolving mechanism. I think the better approach is to remove the composite prop from that handler array, and guard the So an approach like this passes the test cases. Though for some odd reason the snapshot matching fails.
function transitionProperty(prop: string): string | undefined {
const cssProps = h.properties(prop)
if (cssProps !== undefined)
return cssProps
const transformed = prop.split(',').flatMap(x => transitionPropertyGroup[x]).filter(x => x !== undefined)
return transformed.length > 0 ? transformed.join(',') : undefined
} |
I'll need to revert to this after unocss/unocss#3810 gets merged
close #3807.