Details summary margin appears to be wrong
See original GitHub issueI checked that…
- … the documentation does not mention anything about my problem
- … the problem doesn’t occur with the default MkDocs template
- … the problem is not in any of my customizations (CSS, JS, template)
- … there are no open or closed issues that are related to my problem
Description
It appears the margin for summary is incorrect. It appears to use
.md-typeset summary {
margin: 0 -0.6rem 0 -0.8rem;
}
But should use:
.md-typeset summary {
margin: 0 -0.6rem 0 -0.6rem;
}
The problem doesn’t appear until you try to override the background color of the summary. The above change does not affect the visual appearance of the base style, which seems to suggest that it is a quirk due to when the style is applied.
To demonstrate that this is not related to my site’s custom styling, I’ve demonstrated that it occurs on Materials official docs with a simple CSS change:
I have replicated this on both Chrome and Firefox. I have not tried others yet.
Expected behavior
Changing the summary background should not make the left details border disappear.
Actual behavior
Summary background changes should not cause the left detail’s border to disappear.
Steps to reproduce the bug
See description
Package versions
- Python: 3.8
- MkDocs: Latest
- Material: 6.0
System information
- OS: macOS
- Browser: Firefox and Chrome, maybe more.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Two Issues Styling the Details Element and How to Solve Them
Nesting a block-level element (e.g. a heading) inside a <summary> element pushes that content down below the arrow marker, rather than keeping ...
Read more >html5 <summary> element with some text right justified
I tried to do this by using a flexbox for the line and doing the layout inside the flexbox. This works fine for...
Read more >The Details disclosure element - HTML - MDN Web Docs
The HTML element creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A...
Read more >Everything You Need To Know About CSS Margins
Margins in CSS seem simple enough at first glance. Applied to an element it forms a space around the element, pushing other elements...
Read more >Safari details-summary problem - HTML & CSS - SitePoint
In a ul all content must be inside a li element. Run your code through the html validator if you don't know why...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, the quirks of different browsers 😬.
If nothing, this will make it more obvious what is happening. The user will have something they can see that is not getting styled.
Released as part of 6.1.0.