question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Details summary margin appears to be wrong

See original GitHub issue

I 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;
}

detail-bug

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:

Screen Shot 2020-10-16 at 11 18 05 AM

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:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
facelessusercommented, Oct 17, 2020

However, this does not work in Chrome due to a bug (which I just found out about)

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.

0reactions
squidfunkcommented, Oct 17, 2020

Released as part of 6.1.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found