-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Fixes #14799: Add vertical alignment of image in media component #14801
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,43 @@ | ||
// Media objects | ||
// Source: http://stubbornella.org/content/?p=497 | ||
// -------------------------------------------------- | ||
|
||
|
||
// Common styles | ||
// ------------------------- | ||
|
||
// Clear the floats | ||
.media, | ||
.media-body { | ||
overflow: hidden; | ||
zoom: 1; | ||
} | ||
|
||
// Proper spacing between instances of .media | ||
.media, | ||
.media .media { | ||
.media { | ||
// Proper spacing between instances of .media | ||
margin-top: 15px; | ||
} | ||
.media:first-child { | ||
margin-top: 0; | ||
} | ||
|
||
// For images and videos, set to block | ||
.media-object { | ||
display: block; | ||
} | ||
// Proper spacing of .media-right | ||
.media-right, | ||
.pull-right { | ||
padding-left: 10px; | ||
} | ||
|
||
// Reset margins on headings for tighter default spacing | ||
.media-heading { | ||
margin: 0 0 5px; | ||
} | ||
// Proper spacing of .media-left | ||
.media-left, | ||
.pull-left { | ||
padding-right: 10px; | ||
} | ||
|
||
&:first-child { | ||
margin-top: 0; | ||
} | ||
|
||
// Media image alignment | ||
// ------------------------- | ||
.media-left, | ||
.media-right, | ||
.media-body { | ||
display: table-cell; | ||
vertical-align: top; | ||
} | ||
|
||
.media { | ||
> .pull-left { | ||
margin-right: 10px; | ||
.media-middle { | ||
vertical-align: middle; | ||
} | ||
> .pull-right { | ||
margin-left: 10px; | ||
|
||
.media-bottom { | ||
vertical-align: bottom; | ||
} | ||
} | ||
|
||
// Reset margins on headings for tighter default spacing | ||
.media-heading { | ||
margin: 0 0 5px 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of replacing all four values, can you do something like: margin-top: 0;
margin-bottom: 5px; That way we know we're explicitly overriding a couple of values, and not all four of the |
||
} | ||
|
||
// Media list variation | ||
// ------------------------- | ||
|
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.
Aside from the alignment for the legacy
.media > .pull-left
, none of this needs to be nested under.media
. The.media
,.media-right
,.media-body
, etc can all be top level selectors here to avoid unnecessary specificity.