Skip to content

Commit

Permalink
Fix overflowing instructions and horizontal scrolling (#10238)
Browse files Browse the repository at this point in the history
In commit a7e5cde, I changed the height of the tutorial card to "auto" instead of a fixed value, and that meant the child (with height 100%) started overflowing when it exceeded the size of the parent. To fix this, I just set a max height on the child that's tied to the max height of the parent - basically the same setup we have for when the instructions are minimized, just at a bigger size.

I also made it so code snippets can wrap on spaces. There are some long-ish lines of code (or code-like) snippets in the Minecraft HOC tutorial, and they can cause horizontal scrolling on small widths, since code snippets are currently set to not wrap (for example, ||hoc:HeadWear, MidWear, and LowerWear|| in costume_python_activity3.md). I think it's okay to break these on spaces, at the very least.

Lastly, I moved the "Show More"/"Less..." toggle down just a smidge since it was overlapping the text.
  • Loading branch information
thsparks authored Oct 21, 2024
1 parent c1bfbe3 commit c87cb26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions theme/tutorial.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@highlightLineClassColor: #007f00;
@highlightLineKeywordColor: #0000ff;
@tutorialCardHeight: 8rem;
@tutorialCardMaxHeight: 20rem;
@seeMoreButtonHeight: 4rem;
@avatarSize: 4.5rem;
@avatarMargin: @avatarSize + 0.5rem;
Expand Down Expand Up @@ -88,7 +89,7 @@
}

.tutorial.tutorialExpanded #tutorialcard {
max-height: 20rem;
max-height: @tutorialCardMaxHeight;
}

#root.dimmable.dimmed #tutorialcard.tutorialReady {
Expand Down Expand Up @@ -152,6 +153,7 @@ body#docs.tutorial {

.tutorial.tutorialExpanded #tutorialcard .ui.buttons {
height: 100%;
max-height: calc(@tutorialCardMaxHeight - 1rem);
}

#tutorialcard .ui.tutorialsegment {
Expand Down Expand Up @@ -263,7 +265,7 @@ span.docs.inlinebutton {
span.docs.inlineblock {
padding: 0.05rem .2rem;
padding-bottom: 0.1rem;
white-space: nowrap;
white-space: break-spaces;
border-radius: 0;
border-bottom: 3px solid var(--inline-namespace-color);
color: black;
Expand Down Expand Up @@ -492,7 +494,7 @@ code.lang-filterblocks {
position: relative;
width: auto;
margin: auto;
margin-top: -0.75rem;
margin-top: -0.5rem;
padding: 0.5rem 0.8rem;
}

Expand Down

0 comments on commit c87cb26

Please sign in to comment.