From b4b10f924a4a6059bbf267ea03ad80b9eb55d59b Mon Sep 17 00:00:00 2001 From: codecalm Date: Mon, 7 Sep 2026 09:48:45 +0200 Subject: [PATCH] Render all icons on the preview icons page in production builds - keep the 20-icon limit only for the dev server --- .changeset/icons-page-all-icons.md | 5 +++++ shared/components/cards/Icons.astro | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/icons-page-all-icons.md diff --git a/.changeset/icons-page-all-icons.md b/.changeset/icons-page-all-icons.md new file mode 100644 index 000000000..be9ccb57c --- /dev/null +++ b/.changeset/icons-page-all-icons.md @@ -0,0 +1,5 @@ +--- +"@tabler/preview": patch +--- + +Fixed the preview icons page to render all icons in production builds, keeping the 20-icon limit only for the dev server. diff --git a/shared/components/cards/Icons.astro b/shared/components/cards/Icons.astro index 20b3ba245..90aa53309 100644 --- a/shared/components/cards/Icons.astro +++ b/shared/components/cards/Icons.astro @@ -10,8 +10,9 @@ interface Props { const { title, type = 'outline' } = Astro.props -// Dev preview limits icons to 20 (see BaseLayout). -const limit = 20 +// The dev server renders only the first 20 icons so the page stays fast; +// `astro build` (the zip package and production site) renders all of them. +const limit = import.meta.env.DEV ? 20 : Infinity const entries = Object.entries(icons as Record }>) .filter(([, icon]) => icon.svg?.[type])