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

Allow theme.space to be array *or* object #417

Merged
merged 1 commit into from Mar 11, 2019

Conversation

Projects
None yet
3 participants
@jaridmargolin
Copy link
Contributor

jaridmargolin commented Mar 7, 2019

This functionality appears to have been removed from v4 (hopefully not intentionally). Currently all other theme props support being defined as an array or an object. Spacing properties are the exception (or the only exception I have run into).

@jaridmargolin

This comment has been minimized.

Copy link
Contributor Author

jaridmargolin commented Mar 10, 2019

I've also hit a few occasions where it would be helpful to declare negative margins/paddings. I was considering adding support for this by checking if object key startsWith -. but was concerned this would be unexpected behavior w/ objects. Any thoughts?

@aholachek

This comment has been minimized.

Copy link

aholachek commented Mar 11, 2019

Merging this pr would be helpful for my use case — designers have passed down a series of named spacing increments to integrate into our design system, and I'd prefer to stay close to their naming scheme rather than introducing a new mental model (array indices) just for spacing.

@jxnblk

This comment has been minimized.

Copy link
Collaborator

jxnblk commented Mar 11, 2019

Thanks! Yeah, this was an unintentional regression so thanks for catching this!

@jxnblk jxnblk merged commit 573956d into styled-system:master Mar 11, 2019

@jaridmargolin

This comment has been minimized.

Copy link
Contributor Author

jaridmargolin commented Mar 11, 2019

@jxnblk - Thank you for the quick merge/release. Do you have any opinions on if object definitions should support negative values? Ex: mx='-small'

I would have to sniff for - as the first character, which feels a little hacky. At the same time, it's annoying to NOT have access to negative theme values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.