From 55cddf1e2c746c6836b03f0761f0771bbc982730 Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Mon, 21 Feb 2022 22:39:38 -0600
Subject: fix layout shift

---
 src/lib/minecraft/Inventory.svelte | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

(limited to 'src/lib/minecraft/Inventory.svelte')

diff --git a/src/lib/minecraft/Inventory.svelte b/src/lib/minecraft/Inventory.svelte
index 3068f67..0a6a179 100644
--- a/src/lib/minecraft/Inventory.svelte
+++ b/src/lib/minecraft/Inventory.svelte
@@ -22,12 +22,19 @@
 	}
 </script>
 
-<div class:inventory-container-{name}={name !== ''}>
+<div class="inventory-container" style="--group-limit:{groupLimit}">
 	{#each itemGroups as itemGroup}
-		<div>
-			{#each itemGroup as item}
-				<Item {item} {pack} isslot />
-			{/each}
-		</div>
+		{#each itemGroup as item}
+			<Item {item} {pack} isslot />
+		{/each}
 	{/each}
 </div>
+
+<style>
+	.inventory-container {
+		width: fit-content;
+		display: grid;
+		grid-template-columns: repeat(var(--group-limit), 1fr);
+		grid-gap: 0;
+	}
+</style>
-- 
cgit 

