Skip to content

Integration: Storybook #2567

@TazorDE

Description

@TazorDE

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:

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

Provide relevant links or additional information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest a feature or introduce and update to the project.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions