v0.41.48 - Migration Guide #250
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
-
See the full release notes
Migration Guide
The new release of Skeleton makes significant changes to the structure of the library. To make the migration process easier, we've provided a detailed guide below to walk you through the process.
Please read each step carefully.
1. Tailwind Config
https://skeleton.brainandbonesllc.com/guides/tailwind
@brainandbones/skeleton/tailwind.cjs
@brainandbones/skeleton/tailwind/theme.cjs
2. Stylesheet Updates
https://skeleton.brainandbonesllc.com/guides/styling
all.css
stylesheet.all.css
your root layout should contain these three stylesheets, imported in this order:all.css
stylesheetIf you use
all.css
or import thetailwind.css
stylesheets make sure to remove the @tailwind directives from your global stylesheet. Failure to do so will mean certain styles, like typography headings, will not work!3. Migrate to Tailwind Elements
See the release notes for a full explanation of this new feature or checkout the new Features page.
Now, let's review the process of migrating from Svelte Components to Tailwind Elements.
Migrate a Button
https://skeleton.brainandbonesllc.com/tailwind/buttons
To begin, make sure to remove the Button import in your
script
tag. This is no longer needed!Here's an example of a the old Button component:
This now becomes a native button element with the classes
btn btn-filled-primary
:Visually, the button will operate very similar to the Component version, but it's now much easier to override styles using your global stylesheet. This also allows for features like SvelteKit link options, which was not possible with components!
Migrate a Card
https://skeleton.brainandbonesllc.com/tailwind/cards
Similar to the button migration, we remove the import statement in your
script
tag.Here's an example of an old Card component:
This can now be converted to either a native
anchor
ordiv
element, with the newcard
classes applied. Thecard-body
class is optional, but it will add thep-4
padding class for you.If you need a more complex card element with a header, body, and footer - use the following structure:
Migrating Lists/ListItem
See the List changes here:
#194 (comment)
In short, we've split this in half. We now have Tailwind Element Lists (OL/LI/DL/NAV) and Svelte Component Listboxes (aka selection lists).
If you need to replicate a highlighted navigation list, like our documentation site sidebar, you can reference how it was built here:
https://github.com/Brain-Bones/skeleton/blob/dev/src/docs/DocsNavigation/DocsSidebar.svelte
Migrating Other Component
See the dedicated documentation pages for each Tailwind Element.
5. Remove Deprecated Svelte Components
If you need to review the old component docs, they may be found here:
Note these pages are currently delisted from the docs site menu and will be removed alongside the components in the following release!
6. Breaking Changes to Existing Components
In addition to the new Elements, many existing components received major updates, both structural and visual. The goal was to bring consistency across the library - including updates to prop names, visual styles, and more. A full list of the changes have been provided in this ticket.
Please note the following,
If you experience an issue with a component after updating, please reference this document or the component's documentation page. It's very likely due to one of these changes!
Tips and Recommendations
Here's a few tips and tricks to make the migration process easier.
Getting Support
If you encounter issues, please feel free to reach out. The Skeleton crew is available nearly 24/7 to help troubleshoot via one of the following methods.
#support-threads
channel on DiscordThanks for all your continued support! We hope you enjoy all the new features and updates!
Beta Was this translation helpful? Give feedback.
All reactions