-
Notifications
You must be signed in to change notification settings - Fork 60
Allow style prop in UnpicImageProps type definitions
#841
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 9da7cfd The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for unpic-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for unpic-angular ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for unpic-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: ascorbic <[email protected]>
Co-authored-by: ascorbic <[email protected]>
style prop in UnpicImageProps type definitions
ascorbic
left a comment
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.
It needs to merge generated styles with user styles
@unpic/angular
@unpic/astro
@unpic/core
@unpic/lit
@unpic/preact
@unpic/qwik
@unpic/react
@unpic/solid
@unpic/svelte
@unpic/vue
@unpic/webc
commit: |
Co-authored-by: ascorbic <[email protected]>
The style merging is already implemented in |
ascorbic
left a comment
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.
Add a changeset
Co-authored-by: ascorbic <[email protected]>
Added changeset in commit 9da7cfd. |
Plan: Allow passing 'style' prop to UnpicImageProps / Image component
Analysis
The issue is that
UnpicImagePropstype in/packages/core/src/types.tsexplicitly omits thestyleprop on lines 145-146 and 158-159. This prevents TypeScript users from passing inline styles to the Image component, even though the underlying implementation would support it.Minimal Changes Required
UnpicImagePropstype in/packages/core/src/types.tsto not omitstyle(only omitsrcset)UnpicBaseImagePropstype in/packages/core/src/types.tsto not omitstyle(only omitsrcset)styleprop is accepted by TypeScript in React packageSummary
Successfully implemented the feature request to allow passing the
styleprop to theImagecomponent. The changes are minimal and surgical:/packages/core/src/types.tsto stop omitting thestyleprop/packages/react/test/react.test.tsxto verify the functionality/packages/core/test/core.test.tsxto verify style merging behaviorThe implementation already merges user styles with generated styles correctly - user styles are spread after generated styles, allowing them to override when needed. The new tests verify this behavior.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.