-
Notifications
You must be signed in to change notification settings - Fork 47
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
Layout::Grid
- documentation (HDS-4650)
#2772
base: hds-4532-grid-component
Are you sure you want to change the base?
Layout::Grid
- documentation (HDS-4650)
#2772
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
394d504
to
275a00a
Compare
6352dea
to
da6b332
Compare
275a00a
to
4c8cc80
Compare
6fceb6f
to
88a1327
Compare
3b722e2
to
5d40954
Compare
Layout::Grid
- documentation (HDS-4650)Layout::Grid
- documentation (HDS-4650)
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.
@KristinLBradley left a few minor comments, nothing major that I can see
0586955
to
7f5c4b8
Compare
5d40954
to
ac7b7d7
Compare
Co-authored-by: Lee White <lee.white@hashicorp.com>
c29456a
to
0f1d026
Compare
</Hds::Layout::Grid> | ||
``` | ||
|
||
### colspan & rowspan |
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.
[Suggestion] Adding some of the basic examples from the showcase for colspan
and rowspan
could help show how these arguments work in a simpler manner than the one example provided right now. The min-height example seems like a more nuanced use case.
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 didn't want to make this section too long and to me these features seemed fairly straight forward to understand so I though one example could be sufficient. I could be wrong though. @didoo what do you think?
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 agree with @KristinLBradley here, I think a single example with both rowspan/colspan is clear. What I maybe would do it to justify why there are three columns in the grid when in reality visually only two are needed
|
||
**Important** | ||
|
||
The examples below are meant to show how one _could_ use the `Layout::Grid` component to implement certain common/standard UI patterns. They're **not** meant to be taken literally as they are and be used in production code. Also, some of these patterns are already implemented directly in HDS components that are ready to use. |
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.
[Question] Are there HDS components that implement the two patterns shown in the docs? If so, we should link to those components in the sections below where applicable.
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 just sort of disclaimer language that I followed from what @didoo had also included in the Flex component docs. I'll update it to say some of the patterns "may" already be implemented.
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 only pattern that is similar is the RadioCard group, but it's implemented using flex, not grid.
…eature to match Flex docs
… closely and fix heading levels
Co-authored-by: Dylan Hyun <dylan.hyun@hashicorp.com>
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 did another pass an left a few comments/suggestions
// COMPONENTS > GRID | ||
|
||
#show-content-layouts-grid { | ||
.doc-grid-outline-children > * { |
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.
see comment below about the possibility of removing this outlining
<Doc::Placeholder @height="40px" @text="Item 1" @background="#e4e4e4" /> | ||
<Doc::Placeholder @height="40px" @text="Item 2" @background="#e4e4e4" /> | ||
<Doc::Placeholder @height="40px" @text="Item 3" @background="#e4e4e4" /> | ||
<Doc::Placeholder @height="40px" @text="Item 4" @background="#e4e4e4" /> |
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.
[suggestion] Since we are already declaring the background color inline in the snippet, what about using different colors to differentiate the items (with the benefit of making outlining them not necessary anymore? you may want to leave the outline only on the grid container, in case)
<Doc::Placeholder @height="40px" @text="Item 1" @background="#e4e4e4" /> | |
<Doc::Placeholder @height="40px" @text="Item 2" @background="#e4e4e4" /> | |
<Doc::Placeholder @height="40px" @text="Item 3" @background="#e4e4e4" /> | |
<Doc::Placeholder @height="40px" @text="Item 4" @background="#e4e4e4" /> | |
<Doc::Placeholder @height="40px" @text="Item 1" @background="#e4c5f3" /> | |
<Doc::Placeholder @height="40px" @text="Item 2" @background="#e5ffd2" /> | |
<Doc::Placeholder @height="40px" @text="Item 3" @background="#d2f4ff" /> | |
<Doc::Placeholder @height="40px" @text="Item 4" @background="#fff8d2" /> |
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.
same for the other examples
|
||
Every child of the **grid container** will be stretched to fit evenly within the underlying grid column tracks behaving as a **grid item** (for details on what this means, refer to the guide linked at the top of the page). | ||
|
||
In some cases, it may be necessary to wrap one or more content items within the optional `Layout::Grid::Item` component. i.e., to group content together within a column or row, prevent content from being stretched to fit the underlying grid column width, or to make use of `rowspan` and `colspan` options in order to create more complex layouts. (See below for more details and examples on these features.) |
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.
In the Flex
documentation I've added a note about not using the item unless necessary, see if you want to port it over here too.
</Hds::Layout::Grid> | ||
``` | ||
|
||
!!! Info |
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.
Ahh I see you've moved it here. Mmm, I think it's a bit lost here, no?
|
||
### Preventing content stretch | ||
|
||
```handlebars |
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.
[praise] Nice example! 🙌
(I copied it to Flex
too 😀)
## 4.19.0 | ||
|
||
TODO |
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.
Let's leave this to the automation
## 4.19.0 | |
TODO |
|
||
Use the `@align` argument to align grid items to the "start", "end", "center" or "stretch" them within the grid parent. | ||
|
||
Note: The `Grid` parent will need a height set for the affect to be visible. |
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.
Note: The `Grid` parent will need a height set for the affect to be visible. | |
Note: The `Grid` parent will need a height set for the effect to be visible. |
<Doc::Placeholder @height="1.2em" @text="Item 1" @background="#e4e4e4" /> | ||
<Doc::Placeholder @height="1.2em" @text="Item 2" @background="#e4e4e4" /> | ||
<Doc::Placeholder @height="1.2em" @text="Item 3" @background="#e4e4e4" /> | ||
<Doc::Placeholder @height="1.2sem" @text="Item 4" @background="#e4e4e4" /> |
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.
<Doc::Placeholder @height="1.2sem" @text="Item 4" @background="#e4e4e4" /> | |
<Doc::Placeholder @height="1.2em" @text="Item 4" @background="#e4e4e4" /> |
|
||
Note: The following example makes use of nested `Grid` and [Flex](/layouts/flex) components to achieve its layout. This may be overkill in actual practice but demonstrates the possibilities for achieving layouts with just these layout components alone. | ||
|
||
#### Basic 3 column layout |
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.
maybe?
#### Basic 3 column layout | |
#### Basic 3 columns layout |
<Hds::Layout::Grid @columnMinWidth="100%" @gap="16"> | ||
<div> | ||
<Hds::Badge @text="In Preview" @type="outlined" @color="highlight" /> | ||
<Hds::Text::Display @tag="h2" @size="300" @weight="bold">Better together</Hds::Text::Display> | ||
</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.
<Hds::Layout::Grid @columnMinWidth="100%" @gap="16"> | |
<div> | |
<Hds::Badge @text="In Preview" @type="outlined" @color="highlight" /> | |
<Hds::Text::Display @tag="h2" @size="300" @weight="bold">Better together</Hds::Text::Display> | |
</div> | |
<Hds::Layout::Grid @columnMinWidth="100%" @gap="16" as |LG|> | |
<LG.Item> | |
<Hds::Badge @text="In Preview" @type="outlined" @color="highlight" /> | |
</LG.Item> | |
<Hds::Text::Display @tag="h2" @size="300" @weight="bold">Better together</Hds::Text::Display> | |
📌 Summary
If merged, this PR adds web documentation for the
Grid
component.👉 Preview: https://hds-website-git-hds-4650-grid-documentation-hashicorp.vercel.app/layouts/grid
Component implementation PR: #2756
🔗 External links
Layout::Flex
:Layout::Flex
- Component implementation #2751👀 Component checklist
[ ] A changelog entry was added via Changesets if needed (see templates here)💬 Please consider using conventional comments when reviewing this PR.