Skip to content

Loosening ResponsiveStyleValue to accept false#1499

Merged
hasparus merged 1 commit into
system-ui:developfrom
ed0wolf:patch-1
Feb 14, 2021
Merged

Loosening ResponsiveStyleValue to accept false#1499
hasparus merged 1 commit into
system-ui:developfrom
ed0wolf:patch-1

Conversation

@ed0wolf

@ed0wolf ed0wolf commented Feb 13, 2021

Copy link
Copy Markdown
Contributor

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?

@ed0wolf ed0wolf requested a review from hasparus as a code owner February 13, 2021 14:33
@vercel

vercel Bot commented Feb 13, 2021

Copy link
Copy Markdown

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
Copy Markdown
Member

Seems good to me!

@hasparus

Copy link
Copy Markdown
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