Skip to content

Commit

Permalink
fix(styles): prevent overflow for TwoColumnPanel left container at na…
Browse files Browse the repository at this point in the history
…rrow viewports (#1234)
  • Loading branch information
scurker authored Oct 11, 2023
1 parent 06862aa commit 53b0649
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/styles/two-column-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,12 @@

.TwoColumnPanel--hide .TwoColumnPanel__Left,
.TwoColumnPanel--show .TwoColumnPanel__Left {
margin-left: calc(var(--two-column-panel-left-column-width) * -1);
max-width: 100%;
/* This will constrain the component to the max-width of its container, as well as adjusting the offset margin to the max negative value to prevent incorrect offset when the max-width is less than the column width. */
margin-left: max(
calc(var(--two-column-panel-left-column-width) * -1),
calc(100% * -1)
);
animation: none;
opacity: 1;
}
Expand Down

0 comments on commit 53b0649

Please sign in to comment.