Button BaseStyle not overriding for paddings
See original GitHub issue🐛 Bug report
Provide a brief description of the bug here
Hi, this is similar to #2015. However, this time paddingX
and px
do not override the button styles.
💥 Steps to reproduce
Clear and concise reproduction steps are important for us to be able to triage your issue in a timely manner
See the _app.js
file in the repro
💻 Link to reproduction
Please create a minimal reproduction in CodeSandbox
JavaScript Template: JavaScript CodeSandbox template
TypeScript Template: TypeScript CodeSandbox template
https://codesandbox.io/s/chakra-button-basestyle-repro-spjid?file=/pages/_app.js
🧐 Expected behavior
Tell us what you expect to happen.
🧭 Possible Solution
Not compulsory, but suggesting a fix would be great!
🌍 System information
Software | Version(s) |
---|---|
Chakra UI | 1.2.1 |
Browser | Brave |
Operating System | MacOS |
📝 Additional information
- Screenshots or code
- Notes or link to ideas
It might be good to check what other props are not being applied, but so far in the repro, the padding in the x
direction do not work.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Chakra UI spacing not matching expected defaults for padding ...
I'm working on converting my app from rebass to chakra and ... const Button: ComponentStyleConfig = { baseStyle: { fontWeight: 'bold', } ...
Read more >Component Style - Chakra UI
For example, the <Button> component renders a <button> HTML element: ... these styles because the Card component is not a built-in component in...
Read more >RadButton and Overriding Default styles - Telerik
I tried the example on 'Creating a Custom Skin for RadButton' and still found that not all my changes had overridden the Default...
Read more >Component Style - Chakra UI
For example, the <Button> component renders a <button> HTML element: ... If no props is passed, the defaultProps defined in the style config...
Read more >Overriding Default Button Styles | CSS-Tricks
See in the video above how setting border: 0; removed the border in Chrome, but also the background? Not the case in Firefox:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mtt87 I just had your issue, I realized it is also due to similar reasons as the padding issue here. For buttons, the background color is defined in the
variants
object, which is by default usessolid
. If you override the bg through the variant, this issue no longer occurs. I think this could be more clear in the docs.Facing the same issue with Button. Looks like whatever property was used to define the style will need to be used to override it, i.e. per the Button example: https://github.com/chakra-ui/chakra-ui/blob/main/packages/theme/src/components/button.ts#L168
Example: ⛔️ Doesn’t work
✅ Works