Fix regression: make media-body consume full available width #15140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The addition of #14801 made media-body not consume the full available width, due to the use of
display: table-cell
. This is problematic when the media body has visible borders or elements floated to its right (see example - v3.2.0 vs v3.3.1).This PR fixes this by applying
width: 100%
to media-body anddisplay: table
to the main media element, as was done in the flag object article referenced from the original feature request issue, #14799.My 2c: I don't think that applying table displays to all media elements is a good idea. Using
table
/table-cell
makes elements behave quite differently and may cause things to break in odd ways.While my suggested change might fix this issue, I'm not sure that it doesn't cause others. I would much rater have vertical alignment and table display as an opt-it, either by specifying an additional class on the
media
element ("media-valign"?) or by making it a completely different component ("flag"?), rather than changing the behavior of an existing component and possibly breaking existing code.If you prefer, I can send a pull request that does that instead.