Skip to content

Nested card in card groups are displayed wrong #24752

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

Closed
jhhazelaar opened this issue Nov 10, 2017 · 9 comments
Closed

Nested card in card groups are displayed wrong #24752

jhhazelaar opened this issue Nov 10, 2017 · 9 comments
Labels

Comments

@jhhazelaar
Copy link

I have a card-group with nested cards in de card-body of the grouped. This nested card act like they are grouped. Nested card doesn't have a left border or no rounded corner just like the grouped cards.

Maybe adding some > to de card scss. I didn't have the time to figure out the solutions, sorry for that.

@jhhazelaar
Copy link
Author

I don't think this is the best way. But for now it's a solution:

.card-group {
  .card {
    @include media-breakpoint-up(sm) {
      .card {
        border: $card-border-width solid $card-border-color;
        @include border-radius($card-border-radius);

        &:not(:first-child):not(:last-child):not(:only-child) {
          @include border-radius($card-border-radius);
        }
      }
    }
  }
}

@Johann-S
Copy link
Member

Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case via CodePen or JS Bin and report back with your link, Bootstrap version, and specific browser and OS details.

@jhhazelaar
Copy link
Author

Sorry, here it is: https://codepen.io/jhhazelaar/pen/LOWWKw

@Johann-S
Copy link
Member

Can you update your CodePen to our latest release please ?
https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.min.css

@jhhazelaar
Copy link
Author

Still the same issue. Sorry for the incompetence, first time creating an issue

@Johann-S
Copy link
Member

don't worry that's ok 👍

@gijsbotje
Copy link
Contributor

maybe using .card-group > .card everywhere would be a good solution
@Johann-S what'd you think?

@Johann-S
Copy link
Member

It's seems we try to avoid child selector in Bootstrap 🤔
maybe @andresgalante have ideas on how to fix that ?

@andresgalante
Copy link
Collaborator

andresgalante commented Nov 13, 2017

Thanks a lot @jhhazelaar for reporting this one.

Hi @Johann-S to me this is a really good case for a child selector, since we want to select just .card child and nothing else.

The other option is to undo the styles for card-group card on nested cards which will add way more specificity and styles. I've send a PR so we can discuss more concrete ideas

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

No branches or pull requests

4 participants