-
I just noted, that depending on the screen width, in the mobile layout the sidebar sometime does / doesn't contain the GitHub banner element. The GitHub element is only shown on the narrowest screen width. Is there some logic behind it? I would assume the less space I have on a screen the less to show. Also, I doubt that people will get heavily involved in GitHub on their phones anyway. I hope I didn't miss an option to fully turn it off/on. If I didn't, I would propose just this: instead of the actual behavior I think it would an improvement to allow for on option in the mkdocs.yml to always hide or always show the element. Reproducible on the current mkdocs-material homepage. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The git information is always visible – it is kept in the header until the tablet portrait breakpoint, and then moved into the sidebar. You probably missed the point where it's still in the header. The displaying/switching logic is implemented with CSS, for example, here's the code that triggers the display of the git information in the header: mkdocs-material/src/assets/stylesheets/main/components/_header.scss Lines 245 to 261 in 5a228db The reason is that there's not enough space to keep it in the header. Here's a video demonstrating the point at which it switches: Ohne.Titel.mp4 |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. You are right, I was confusing myself as I already used custom CSS to hide the GitHub element on desktop sized windows. However, I'd like to point out that there are (e.g. business) use cases where you want to keep a repo actively linked and the edit buttons enabled (for convenient editing) but you do not want to show the repo info to your clients (unnecessary). I suppose that this may be quite a common use case to get the best out of two worlds:
Considering this, what do you think about splitting up the repo option in:
I guess that would be pretty much in line with the recent updates from version 8 to 9 where settings are much more granular. |
Beta Was this translation helpful? Give feedback.
Thanks for your reply. You are right, I was confusing myself as I already used custom CSS to hide the GitHub element on desktop sized windows.
Due to that, it didn't make sense to me why suddenly the repo info appeared in the sidebar only on the smallest window width.
I will probably just edit the partials as you described.
However, I'd like to point out that there are (e.g. business) use cases where you want to keep a repo actively linked and the edit buttons enabled (for convenient editing) but you do not want to show the repo info to your clients (unnecessary).
I suppose that this may be quite a common use case to get the best out of two worlds: