Skip to content

Commit b025959

Browse files
committed
Replace hack from scratchfoundation#2354 with flexbox solution
The stage + target pane wrapper's width must be constrained to that of the stage, even when there are lots of sprite tiles. Otherwise, once you add enough sprites, it'll grow horizontally past the stage size. The old code set its maximum width explicitly to stop that from happening, but it can also be done more elegantly with the flex-basis property. This also has the benefit of taking the stage border width into account.
1 parent 15c74d9 commit b025959

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/components/gui/gui.css

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,21 +197,9 @@
197197
/* pad entire wrapper to the left and right; allow children to fill width */
198198
padding-left: $space;
199199
padding-right: $space;
200-
}
201-
202-
.stage-and-target-wrapper.large {
203-
/* Fix the max width to max large stage size (defined in layout_constants.js) + gutter size */
204-
max-width: calc(480px + calc($space * 2));
205-
}
206200

207-
.stage-and-target-wrapper.large-constrained {
208-
/* Fix the max width to max largeConstrained stage size (defined in layout_constants.js) + gutter size */
209-
max-width: calc(408px + calc($space * 2));
210-
}
211-
212-
.stage-and-target-wrapper.small {
213-
/* Fix the max width to max small stage size (defined in layout_constants.js) + gutter size */
214-
max-width: calc(240px + calc($space * 2));
201+
/* this will only ever be as wide as the stage */
202+
flex-basis: 0;
215203
}
216204

217205
.target-wrapper {

0 commit comments

Comments
 (0)