GeekyAnts / GeekyAnts/NativeBase

Cannot remove button padding in variants.

Open
#5,369 9 comments 2 reactions 1 assignee Claimed by @ankit-tailor View on GitHub
bug triage v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### Description

Working with button variants, props like `p`, `px` and `py` doesn't work

### CodeSandbox/Snack link

https://codesandbox.io/s/ecstatic-frog-uld3wb

### Steps to reproduce

1. Create theme variant for button.
2. Create a button in your app.
3. You can padding even there's padding props as 0

### NativeBase Version

3.4.15

### Platform

- [X] Android
- [ ] CRA
- [X] Expo
- [X] iOS
- [ ] Next

### Other Platform

Storybook

### Additional Information

Hi! I'm working with Native Base Button variants, creating new Link variant, but padding modify only works if it pass through component like this.
```js

{!loading ? text : }

```

```
{}} />
```
```
const variantLink = (props: Dict) => {
const c = props?.theme?.colors

return {
bg: 'none',
width: 'auto',
px: 0,
py: 0,
_text: {
color: c?.green?.main,
fontWeight: 700
}
}
}

export const buttonVariants = {
primary: variantPrimary,
link: variantLink
}
```

But if I remove px and py and include it in variant as codesandbox below, padding still appears (like screenshot)

image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.