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

Loosening ResponsiveStyleValue to accept false #1499

Merged
merged 1 commit into from
Feb 14, 2021

Conversation

ed0wolf
Copy link
Contributor

@ed0wolf ed0wolf commented Feb 13, 2021

I have a bunch of code that does something like:

sx={{ margin: [0, isTrue && 4] }}

The current types don't allow this because isTrue && 4 resolved to type false | number and false is not accepted as ResponsiveStyleValue. With the current types you need to write isTrue ? 4 : undefined.

Any chance we could loosen the types to allow for this kind of short form?

@vercel
Copy link

vercel bot commented Feb 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/systemui/theme-ui/e8vcjtjcd
✅ Preview: https://theme-ui-git-fork-ed0wolf-patch-1.systemui.vercel.app

@lachlanjc
Copy link
Member

Seems good to me!

@hasparus
Copy link
Member

Thanks for the PR, @ed0wolf.
I'm gonna merge it in a moment, update changelog and release it as part of 0.6.0-alpha.7.

@hasparus hasparus added types enhancement New feature or request labels Feb 14, 2021
@hasparus hasparus merged commit 218fccf into system-ui:develop Feb 14, 2021
hasparus added a commit that referenced this pull request Feb 14, 2021
@ed0wolf ed0wolf deleted the patch-1 branch February 17, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants