3.5 KiB
SkeletonLabs Upgrade Notes (December 2025)
Overview
This document tracks the process of upgrading the SkeletonLabs UI library (from v3 to v4.7.4) within the Aether SvelteKit project. The primary goal is to resolve build issues caused by incompatibility with Svelte 5 and Tailwind CSS v4, and to integrate the updated library correctly.
Current Status (Pre-Upgrade)
- SkeletonLabs Version: v3.2.2 (as per
package.jsonat commit90ee6bb1) - Target Version: v4.7.4
- Issue: Previous attempts to upgrade SkeletonLabs to v4.7.4 resulted in a persistent, blocking build error:
[@tailwindcss/vite:generate:build] Cannot use@variantwith unknown variant: mdoriginating fromnode_modules/@skeletonlabs/skeleton/src/index.css. This indicates a fundamental incompatibility in how Tailwind CSS v4 processes SkeletonLabs' pre-compiled CSS. - Svelte Version: Svelte 5 (runes mode)
- Tailwind CSS Version: v4.1.10
Phase 1: Research and Planning (No Code Changes Yet)
Goal
Understand the required migration steps from Skeleton v3 to v4 as per official documentation, specifically to address the @variant build error and ensure compatibility with Svelte 5 and Tailwind CSS v4.
Steps
-
Thoroughly Review Skeleton v3 to v4 Migration Guide:
- Link:
https://www.skeleton.dev/docs/svelte/get-started/migrate-from-v3 - Action: Read the guide carefully to identify all breaking changes related to:
- Tailwind CSS plugin setup in
tailwind.config.ts. - Required changes to
app.cssor any other global CSS files. - Changes in component class names, especially theme-related classes (
preset-*,variant-*, etc.), which could be related to the@varianterror. - The new
Dialogcomponent and how it replaces any previous modal-like components.
- Tailwind CSS plugin setup in
- Deliverable: Summarize the required code changes based on this guide.
- Link:
-
Review Skeleton v4.0 Launch Discussion:
- Link:
https://github.com/skeletonlabs/skeleton/discussions/3920 - Action: Look for community insights, common issues, and suggested solutions related to upgrading.
- Link:
-
Review Skeleton Dialog Documentation:
- Link:
https://www.skeleton.dev/docs/svelte/framework-components/dialog - Action: Understand the API and usage of Skeleton's native dialog component, as this will be the preferred replacement for any missing
<Modal>components.
- Link:
Expected Outcome of Phase 1
A detailed, step-by-step plan for migrating SkeletonLabs from v3 to v4, specifically targeting the resolution of the @variant build error and outlining the new usage of its UI components. This plan will be presented for approval before any code changes are made.
Phase 2: Execution (After Approval)
Steps (To be detailed after Phase 1)
- Update
package.json: Set@skeletonlabs/skeletonand@skeletonlabs/skeleton-svelteto4.7.4. - Adjust
tailwind.config.ts: Apply changes as per migration guide (e.g., plugin configuration). - Adjust
src/app.css: Apply changes as per migration guide (e.g., CSS imports, custom theme definitions). - Run
npm install. - Run
npm run buildandnpm run devto verify the build and functionality. - Replace
Modalcomponents: Update existing components that used an older<Modal>(e.g., fromflowbite-svelteor previous custom efforts) with Skeleton's newDialogcomponent. - Address Svelte 5 reactivity warnings: Fix any warnings related to data handling or non-reactive updates.