• Resolved waldirb

    (@waldirb)


    There is some code in the style-index.css that disrupts other elements by setting a margin of 0 to anything that is a last child inside the selector, namely the code below:

    .card-header :last-child,.card-footer :last-child,.card-body :last-child,.modal-header .modal-header-content :last-child,.offcanvas-header .offcanvas-header-content :last-child,.toast-header .toast-header-content :last-child,.toast-body :last-child {
        margin: 0
    }

    The problem with the above is that it not only targets the last child of for example the .card-body but anything that is considered a last child, which means that if I have a .row inside the .card-body and that .row is a last child (even if it’s nested) the margin will be set to 0 and the .row will lose it’s “gutter” functionality because it will no longer have the negative margins that offset the left and right side.

    I don’t know how you can go about fixing this but I can suggest to be more specific with it, for example, only targeting direct descendants of the elements like so:

    .card-body > :last-child{
        margin: 0
    }

    Looking forward to hearing your thoughts and thank you for a great plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Miles

    (@areoimiles)

    Hi @waldirb,

    Thank you for flagging this issue!

    I’m going to look into it and once I resolve it I will send you an update. It will most likely be next week so I appreciate your patience on this.

    Thanks
    Miles

    Plugin Author Miles

    (@areoimiles)

    Hi?@waldirb,

    I’ve just released an update (1.3.12) which should resolve your issue. I made the CSS selectors more specific but unfortunately that didn’t resolve it as if your .row was the last child in the .card-body it would still override the margin.

    So, along with making the selector more specific I have also changed it to only apply a margin to the bottom of the element, this way it won’t override the .row left and right margins.

    I’ve tested it and the row block now works as expected when within the .card-body. Let me know if you have any issues with it and I can take another look.

    Thanks again for flagging this issue.

    Miles

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘last-child selector disrupts other classes.’ is closed to new replies.