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.

Shouldn't border-radius classes (rounded-*) replace element's default border-radius?

See original GitHub issue

Let’s say we have a button:

<button class="btn btn-primary">Test</button>

It will be applied the .btn’s default border-radius, which is a .25rem radius for every corner:

    border-radius: .25rem;

Let’s say we only want the left side corners to be rounded. So we do:

<button class="btn btn-primary rounded-left">Test</button>

Nothing changes and every corner (even from right side) is still rounded. It happens because .rounded-left is:

    border-bottom-left-radius: .25rem;
    border-top-left-radius: .25rem;

Shouldn’t we add:

    border-bottom-right-radius: 0 !important;
    border-top-right-radius: 0 !important;

Onto .rounded-left so it will change the element’s default border radius to be controlled by rounded-* classes?

Or it’s meant to be done somehow else?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
redichecommented, May 4, 2018

The solution suggested by @morrissey-ingenious no longer works, since rounded-0 was changed in aa5e97da044d774e4d1b5c54234cc8bf1ce862f5 to use !important and is declared after rounded-top, rounded-right, rounded-bottom and rounded-left.

1reaction
morrissey-ingeniouscommented, Sep 7, 2017

You can do this by stacking rounded-0 and rounded-left on the button

<button class="btn btn-primary rounded-0 rounded-left">Test</button>

https://codepen.io/morrissey-ingenious/pen/NvZRzg

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - Should border-radius clip the content? - Stack Overflow
Semantically speaking, it's best to simply add a border-radius inherit property to the inner div, hence the new class addition:
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 >
Bug Report: Border radius on "line" element does not round all ...
Change the border radius to 10px on all corners; You will see that only the top-right and top-left corners become rounded.
Read more >
border-radius - CSS-Tricks
You can give any element “rounded corners” by applying a border-radius through CSS. You'll only notice if there is a color change involved....
Read more >
Input controls do not override button's border radius
The border-radius for those widgets can be controlled by setting the "rounded" option. At the same time, when using SASS themes, a button's ......
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