-
Notifications
You must be signed in to change notification settings - Fork 195
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
feat(storybook): add a shared decorator for group rendering and static color settings #2398
Conversation
6887118
to
e536999
Compare
🚀 Deployed on https://pr-2398--spectrum-css.netlify.app |
File metricsSummaryTotal size: 3.92 MB* 🎉 No changes detected in any packages * Size determined by adding together the size of the main file for all packages in the library.* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
e536999
to
9b051ff
Compare
508fb2b
to
2350e5c
Compare
400e282
to
7b32a94
Compare
246513e
to
d397535
Compare
5eea5f5
to
8a4cb1b
Compare
bdecdc6
to
aeb087b
Compare
fa503fa
to
0887029
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continuing review on this one! Here's a few more comments. Also, once I've clicked on a static color story, I'm seeing that background color persist after I click away to a different, non-static-color story. 🤔
</div> | ||
<div class="spectrum-CoachMark-content"> | ||
Pixel brushes use pixels to create brush strokes, just like in other design and drawing tools. Start drawing, and zoom in to see the pixels in each stroke. | ||
</div> | ||
<div class="${rootClass}-footer"> | ||
${hasPagination ? html`<div class="spectrum-CoachMark-step"><bdo dir="ltr">2 of 8</bdo></div>` : ''} | ||
${when(hasPagination, () => html`<div class="spectrum-CoachMark-step"><bdo dir="ltr">2 of 8</bdo></div>`)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dig this refactoring with when
that you're doing throughout this PR 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I've officially looked at all the code changes 🎉 Between my reviews, it looks like there's a few things to be addressed, so let me know when you need a re-review from me.
@@ -4,9 +4,9 @@ import { ifDefined } from "lit/directives/if-defined.js"; | |||
import { styleMap } from "lit/directives/style-map.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the visual differences I was seeing in ActionMenu are probably due to these changes in popover. This has been a notoriously tricky one. Recently I did some work to address an issue with Storybook not having the correct offset which seems to be reverted with this refactor (though I agree a refactor is a good idea for this component). And we had so much trouble with nested popovers that we chose to show them statically. Hopefully you can find a way to use this refactored code and still have the offset reflect the spec.
}, | ||
trigger: (passthroughs) => ActionButton({ | ||
label: "Hop on pop(over) 2", | ||
label: "Grand-pop(over)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahaha excellent
98cd42f
to
aa659c8
Compare
aa659c8
to
b3d69af
Compare
Description
Many storybook stories require adding layout and/or padding in order to view variants together or snapshot focus states. The goal of this PR is to unify this effort in a shared decorator that can be customized using a new
customStorybookStyles
object that is leveraged in a story's args settings.The default storybook styles applied by the decorator are:
Any settings added by the story will override these values. You can unset a value completely using
undefined
, i.e.:How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Note: All values set by this decorator should appear as inline-styles assigned to the #root-inner element.
To-do list