-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Stack.Item] Add Stack.Item properties to style guide documentation #772
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
Conversation
cf2d77c
to
f0f792d
Compare
f0f792d
to
a8264e3
Compare
ad54b94
to
48fe810
Compare
src/components/Stack/README.md
Outdated
|
||
| Prop | Type | Description | Default | | ||
| -------- | ------- | -------------------------------------------------------------------------- | ------- | | ||
| fill | boolean | Adjust vertical alignment of elements to the right edge of another element | false | |
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.
| fill | boolean | Adjust vertical alignment of elements to the right edge of another element | false | | |
| fill | boolean | Fill the available horizontal space in the stack with the item | false | |
src/components/Stack/README.md
Outdated
|
||
## Stack item | ||
|
||
Use item to align buttons or secondary content to the right edge of another element, allowing it to wrap below on small screens. |
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.
The Stack
automatically wraps each of its children in a Stack.Item
(unless the implementor has already wrapped a child/children with Stack.Item
). It may be helpful to mention that, and then explain that you can use the subcomponent directly with the fill
prop when you want the item to fill the available horizontal space in the stack (and mention they can see this in action in the "Stack where a single item fills the remaining space" example above).
48fe810
to
21d8c8b
Compare
21d8c8b
to
750cd42
Compare
750cd42
to
30656e0
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.
Looks good! But we can't 🎩 it yet :(
src/components/Stack/README.md
Outdated
|
||
## Stack item | ||
|
||
The Stack will implicitly wrap each of its children in a Stack.Item unless used directly. Use Stack.Item as a subcomponent with the fill prop to have the item fill the available horizontal space in the stack. See "Stack where a single item fills the remaining space" as an example of this above. |
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.
The Stack will implicitly wrap each of its children in a Stack.Item unless used directly 👍 I'm glad we've finally gotten this documented ❤️
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.
Yes! I'm also happy to see this get documented!
I don't think we use determiners before component names, unless it's followed by the word "component". So, something like The stack component will implicitly...
.
In documentation, we also use sentence case for components, ie: a stack item vs. Stack.Item. https://docs.google.com/document/d/1zVDsHIWhoir2svRjdtSdRbD_ruTz3K1nAJcQLGPVQwM/edit#heading=h.lm3ja0wzryt7
It might be a good idea to link to the example using a named anchor. The resource list documentation has an example of this.
src/components/Stack/README.md
Outdated
|
||
| Prop | Type | Description | Default | | ||
| -------- | ------- | ------------------------------------------------------------- | ------- | | ||
| fill | boolean | Fil the available horizontal space in the stack with the item | false | |
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.
Would it be worth it to add these to the interface as well?
30656e0
to
e8fb11a
Compare
e8fb11a
to
1b43136
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.
This is great! Just a couple comments.
1975dcc
to
2066e36
Compare
2066e36
to
685f1c3
Compare
685f1c3
to
36cada3
Compare
src/components/Stack/README.md
Outdated
|
||
## Stack item | ||
|
||
The stack component will wrap each item in a stack item component regardless if the item has already been deliberately wrapped in a stack item component or not. However, When wrapping the stack component with a stack item deliberately, use the fill prop to force the item to fill the remaining horizontal space in the stack. See the [Stack where a single item fills the remaining space](#single-item-fills-remaining-space) example. |
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.
Hey @selenehinkley I updated this again like we discussed! Mind taking another look? 🙂
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.
The stack component will wrap each item in a stack item component regardless if the item has already been deliberately wrapped in a stack item component or not.
To me that sounds like an item could potentially be wrapped twice in a stack item component. The word "regardless" sounds like it ignores what it's been given and goes ahead and wraps another stack item around it.
When what it actually does is wrap each item in a stack item component if it hasn't already been deliberately wrapped.
However, When wrapping the stack component with a stack item deliberately, use the fill prop...
This sounds like it's mandatory. To me, this reads like "if you decide to wrap it deliberately, you must use the fill prop". I think it's the word "however".
(Also, the W
needs to be lowercase).
One more thing... would it make sense to mention why else a stack item would be used? One other use case is if a consumer wants to wrap multiple elements so they're treated like one item.
import * as styles from '../../Stack.scss'; | ||
|
||
export interface Props { | ||
/** Elements to display inside stack */ |
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.
/** Elements to display inside stack */ | |
/** Elements to display inside the item */ |
36cada3
to
99301e3
Compare
99301e3
to
cfe4949
Compare
cfe4949
to
7c869c2
Compare
7c869c2
to
3eec4ea
Compare
3eec4ea
to
8dee88c
Compare
Testing is failing for the |
|
||
## Stack item | ||
|
||
The stack component will treat multiple elements wrapped in a stack item component as one item. By default, each individual element is treated as one stack item. Use the fill prop on a single stack item component to make it fill the rest of the available horizontal space. See the [Stack where a single item fills the remaining space](#single-item-fills-remaining-space) example. |
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.
Perfect!! ❤️
Drop zone shouldn't be affected by this PR and it looks like all the checks are passing. 🎉 |
WHY are these changes introduced?
Resolves #536
Stack Item properties needed to be listed in the documentation.
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
🎩 checklist