From 919b4ccb15209d47f7cc3f740654b0bcd5cf1870 Mon Sep 17 00:00:00 2001 From: Nicole Sullivan Date: Tue, 14 Oct 2014 17:09:57 -0400 Subject: Fixes #14799: Add vertical alignment of image in media component Signed-off-by: Jenn Dodd --- less/media.less | 67 ++++++++++++++++++++++++++------------------------------- 1 file changed, 30 insertions(+), 37 deletions(-) (limited to 'less') diff --git a/less/media.less b/less/media.less index 5ad22cd6d..eee1c78f3 100644 --- a/less/media.less +++ b/less/media.less @@ -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; +} // Media list variation // ------------------------- -- cgit v1.2.3 From 42c2918372aaf66d0cf8689d7a4375cdd3279920 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 25 Oct 2014 18:13:35 -0700 Subject: Fix up margins and unnest code --- less/media.less | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'less') diff --git a/less/media.less b/less/media.less index eee1c78f3..292e98dbd 100644 --- a/less/media.less +++ b/less/media.less @@ -2,46 +2,44 @@ // Proper spacing between instances of .media margin-top: 15px; - // Proper spacing of .media-right - .media-right, - .pull-right { - padding-left: 10px; - } - - // Proper spacing of .media-left - .media-left, - .pull-left { - padding-right: 10px; - } - &:first-child { margin-top: 0; } +} - .media-left, - .media-right, - .media-body { - display: table-cell; - vertical-align: top; - } +.media-right, +.media > .pull-right { + padding-left: 10px; +} - .media-middle { - vertical-align: middle; - } +.media-left, +.media > .pull-left { + padding-right: 10px; +} - .media-bottom { - vertical-align: bottom; - } +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} + +.media-middle { + vertical-align: middle; +} + +.media-bottom { + vertical-align: bottom; } // Reset margins on headings for tighter default spacing .media-heading { - margin: 0 0 5px 0; + margin-top: 0; + margin-bottom: 5px; } // Media list variation -// ------------------------- - +// // Undo default ul/ol styles .media-list { padding-left: 0; -- cgit v1.2.3