Skip to content

Definition List compounds bottom margin with each nested level #2501

@polarathene

Description

@polarathene
  • I've read the [contribution guidelines][1] and agree with them

I've found a bug and checked that ...

  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

With each nested level of definition list, the bottom margin seems to expand.

This appears to be due to display: flow-root (which the expected behaviour shows when removed). I'm not entirely sure why this rule is used to generate new block formatting context, so it's probably not a good solution (unless it were changed to not apply to nested children?).

The behaviour examples shown below is with excessive nesting. My actual use case is not as bad, but noticeable enough that I figured I should raise an issue about it.

Screenshot_20210329_154955

???+ info "Syntax"

    1. Declaration: `=== [tab-title]`

        `[tab-title]`
        
        : Provide a quoted string as the name of the tab. Markdown content is supported.

    2. Tab content is provided from the next line onward, assigned by indentation of 4 spaces.
    3. There should be a blank line before and after the tab content.
    4. Repeat steps for grouping additional content under related tabs.

Expected behavior

Screenshot_20210329_153248

Actual behavior

Screenshot_20210329_153025

Steps to reproduce the bug

  1. Enable and use the def_list markdown extension in mkdocs.yml.

  2. Add the markdown below to a doc page and build/preview the rendered output:

    a
    
    : b
    
        : c
    
            : d
    
                : e
    
    f

Package versions

Current release of the mkdocs-material Docker container.

Project configuration

Standard instance should do the trick, this is affected by mkdocs-material CSS.

System information

Manjaro Linux with Firefox.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions