-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Remove the card columns in favor of a Masonry grid #28922
Conversation
158f183
to
e58c9e8
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.
LGTM 👍, and @mdo?
Thoughts on punting the inclusion of external JS to an example instead of a core component page? We can link to it from the Card docs, but I'd prefer to build something there with Masonry instead of adding it to the core docs. |
But also, yes, definitely down to ditch the card columns lol. |
Examples might be a better place indeed, I'll change it |
Maybe we should simply use native css subgrids to prevent having to use a "card-deck" container or a plugin: Not supported everywhere (anywhere?) but should be since next Bootstrap version I guess. |
@inwardmovement, we'll probably introduce grid in Bootstrap 6 (the next version(5) will still have IE support), but the masonry layout still differs from (sub)gird. |
e58c9e8
to
6cc2142
Compare
Dismissing review since we're moving the demo to the example section
93afb9b
to
9e5c05d
Compare
The masonry example is now moved to the examples section. |
Agreed with @XhmikosR about using the existing Examples layout. That's a little tougher for some of the needs here, but this does feel slightly over-engineered right now. We may end up adding third party JS to more examples, but I don't know when that'd be. Until then, these examples should look and feel isolated from our docs. Here's what I'm leaning towards after taking a crack at this branch (see latest commit): |
I'm gonna fix the conflict later but we should remove the copy example because it requires our docs CSS and JS. |
90a11e5
to
134a47d
Compare
This needs some more work and especially the part with the hardcoded script is something that I personally don't like. Maybe we should link to their docs? Also, I need to rebase and revert the active menu change. |
0a061d4
to
3eb6371
Compare
3eb6371
to
51e2690
Compare
Somehow I missed all this and used .card-columns. Now wanting to go from 4.6 to 5.3 and yuck, .card-columns is broken. My view is x number of columns wide, starting at the upper left going down each column as many as are needed for more or less evenly distributed column counts. There's no getting around the efficiency of having all the cards/images stacked in columns when the images are the same width but different heights. No gaps or wasted screen space; only at the bottom. Does this mean there is no longer a mechanism for columnar lists? It seems in masonry, the best alternative is horizontalOrder: true and within a few rows down is impossible to follow in any reasonable visual order. If anyone has tips... Thanks. |
IMO you'll have more chance of getting an answer by opening a new Discussion. |
Mentioned before in #28891 (comment) and #28076 (comment), we should ditch the card columns in favor of masonry.
Main reasons are:
card-columns
#17882)I've updated the docs and included Masonry via cdnjs, @XhmikosR is that ok for you, or do you have another proposal? (I also watched the releases of masonry github repo so I know when to upgrade)
Edit:
The demo is a example page now. It's also possible to add additional parameters (
async
&intergrity
) to the extra js.TODO:
async
attributeCloses #28076, closes #28439
Card docs: https://deploy-preview-28922--twbs-bootstrap.netlify.com/docs/4.3/components/card/#card-columns-masonry-layout
Example page: https://deploy-preview-28922--twbs-bootstrap.netlify.com/docs/4.3/examples/#integrations
Demo: https://deploy-preview-28922--twbs-bootstrap.netlify.com/docs/4.3/examples/masonry/