-
-
Notifications
You must be signed in to change notification settings - Fork 384
Description
Describe the feature in detail (code, mocks, or screenshots encouraged)
In order to integrate Skeletons styles into the Storybook framework several steps need to be taken to apply the styles in Storybook.
Requirements to get it working:
- installed SvelteKit, Tailwind, Skeleton, and Storybook in a single project
- updated the example components inserted as part of the Storybook setup to use Tailwind styles
- had to import the global stylesheet app.pcss in .storybook > preview.ts to enable Tailwind styles
- then switched the Button component styles to Skeleton - initially they were not working
- setup a Storybook Decorator (a wrapping component) that included the .dark class for enabling Tailwind dark
- added data-theme="skeleton" to the Decorator as well. This enabled Skeleton styles
@endigo9740 did a full test of the @storybook/addon-themes plugin. Unfortunately the results were mixed:
- This does enable a quick toggle for Tailwind's light/dark mode using the .dark class strategy
- They provide a means to adjust the wrapping data-theme property, but this does not seem to be in a functional state.
- The plugin also doesn't not appear to let you use both the mode and theme toggles in parallel
--> [Bug]: @storybook/addon-themes withThemeByDataAttribute decorator not working storybookjs/storybook#26625
The integration guide will be based around how that pans out. If we can use the plugin, it'll be 1000x easier for most users. If not, then we may look to create a universal wrapper component (the Decorator) that implements this. For most Skeleton users they will need to be able to toggle mode/theme at will
If they stall or don't fix the plugin quickly though we'll likely consider building either a custom Decorator -or- a custom plugin that replicates the required features specifically for Skeleton's use case
(thank you @endigo9740 for doing the actual hard work so far)
What type of pull request would this be?
Docs