571- adding responsive preview option#572
Merged
Merged
Conversation
|
flacoman91
commented
May 10, 2026
Comment on lines
+8
to
+33
| const viewportOptions = { | ||
| phone: { | ||
| name: 'Phone', | ||
| styles: { | ||
| width: '390px', | ||
| height: '844px', | ||
| }, | ||
| type: 'mobile', | ||
| }, | ||
| tablet: { | ||
| name: 'Tablet', | ||
| styles: { | ||
| width: '768px', | ||
| height: '1024px', | ||
| }, | ||
| type: 'tablet', | ||
| }, | ||
| desktop: { | ||
| name: 'Desktop', | ||
| styles: { | ||
| width: '1280px', | ||
| height: '900px', | ||
| }, | ||
| type: 'desktop', | ||
| }, | ||
| }; |
Collaborator
Author
There was a problem hiding this comment.
can you give the specific widths you want for the various device breakpoints to appear?
natalia-fitzgerald
approved these changes
May 11, 2026
Collaborator
natalia-fitzgerald
left a comment
There was a problem hiding this comment.
@flacoman91
This is looking great and I can already see the benefit of being able to see the different breakpoints (as shown below).
I noticed a few issues with the way the hero is rendering in Storybook. I will open up a separate ticket to handle these issues.
In the hero with illustration:
- The hero image is filling the width and the height of the container.
- The illustration dimensions should be 470px wide (exact) and 195px high (maximum) (2x: 940px x 390px).
In the hero with photograph:
- The photograph is not rendering.
In the jumbo hero:
- Photo dimensions for small screens should be 600px (exact) x 338px (maximum) but it is rendering as 566px x 342.35px.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses: #571
Adds responsive previews as an option in the storybook interface to view them all at one time.
To test, go to a story, (You can't be on the overview page for a component since thats just a documentation page) select all viewports from the dropdown.
https://cfpb.github.io/design-system-react/pr-previews/pr-572/?path=/story/components-draft-heroes--with-illustration&globals=viewport.isRotated:!false