Skip to content

Commit 38a21ea

Browse files
authored
fix: reduce default dashboard column min-width (#11501)
The previous default 25em equals 350–400 pixels, depending on the theme, which is too wide for many smartphones, which means dashboards will always show a scrollbar. 20em is 280–320 pixels, which is more reasonable to fit within common smartphone viewports (accounting for some padding around the viewport as well).
1 parent 3f25143 commit 38a21ea

70 files changed

Lines changed: 4 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/dashboard/src/styles/vaadin-dashboard-layout-base-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const dashboardLayoutStyles = css`
4141
gap: var(--_gap);
4242
4343
/* Default min and max column widths */
44-
--_default-col-min-width: 25em;
44+
--_default-col-min-width: 20em;
4545
--_default-col-max-width: 1fr;
4646
4747
/* Effective min and max column widths */

packages/dashboard/test/dashboard-layout.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const defaultMinimumColumnWidth = (() => {
3232
const div = document.createElement('div');
3333
document.body.appendChild(div);
3434
div.style.width = '1rem';
35-
const minColWidth = div.offsetWidth * 25;
35+
const minColWidth = div.offsetWidth * 20;
3636
div.remove();
3737
return minColWidth;
3838
})();

packages/dashboard/test/dom/__snapshots__/dashboard-layout.test.snap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ snapshots["vaadin-dashboard-layout host"] =
1010
snapshots["vaadin-dashboard-layout shadow"] =
1111
`<div
1212
id="grid"
13-
style="width: 800px; --_col-count: 1;"
13+
style="width: 800px; --_col-count: 2;"
1414
>
1515
<slot>
1616
</slot>

packages/dashboard/test/dom/__snapshots__/dashboard.test.snap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ snapshots["vaadin-dashboard host"] =
2323
snapshots["vaadin-dashboard shadow"] =
2424
`<div
2525
id="grid"
26-
style="width: 800px; --_col-count: 1;"
26+
style="width: 800px; --_col-count: 2;"
2727
>
2828
<slot name="slot-0">
2929
</slot>
10.3 KB
9.35 KB
9.1 KB
9.67 KB
8.55 KB
8.58 KB

0 commit comments

Comments
 (0)