area17 / blast

Storybook for Laravel Blade 🚀
https://dev.to/area17/getting-started-with-blast-storybook-for-laravel-blade-c5c
Apache License 2.0
262 stars 37 forks source link

Custom Viewports #90

Closed mrtimbrook closed 1 year ago

mrtimbrook commented 1 year ago

Add support for custom viewports and generating them from a tailwind config via storybook_viewports option in config/blast.php. (#85)

It supports an array with the structure found in the Storybook docs and it can also use your Tailwind config to generate the viewports for you by setting the value to 'tailwind'.

It supports the various ways you can define breakpoints in Tailwind using these rules:

Disabled viewports (default)

'storybook_viewports' => false

Tailwind viewports (default)

'storybook_viewports' => 'tailwind'

Custom viewports

'storybook_viewports' => [
    'kindleFire2' => [
        'name' => 'Kindle Fire 2',
        'styles' => [
            'width' => '600px',
            'height' => '963px',
        ],
    ],
    'kindleFireHD' => [
        'name' => 'Kindle Fire HD',
        'styles' => [
            'width' => '533px',
            'height' => '801px',
        ],
    ],
],
mrtimbrook commented 1 year ago

Updated it to use 'tailwind' as the default as it will fallback to false if the tailwind config isn't found.