Skip to content

Nested card in card groups are displayed wrong #24752

Closed

Description

@jhhazelaar

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.

Activity

  1. jhhazelaar commented on Nov 10, 2017

    @jhhazelaar
    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);
            }
          }
        }
      }
    }
    
  2. Johann-S commented on Nov 10, 2017

    @Johann-S
    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.

  3. added
    awaiting-reply
    on Nov 10, 2017
  4. added
    css
    v4
    and removed
    awaiting-reply
    on Nov 10, 2017
  5. jhhazelaar commented on Nov 10, 2017

    @jhhazelaar
    Author

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

  6. Johann-S commented on Nov 10, 2017

    @Johann-S
    Member

    don't worry that's ok 👍

  7. gijsbotje commented on Nov 10, 2017

    @gijsbotje
    Contributor

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

  8. Johann-S commented on Nov 12, 2017

    @Johann-S
    Member

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

  9. andresgalante commented on Nov 13, 2017

    @andresgalante
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cssv4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions