Skip to content
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(typing): Support any valid number for utility props that needs it #357

Conversation

kamalbennani
Copy link
Contributor

@kamalbennani kamalbennani commented Mar 15, 2022

Summary

Based on the code itself and the website, some declarations don't match the actual typing of some props.

For instance, sizing props such as w/h or even border/borderWidth should accept any valid number (not only the numbers defined in the theme).
"Any valid value is accepted in width, numbers are converted to px, other units have to be specified."

So, I went through all the exposed props and I've updated the typing to add the missing valid type which is number in this case.

@kamalbennani
Copy link
Contributor Author

Hi @gregberge 👋
I was wondering if my two opened PRs are approved and fully tested (with the one that was merged previously), would it be possible to release a patch version of the library ^^'
Let me know if I missed anything, I'd be happy to take care of it.
Thanks.

packages/styled-components/src/index.ts Outdated Show resolved Hide resolved
@kamalbennani kamalbennani force-pushed the fix/support-any-valid-number-for-utility-props branch from 22846d1 to 8deae1b Compare April 10, 2022 21:13
@kamalbennani kamalbennani requested a review from gregberge April 12, 2022 12:14
@gregberge gregberge merged commit 1fd72c6 into styled-components:main Apr 12, 2022
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.

3 participants