Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Border Bottom in Accordion First Item #27124

Closed
ismailfarooq opened this issue Aug 24, 2018 · 7 comments
Closed

No Border Bottom in Accordion First Item #27124

ismailfarooq opened this issue Aug 24, 2018 · 7 comments

Comments

@ismailfarooq
Copy link

There is no Border Bottom if Accordion has only single Item

https://www.bootply.com/vB8GoWkFz3

@ismailfarooq ismailfarooq changed the title No Border Bottom in Accordion No Border Bottom in Accordion First Item Aug 24, 2018
@royklutman
Copy link
Contributor

I believe it is technically not an accordion when using just a single item, you can fix this by just using the collapse class without the accordion: https://www.bootply.com/wpXTWhpi7V

@Ruffio
Copy link

Ruffio commented Aug 26, 2018

@royklutman, your solution/example isn't 100% bulletproof. If you look closely (zoom in), you can easily see a double border at the bottom:

image

However I can see this has already been raised as an issue: #27108

I'm sure that the fix is quite small and it would be cool if it was corrected in 4.2 :-)

@royklutman
Copy link
Contributor

@Ruffio You are correct indeed, didn't notice that. I do have a possible fix for this, i'm discussing this in #27108 so it's not scattered all over the place.

@ismailfarooq
Copy link
Author

@royklutman Actually my accordion is dynamic items can b single or multiple

@royklutman
Copy link
Contributor

@ismailfarooq Ah, that makes sense. If you are using plain CSS, add these lines:

.accordion .card {
  overflow: hidden;
}

.accordion .card-header {
  margin-bottom: -1px;
}

If you are using SCSS and build Bootstrap yourself, add this to your custom SCSS:

.accordion {
  .card {
    overflow: hidden;
  }
  
  .card-header {
    margin-bottom: -1px;
  }
}

This will fix your issue, the proposed fix is in PR #27133.

@JrmSK
Copy link

JrmSK commented Jul 7, 2019

Found a solution on my own.
I was facing this issue, coupled with an other challenge: on the same page i am displaying a few different accordions, some might be 1 item long, some more. So I had to find a trick to select only the ones with one child. I got help from this article: https://css-tricks.com/almanac/selectors/o/only-child/

the rest is pretty straightforward, you just need to add a css rule:

.accordion div.card:only-child { border-bottom: 1px solid rgba(0, 0, 0, 0.125); border-radius: calc(0.25rem - 1px); }

@DavidSitompul
Copy link

DavidSitompul commented Jan 11, 2024

code

i use div to fix the issues no border bottom in accordion maybe in not the best but i think this can fix the issues for a while until the developer of flowbite fix the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants