nandorojo / dripsy

🍷 Responsive, unstyled UI primitives for React Native + Web.
https://dripsy.xyz
MIT License
2.01k stars 80 forks source link

Fix - stop returning negative value as string #203

Closed levic92 closed 2 years ago

levic92 commented 2 years ago

As discussed in #201

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
dripsy ✅ Ready (Inspect) Visit Preview May 5, 2022 at 4:41AM (UTC)
nandorojo commented 2 years ago

I gave some thought to this, and I actually think it's best to not have this PR. If you want negative values, you can do one of two things:

1. Add them to your theme (recommended):

const theme = {
  space: {
    '-$1': -4,
    $0: 0,
    $1: 4
  }
}

2. Use a theme function

<View sx={theme => ({ p: theme.space.$1 * -1 })} />


I'd rather not add this feature since it would break TypeScript autocomplete. The first solution would solve this, and leave Dripsy to be more extensible from the theme.

My apologies for not saying this earlier, I know you spent time on the PR which I do appreciate!

nandorojo commented 2 years ago

Maybe we can merge this but not document it and recommend the theme method.