-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Investigate hanging grid components #5892
Comments
@aagonzales diving into this with @tw15egan, any chance we could get some examples for how these would be used in product to try so that we can try and build them out and see how things work? 👀 |
Hey @aagonzales! 👋 Was hoping to work with @tw15egan this week on this, any chance you had examples handy? |
@joshblack @tw15egan can you try looking at example on the website first. Most of the product example I have will be screen shots and not files with the grid turned on. After I finish my release work I can look at digging up and documenting some clear specs. Good places to look in the mean time: Also there are a lot of great Watson example work in this folder (i can't speak to its correct grid usage though atm): https://ibm.box.com/s/xtsoax4i4jsgy7fnevmm8hidbzqtcm2o |
@aagonzales when we were diving in last week we looked at the website and I think we found the following examples for hanging content: Let me know if I missed any! Based on the list above, it seemed like we were missing:
For the watson folder, are there any particular files I should be looking for? It's hard navigating through and seeing which files include a hanging moment or not. For more info, a lot of the grid work is challenging since it involves aligning containers on columns and, unfortunately, anything inside a container can't really align to a column since there is no sub grid support on the web (Although we're hopeful that this will be better supported in the future for CSS Grid). This is where the request for examples come from so we can see if we can fit a component in this model or if it would need to be nested in a container 👀 |
Hell yeah, thanks you two! This rocks 🎸 |
TLDR: Trying to replicate all the grid modes in code is super messy and hard, and developers will likely get it wrong even if we give them ways to do it. I started playing around in codesandbox with some ideas and seeing how things could be laid out. Trying to build these layouts is super confusing and tricky, since components aren't grid aware, any dev building will have to either manually hang something if using the wide/standard grid, or manually add padding back in for components that should not hang if using condensed or narrow modes. For designs using “narrow” you could just use the default/wide grid mode and add a hang class/prop manually. Alternatively you could also use the narrow prop per row or column to remove the left padding/margin, but then you run into the issue if there are other items in that row/column that should not hang. Which is why it might make sense to do it per component. Where things get really weird is condensed. A dev would likely only use this at the row level or column level, however you’d have to be careful not to put anything in that column/row that shouldn’t hang. Note: our grid doesn't currently support column level modes/classnames, although could be added. Only supported at entire grid or row levels. To manually "hang" components it would be on the developer to know which components should hang so they can add the correct class (or prop if we added that) to each of them. Could get messy real quick when building out an entire application. We've seen this ourselves when building out components for the gatsby theme and website, and that's with our designers who understand how the grid should work by our side working closely. Could possibly do something where if "narrow" was set at the grid level, then any components inside the grid that should hang, would hang, this would need a lot of testing and could get messy. Not sure there would be a logical way to do this with condensed. Condensed would need to stay at grid/row/column level, and again, then its on the developer to make sure they manually add padding back in for components that shouldn't hang if inside those grid classes. |
Proposed next steps for Grid
|
Component that would/could hang in the gutter of the grid:
The text was updated successfully, but these errors were encountered: