last-child selector disrupts other classes.
-
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!
- The topic ‘last-child selector disrupts other classes.’ is closed to new replies.