Git Product home page Git Product logo

Comments (5)

squidfunk avatar squidfunk commented on May 31, 2024 1

Thanks for suggesting. I hope I understand you correctly, but this feature request does not talk about content tabs, but about collapsible admonitions. I've adjusted the title to reflect that, so others can find this feature request more easily ☺️

From our perspective, albeit a valid feature request, it's a rather edgy use case, and I'm not sure if this helps when you're in the middle of an admonition/details block, as you'd need to scroll further down to find the bottom. Thus, we're considering this out of scope, which means we're currently not considering this to be ready for inclusion.

However, you can achieve something that implements almost the same functionality with a few lines of additional CSS:

.md-typeset summary {
  position: sticky;
  top: 48px;
  z-index: 1;
  backdrop-filter: blur(10px);
}

Now, when scrolling down, the header of the container will stick to the top, so you can close it at any scroll position:

Ohne.Titel.mp4

from mkdocs-material.

deponovo avatar deponovo commented on May 31, 2024

The video somehow does not play on firefox. On edge was ok. I added the css lines to my css and somehow I do not obtain the same effect. I also tried with a clean css stylesheet, just in case I had some conflicting entries, but still not working. But indeed, that would be a solution to my proposal.

from mkdocs-material.

squidfunk avatar squidfunk commented on May 31, 2024

So, I've checked the proposed solution again, and it works for me. I've created a minimal reproduction that you can check out and run and play with: 9.5.19-sticky-details.zip

from mkdocs-material.

Ast3risk-ops avatar Ast3risk-ops commented on May 31, 2024

You can apply this to specific admonition types like so:

.md-typeset .TYPE>summary {
    position: sticky;
    top: 48px;
    z-index: 1;
    backdrop-filter: blur(10px);
}

Or as another class:

.md-typeset .follow > summary {
    position: sticky;
    top: 48px;
    z-index: 1;
    backdrop-filter: blur(10px);
}
??? info follow
    This admonition's header will now follow you down the page.

from mkdocs-material.

deponovo avatar deponovo commented on May 31, 2024

So, I've checked the proposed solution again, and it works for me. I've created a minimal reproduction that you can check out and run and play with: 9.5.19-sticky-details.zip

I confirm it is working. Thank you.

from mkdocs-material.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.