question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set border radius for buttons in theme.js?

See original GitHub issue

Sorry for making so many issues, I just couldn’t find this in docs.

How do I set border radius for buttons?

I know how to set border for a variant.

buttons: {
    primary: {
      background: 'black',
      color: 'white',
      borderRadius: 40
    },
    secondary: {
      color: 'white',
      background: 'blue'
    }
  }

But I use the same border raidus everywhere. Is there any way to make all buttons have the same border?

I tried this:

  radii: {
    buttons: 48
  }

And this:

buttons: {
    borderRadius: 20,
    primary: {
      background: 'black',
      color: 'white'
    },
    secondary: {
      color: 'white',
      background: 'blue'
    }
  },

both don’t work

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
talentlessguycommented, Sep 17, 2019

Here is a working example: https://codesandbox.io/s/rebass-sandbox-gvs14

Thanks for demo!

I finally found what the hell was going on

image

I used rebass instead of rebass/styled-components all the time… and this caused the issue (most probably)

I feel so dumb…

0reactions
jxnblkcommented, Sep 17, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I change the shape of a button in MUI using theme?
There is a global border radius shape value in the theme. You can change it like this: const theme = createMuiTheme({ shape: {...
Read more >
border-radius - CSS: Cascading Style Sheets - MDN Web Docs
The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, ......
Read more >
How To Create Round Buttons - W3Schools
How TO - Round Buttons. ❮ Previous Next ❯. Learn how to style round buttons with CSS. ... Add rounded corners to a...
Read more >
The Complete Guide to Material-UI Border Radius (4 Examples)
A default design pattern in Material-UI is to create rounded corners with border radius. There are several ways to customize border radius ......
Read more >
17+ CSS Round Buttons [Examples & How to create]
To create a rounded button you have to make use of the border-radius CSS property. The higher the value for that property the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found