-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a max-height
and scroll bar to code blocks above a certain height.
#1095
Comments
max-width
and scroll bar to code blocks above a certain height.max-height
and scroll bar to code blocks above a certain height.
This makes sense from a user experience POV. Though something we might want to consider is giving the See an example of a focusable Jan-05-2023.19-02-59.mp4🤔 do let me know if this should be a separate issue, and we can fix this independently (probably best) |
agree, making |
I don't know about this one. I systematically use the viewcode extention in my libs and it create this kind of pages: https://sepal-ui.readthedocs.io/en/latest/_modules/sepal_ui/aoi/aoi_model.html#AoiModel let's imagine we effectively wrap things in a y-scrolled frame. I open this page on a small screen where the "max-height" cannot be displayed at once and I enter the classic phone nightmare where I need to scroll everything down to get the content at the bottom: i.e. no improvement with respect to the current implementation. I don't know if it's clear but that's the same issue as when you have a full width map with touch screen activated, you never know if you zoomon the map or scroll the content. |
It would be scrollable still - but I also understand where that rationale is coming from. In a tablet and mobile the scrollable targets can be quite small and it's easy to end scrolling or zooming in the wrong place. Could a workaround be adding breakpoints to add either different max heights for desktop and mobile? This might be useful also for readers who use zooms of 200 or 400 per cent? |
@choldgraf the gutters exist but my fingers are clearly too big (or my screen too small) to make it fluid. |
@12rambau makes sense - I'll concede that just relying on the gutters is not enough! |
Sometimes it is useful to include really long code blocks (e.g. if you're programmatically generating output), but these take up a lot of vertical space.
Instead of showing the entire block, it might be useful to automatically cap the size of code blocks (to, say, 2/3 of the vertical space, or above a certain number of lines of code) and add
overflow-y: auto
so that scroll bars show up for really high code blocks.References
GitHub has a similar UX with its code blocks, e.g.:
The text was updated successfully, but these errors were encountered: