Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New .admonition/.details injects padding into *any* last-child #630
Currently Material is assigning any element that is a last-child with padding. This is bad. So the math elements have some children who or last-child to their parent even if they are not direct children. of
Please see issue: facelessuser/pymdown-extensions#187.
Padding should only be applied to the last direct descendant of
Any element that qualifies as a last-child is inheriting bottom padding.
Steps to reproduce the bug
@makshh, I assume it is there to limit some elements that add extra margin to their top initially. I suspect the idea is the first block element should not have extra padding in an admonition or details element to keep a consistent look.
I practicality, I'm not sure if there are specific elements in Material that are adding extra margins that need to be stripped. I assume it was added for a reason, but I don't know.
Hmm, that leads me to believe that it is targeting the title element. If that is its real purpose, then that could be targeted instead with
Attempted a fix in PR #634, specifically in this file. The margin issue @makshh mentioned is also fixed. The problem was that, indeed, all margin was applied to all nested last childs. This should be fixed by the child selector. Just merged the PR into master - could you validate?
EDIT: this also applies for details, as it is derived from admonition.
I think it is fixed.
Possible cases when it may not work as expected:
But I think it's acceptable as it is now, these are edge cases.