v2.0 Migration Guide #1947
endigo9740
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Release Notes
Migration Guide
This guide is geared toward users migrating from either Skeleton v1.x or Skeleton v2 RC. Follow the instruction clearly, and make sure to read this page in full.
Using the Skeleton CLI
If you wish to create a new Skeleton v2 project, you can use the Skeleton CLI as follows:
Migrating v2 Release Candidate Projects
Uninstall the
@rc
tagged versions of the Skeleton core package and Skeleton Tailwind plugin:Install the latest stable release of these two packages:
Note that if you use vite-plugin-tailwind-purgecss, we advise updating this to the latest release as well.
Migrating v1.x Projects
/src/app.postcss
/src/routes/+layout.svelte
(OPTIONAL) Install vite-plugin-tailwind-purgecss to dramatically reduce your production CSS bundle size.
Follow the steps in the sections below. You'll need to update your Tailwind Config, theme registration, and more.
Migrating your Tailwind Configuration
Next, we'll need to migrate
tailwind.config.cjs
to either a Typescript or Javascript format. If your project has Typescript enabled, use.ts
(Typescript) otherwise please opt for.js
(Javascript).Typescript (tailwind.config.ts)
Javascript (tailwind.config.js)
Important
If your project is actively using additional Tailwind plugins, such as Typography, Forms, etc. Then make sure to import and apply these as well. They should be added directly above the
skeleton()
plugin.Migrating Themes
Theme configuration is now handled via your Skeleton Tailwind plugin settings in
tailwind.config.[ts|js]
.Preset Themes
/src/app.html
and set your active theme via thedata-theme
attribute on thebody
element:If you wish to enable background gradient and other optional preset theme features, see the Enhancements documentation.
Custom Themes
Skeleton themes now use a
CSS-in-JS
format. If you wish to migrate your v1.x theme, use one of the following techniques:Option 1) Use the Theme Generator
Recreate your theme using the updated Theme Generator, which provides themes in the new format.
Option 2) Migrate to the v2 CSS-in-JS format
:root
selector and paste them into the CSS field on the leftconverted
object, notconverted
itself).Create a new file in the root of your project, such as
my-custom-theme.[ts|js]
to house your new theme.Copy the following template into this file, then add your converted CSS-in-JS theme properties to the
properties
field:tailwind.config
, then register the custom theme within the Skeleton plugin settings as follow:/src/app.html
and set your active theme via thedata-theme
attribute on thebody
element:Migrating Core Features
The following features include breaking changes that may affect your project.
Table of Contents
This features has been reimplemented from the ground up. We recommend you follow the updated documentation.
Drawer, Modal, and Toast Stores
We've refactored the stores for all singleton-based overlay features to help prevent known SvelteKit SSR issues. This includes two notable changes:
initializeStore()
in your root layout.View the documentation for each respective feature for more information:
Skeleton Data Tables
This feature has been completely removed in Skeleton v2. We now recommend Svelte Simple Datatables paired with Skeleton's Table Element styles.
Deprecated Autocomplete Props
The deprecated
whitelist | blacklist
props have been removed, please move toallowlist | denylist
respectivelyLegacy Typography System
The legacy "on-by-default" Typography system has now been completely phased out. Please migrate to the new opt-in system covered in the Typography documentation. In most cases this requires appending a single class to each typographic element.
Paginator Offset Prop
The
PaginatorSettings
parameter calledoffset
has now been renamed topage
for better semantics.Beta Was this translation helpful? Give feedback.
All reactions