Skip to content

Commit

Permalink
fix: Avoid width jump when resizing app layout (toolbar mode only) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
just-boris authored Dec 4, 2024
1 parent d1ff27e commit c04ca9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe.each(['refresh', 'refresh-toolbar'] as Theme[])('%s', theme => {
`Browser viewPortWidth ${viewPortWidth}: contentType '${contentType}' has default width for content, navigation and tools slot.`,
setupTest(viewPortWidth, async page => {
await page.setContentType(contentType);
await expect(page.getContentWidth()).resolves.toBe(contentWidth);
await expect(page.getContentWidth()).resolves.toBe(theme === 'refresh' ? contentWidth : 1620);

// Open the drawers and check their width
await page.setDrawersOpen();
Expand Down
7 changes: 2 additions & 5 deletions src/app-layout/visual-refresh-toolbar/skeleton/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
@use 'sass:map' as map;
@use '../../../internal/styles' as styles;
@use '../../../internal/styles/tokens' as awsui;
@use '../../../internal/generated/custom-css-properties/index.scss' as custom-props;
Expand Down Expand Up @@ -61,11 +62,7 @@
grid-template-rows: min-content min-content 1fr min-content;

&.has-adaptive-widths-default {
@each $breakpoint, $width in constants.$adaptive-content-widths {
@include styles.media-breakpoint-up($breakpoint) {
#{custom-props.$maxContentWidth}: $width;
}
}
#{custom-props.$maxContentWidth}: map.get(constants.$adaptive-content-widths, styles.$breakpoint-xx-large);
}

&.has-adaptive-widths-dashboard {
Expand Down

0 comments on commit c04ca9c

Please sign in to comment.