Skip to content
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

Add Storybook preview styles that allow for sticky header/column #1834

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

rogermparent
Copy link
Contributor

@rogermparent rogermparent commented Jun 3, 2022

storybook-sticky-demo.mp4

This PR adds width and height 100% styles to Storybook's preview, allowing for the sticky UI elements recently introduced to be seen in Storybook. This does require viewports to be disabled, but after that the feature can be seen.

Copy link
Contributor

@sroy3 sroy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a way to disable viewports on specific stories. I haven't done it yet, but I think it should be as simple as overriding the default viewport parameter in preview.ts to add disable

@rogermparent
Copy link
Contributor Author

I think there is a way to disable viewports on specific stories.

That could be useful for a story that specifically targets the sticky UI use case, but since all the stories that are currently there have their own use cases that can benefit from viewports I'm not sure where we'd do so.

@rogermparent rogermparent enabled auto-merge (squash) June 6, 2022 19:44
@codeclimate
Copy link

codeclimate bot commented Jun 6, 2022

Code Climate has analyzed commit 2b0ee97 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.9% (0.0% change).

View more on Code Climate.

@rogermparent rogermparent merged commit ef364b6 into main Jun 6, 2022
@rogermparent rogermparent deleted the sticky-storybook-preview branch June 6, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants