8000 Custom Viewports by mrtimbrook · Pull Request #90 · area17/blast · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Custom Viewports #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 14, 2023
Merged

Custom Viewports #90

merged 5 commits into from
Jul 14, 2023

Conversation

mrtimbrook
Copy link
Collaborator
@mrtimbrook mrtimbrook commented Jul 13, 2023

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:

  • If the value is a string, it uses that
  • If the value is an array with only a min or only a max it will use that value
  • If the value is an array with both a min and max value it will use the min value
  • raw values will be ignored

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
Copy link
Collaborator Author

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

@mrtimbrook mrtimbrook merged commit c5debb1 into 1.x Jul 14, 2023
@mrtimbrook mrtimbrook deleted the custom-viewports branch July 14, 2023 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0