diff --git a/packages/standard-components/src/Layout.svelte b/packages/standard-components/src/Layout.svelte index c896b7f2b4..35edd28fc1 100644 --- a/packages/standard-components/src/Layout.svelte +++ b/packages/standard-components/src/Layout.svelte @@ -12,12 +12,24 @@ twoColumns: 2, threeColumns: 3, } + + let containerWidth + $: columnsDependingOnSize = calculateColumns(containerWidth) + + function calculateColumns(parentWidth) { + const numberOfAllowedColumns = Math.floor(parentWidth / 250) || 100 + if (layoutMap[type] <= numberOfAllowedColumns) { + return false + } else if (layoutMap[type] > numberOfAllowedColumns) { + return numberOfAllowedColumns + } + }