Skip to content
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

Add an example of v4's media component in the flex utils docs #33207

Merged
merged 3 commits into from
Mar 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions site/content/docs/5.0/utilities/flex.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,34 @@ Responsive variations also exist for `align-content`.
{{< /flex.inline >}}
{{< /markdown >}}

## Media object

Looking to replicate the [media object component](https://getbootstrap.com/docs/4.6/components/media-object/) from Bootstrap 4? Recreate it in no time with a few flex utilities that allow even more flexibility and customization than before.

{{< example >}}
<div class="d-flex">
<div class="flex-shrink-0">
{{< placeholder width="100" height="100" color="#999" background="#e5e5e5" text="Image" >}}
</div>
<div class="flex-grow-1 ms-3">
This is some content from a media component. You can replace this with any content and adjust it as needed.
</div>
</div>
{{< /example >}}

And say you want to vertically center the content next to the image:

{{< example >}}
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
{{< placeholder width="100" height="100" color="#999" background="#e5e5e5" text="Image" >}}
</div>
<div class="flex-grow-1 ms-3">
This is some content from a media component. You can replace this with any content and adjust it as needed.
</div>
</div>
{{< /example >}}

## Sass

### Utilities API
Expand Down