From f5fd5e752329d92d3fde2e3f37f3406db62c400b Mon Sep 17 00:00:00 2001 From: Giuliano Velli Date: Fri, 20 Apr 2012 17:54:51 +0200 Subject: [PATCH 1/3] Added Medias code and documentation Added media.less and edited bootstrap.less and responsive.less to manage media components. Added a section to the documentation (Media, in components.html) outlining how Medias work. Edited bootstrap.css and bootstrap-responsive.css to add the code for the demos Signed-off-by: Giuliano Velli --- docs/assets/css/bootstrap-responsive.css | 16 ++- docs/assets/css/bootstrap.css | 51 ++++++++ docs/components.html | 160 +++++++++++++++++++++++ less/bootstrap.less | 1 + less/media.less | 68 ++++++++++ less/responsive.less | 14 ++ 6 files changed, 308 insertions(+), 2 deletions(-) create mode 100644 less/media.less diff --git a/docs/assets/css/bootstrap-responsive.css b/docs/assets/css/bootstrap-responsive.css index d9fa91d6c1..d87edf5096 100644 --- a/docs/assets/css/bootstrap-responsive.css +++ b/docs/assets/css/bootstrap-responsive.css @@ -114,6 +114,18 @@ padding-left: 10px; padding-right: 10px; } + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } .modal { position: absolute; top: 10px; @@ -169,9 +181,9 @@ width: 100%; min-height: 28px; /* Make inputs at least the height of their button counterpart */ - + /* Makes inputs behave like true block-level elements */ - + -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 495188af7f..69cc2f0bcd 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -3562,6 +3562,57 @@ a.thumbnail:hover { .thumbnail .caption { padding: 9px; } +.media, +.media-body { + overflow: hidden; + *overflow: visible; + zoom: 1; +} +.media { + margin-bottom: 10px; +} +.media .media { + margin-top: 20px; +} +.media .pull-left { + margin-right: 10px; +} +.media .pull-right { + margin-left: 10px; +} +.media .media-object { + display: block; +} +.medias { + margin-top: 20px; + margin-left: 0; + list-style-type: none; +} +.medias .media { + padding-bottom: 10px; + border-bottom: 1px solid rgba(0, 0, 0, 0.07); +} +.medias > .media:last-child { + margin: 0; + border-bottom: none; +} +.medias > .media .media { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} +.media-box { + margin-bottom: 19px; + padding: 10px; + background-color: #fff; + border: 1px solid rgba(0, 0, 0, 0.09); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); +} .label { padding: 1px 4px 2px; font-size: 10.998px; diff --git a/docs/components.html b/docs/components.html index 10b2aec202..4f3b0bace9 100644 --- a/docs/components.html +++ b/docs/components.html @@ -101,6 +101,7 @@
  • Badges
  • Typography
  • Thumbnails
  • +
  • Medias
  • Alerts
  • Progress bars
  • Miscellaneous
  • @@ -1680,6 +1681,165 @@ + +
    + + +
    +
    +

    Default media

    +

    The default media allow to float a media object (images, video, audio) to the left or right of a content block

    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    +
    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    +
    +
    +
    +
    +
    +

    Media list

    +

    With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).

    +
      +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      +
      + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      +
      +
      +
      +
    • +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      +
      +
    • +
    +
    +
    + +
    +
    +

    Media Box

    +

    Wrap your medias and media lists inside a simple box.

    +
    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    +
    +
    +
    +
    + + + +
      +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      +
      +
      +
    • +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      +
    • +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      +
    • +
    +
    +
    +

    The markup

    +

    The required markup for medias is light and straightforward. Here's a look at the default setup:

    +
    +<div class="media">
    +	<a class="pull-left" href="#"><img class="media-object" src="http://placehold.it/64x64"></a>
    +	<div class="media-body">
    +		<h4>This is the title</h4>
    +		<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    +	</div>	
    +</div>
    +
    +

    The HTML content needed for a media list

    +
    +<ul class="medias">
    +	<li class="media">
    +		<a class="pull-left" href="#"><img class="media-object" src="http://placehold.it/64x64"></a>
    +		<div class="media-body">
    +			<h4>This is the title</h4>
    +			<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    +		</div>
    +	</li>
    +</ul>	
    +
    +

    Use a <div> with a class .media-box to wrap your media (works with media lists too) in a styled box.

    +
    +<div class="media-box">
    +	<div class="media">
    +		<a class="pull-left" href="#"><img class="media-object" src="http://placehold.it/64x64"></a>
    +		<div class="media-body">
    +			<h4>This is the title</h4>
    +			<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    +		</div>
    +	</div>
    +</div>
    +
    +
    + +
    +
    + + +
    diff --git a/less/bootstrap.less b/less/bootstrap.less index d115e95671..4802fb4f62 100644 --- a/less/bootstrap.less +++ b/less/bootstrap.less @@ -52,6 +52,7 @@ // Components: Misc @import "thumbnails.less"; +@import "media.less"; @import "labels.less"; @import "badges.less"; @import "progress-bars.less"; diff --git a/less/media.less b/less/media.less new file mode 100644 index 0000000000..87ea1bc1e4 --- /dev/null +++ b/less/media.less @@ -0,0 +1,68 @@ +// COMMON STYLES +// ------------- + +.media, .media-body { + overflow:hidden; + *overflow:visible; + zoom:1; +} +.media { + margin-bottom: 10px; +} +.media .media { + margin-top: 20px; +} +.media .pull-left { + margin-right: 10px; +} +.media .pull-right { + margin-left: 10px; +} +.media .media-object { + display: block; +} + +// Media list +.medias { + margin-top: 20px; + margin-left: 0; + list-style-type: none; +} +.medias .media { + padding-bottom: 10px; + border-bottom: 1px solid rgba(0, 0, 0, .07); +} +.medias > .media:last-child { + margin: 0; + border-bottom: none; +} +.medias > .media .media { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} + +// Media box +.media-box { + margin-bottom: 19px; + padding: 10px; + background-color: #fff; + border: 1px solid rgba(0,0,0,.09); + .border-radius(4px); + .box-shadow(1px 1px 2px rgba(0, 0, 0, 0.1)); +} + +@media (max-width: 480px) { + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } +} \ No newline at end of file diff --git a/less/responsive.less b/less/responsive.less index 98485eebd8..b72aa90e2e 100644 --- a/less/responsive.less +++ b/less/responsive.less @@ -106,6 +106,20 @@ padding-left: 10px; padding-right: 10px; } + + // Medias + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } // Modals .modal { From 4fbb400754986b969b40fc12eacfd332ace1a174 Mon Sep 17 00:00:00 2001 From: Giuliano Velli Date: Fri, 20 Apr 2012 17:54:51 +0200 Subject: [PATCH 2/3] Added Medias code and documentation Fix for Issue #1711 Added media.less and edited bootstrap.less and responsive.less to manage media components. Added a section to the documentation (Media, in components.html) outlining how Medias work. Edited bootstrap.css and bootstrap-responsive.css to add the code for the demos Signed-off-by: Giuliano Velli --- docs/assets/css/bootstrap-responsive.css | 16 ++- docs/assets/css/bootstrap.css | 51 ++++++++ docs/components.html | 160 +++++++++++++++++++++++ less/bootstrap.less | 1 + less/media.less | 68 ++++++++++ less/responsive.less | 14 ++ 6 files changed, 308 insertions(+), 2 deletions(-) create mode 100644 less/media.less diff --git a/docs/assets/css/bootstrap-responsive.css b/docs/assets/css/bootstrap-responsive.css index d9fa91d6c1..d87edf5096 100644 --- a/docs/assets/css/bootstrap-responsive.css +++ b/docs/assets/css/bootstrap-responsive.css @@ -114,6 +114,18 @@ padding-left: 10px; padding-right: 10px; } + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } .modal { position: absolute; top: 10px; @@ -169,9 +181,9 @@ width: 100%; min-height: 28px; /* Make inputs at least the height of their button counterpart */ - + /* Makes inputs behave like true block-level elements */ - + -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 495188af7f..69cc2f0bcd 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -3562,6 +3562,57 @@ a.thumbnail:hover { .thumbnail .caption { padding: 9px; } +.media, +.media-body { + overflow: hidden; + *overflow: visible; + zoom: 1; +} +.media { + margin-bottom: 10px; +} +.media .media { + margin-top: 20px; +} +.media .pull-left { + margin-right: 10px; +} +.media .pull-right { + margin-left: 10px; +} +.media .media-object { + display: block; +} +.medias { + margin-top: 20px; + margin-left: 0; + list-style-type: none; +} +.medias .media { + padding-bottom: 10px; + border-bottom: 1px solid rgba(0, 0, 0, 0.07); +} +.medias > .media:last-child { + margin: 0; + border-bottom: none; +} +.medias > .media .media { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} +.media-box { + margin-bottom: 19px; + padding: 10px; + background-color: #fff; + border: 1px solid rgba(0, 0, 0, 0.09); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); +} .label { padding: 1px 4px 2px; font-size: 10.998px; diff --git a/docs/components.html b/docs/components.html index 10b2aec202..f30a3348d3 100644 --- a/docs/components.html +++ b/docs/components.html @@ -101,6 +101,7 @@
  • Badges
  • Typography
  • Thumbnails
  • +
  • Medias
  • Alerts
  • Progress bars
  • Miscellaneous
  • @@ -1680,6 +1681,165 @@ + +
    + + +
    +
    +

    Default media

    +

    The default media allow to float a media object (images, video, audio) to the left or right of a content block

    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    +
    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    +
    +
    +
    +
    +
    +

    Media list

    +

    With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).

    +
      +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      +
      + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      +
      +
      +
      +
    • +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      +
      +
    • +
    +
    +
    + +
    +
    +

    Media Box

    +

    Wrap your medias and media lists inside a simple box.

    +
    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    + +
    +

    This is the title

    +

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

    +
    +
    +
    +
    +
    + + + +
      +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      +
      +
      +
    • +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      +
    • +
    • + +
      +

      This is the title

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

      +
      +
    • +
    +
    +
    +

    The markup

    +

    The required markup for medias is light and straightforward. Here's a look at the default setup:

    +
    +<div class="media">
    +	<a class="pull-left" href="#"><img class="media-object" src="http://placehold.it/64x64"></a>
    +	<div class="media-body">
    +		<h4>This is the title</h4>
    +		<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    +	</div>	
    +</div>
    +
    +

    The HTML content needed for a media list

    +
    +<ul class="medias">
    +	<li class="media">
    +		<a class="pull-left" href="#"><img class="media-object" src="http://placehold.it/64x64"></a>
    +		<div class="media-body">
    +			<h4>This is the title</h4>
    +			<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    +		</div>
    +	</li>
    +</ul>	
    +
    +

    Use a <div> with a class .media-box to wrap your media (works with media lists too) in a styled box.

    +
    +<div class="media-box">
    +	<div class="media">
    +		<a class="pull-left" href="#"><img class="media-object" src="http://placehold.it/64x64"></a>
    +		<div class="media-body">
    +			<h4>This is the title</h4>
    +			<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    +		</div>
    +	</div>
    +</div>
    +
    +
    + +
    +
    + + +
    diff --git a/less/bootstrap.less b/less/bootstrap.less index d115e95671..4802fb4f62 100644 --- a/less/bootstrap.less +++ b/less/bootstrap.less @@ -52,6 +52,7 @@ // Components: Misc @import "thumbnails.less"; +@import "media.less"; @import "labels.less"; @import "badges.less"; @import "progress-bars.less"; diff --git a/less/media.less b/less/media.less new file mode 100644 index 0000000000..87ea1bc1e4 --- /dev/null +++ b/less/media.less @@ -0,0 +1,68 @@ +// COMMON STYLES +// ------------- + +.media, .media-body { + overflow:hidden; + *overflow:visible; + zoom:1; +} +.media { + margin-bottom: 10px; +} +.media .media { + margin-top: 20px; +} +.media .pull-left { + margin-right: 10px; +} +.media .pull-right { + margin-left: 10px; +} +.media .media-object { + display: block; +} + +// Media list +.medias { + margin-top: 20px; + margin-left: 0; + list-style-type: none; +} +.medias .media { + padding-bottom: 10px; + border-bottom: 1px solid rgba(0, 0, 0, .07); +} +.medias > .media:last-child { + margin: 0; + border-bottom: none; +} +.medias > .media .media { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} + +// Media box +.media-box { + margin-bottom: 19px; + padding: 10px; + background-color: #fff; + border: 1px solid rgba(0,0,0,.09); + .border-radius(4px); + .box-shadow(1px 1px 2px rgba(0, 0, 0, 0.1)); +} + +@media (max-width: 480px) { + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } +} \ No newline at end of file diff --git a/less/responsive.less b/less/responsive.less index 98485eebd8..b72aa90e2e 100644 --- a/less/responsive.less +++ b/less/responsive.less @@ -106,6 +106,20 @@ padding-left: 10px; padding-right: 10px; } + + // Medias + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + .media .pull-left { + margin-right: 0; + } + .media .pull-right { + margin-left: 0; + } // Modals .modal { From 143fef9f95daca088c1a910fccd07f2b520d8b0b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Sep 2012 18:15:39 -0700 Subject: [PATCH 3/3] overhaul the docs and css to merge into 2.1.2 since this was against master --- docs/assets/css/bootstrap-responsive.css | 4 +- docs/assets/css/bootstrap.css | 70 +++-------- docs/components.html | 141 +++++++++++++++++++++++ docs/templates/pages/components.mustache | 141 +++++++++++++++++++++++ less/media.less | 90 ++++++--------- less/responsive-767px-max.less | 8 +- 6 files changed, 340 insertions(+), 114 deletions(-) diff --git a/docs/assets/css/bootstrap-responsive.css b/docs/assets/css/bootstrap-responsive.css index a0b4f4684f..72814d3f7d 100644 --- a/docs/assets/css/bootstrap-responsive.css +++ b/docs/assets/css/bootstrap-responsive.css @@ -901,10 +901,8 @@ float: none; margin-bottom: 10px; } - .media .pull-left { + .media-object { margin-right: 0; - } - .media .pull-right { margin-left: 0; } .modal { diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 5b8073bf57..ae09c212a4 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -5279,12 +5279,21 @@ a.thumbnail:hover { zoom: 1; } -.media { - margin-bottom: 10px; +.media, +.media .media { + margin-top: 15px; } -.media .media { - margin-top: 20px; +.media:first-child { + margin-top: 0; +} + +.media-object { + display: block; +} + +.media-heading { + margin: 0 0 5px; } .media .pull-left { @@ -5295,58 +5304,9 @@ a.thumbnail:hover { margin-left: 10px; } -.media .media-object { - display: block; -} - -.medias { - margin-top: 20px; +.media-list { margin-left: 0; - list-style-type: none; -} - -.medias .media { - padding-bottom: 10px; - border-bottom: 1px solid rgba(0, 0, 0, 0.07); -} - -.medias > .media.last { - margin: 0; - border-bottom: none; -} - -.medias > .media .media { - padding-bottom: 0; - margin-bottom: 0; - border-bottom: none; -} - -.media-box { - padding: 10px; - margin-bottom: 19px; - background-color: #fff; - border: 1px solid rgba(0, 0, 0, 0.09); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); -} - -@media (max-width: 480px) { - .media .pull-left, - .media .pull-right { - display: block; - float: none; - margin-bottom: 10px; - } - .media .pull-left { - margin-right: 0; - } - .media .pull-right { - margin-left: 0; - } + list-style: none; } .label, diff --git a/docs/components.html b/docs/components.html index f47aecbf19..0605fe8a96 100644 --- a/docs/components.html +++ b/docs/components.html @@ -98,6 +98,7 @@
  • Thumbnails
  • Alerts
  • Progress bars
  • +
  • Media object
  • Misc
  • @@ -1927,6 +1928,7 @@ +
    @@ -2029,6 +2031,7 @@ +
    @@ -2175,6 +2178,144 @@ + +
    + +

    Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.

    + +

    Default example

    +

    The default media allow to float a media object (images, video, audio) to the left or right of a content block.

    +
    +
    + + + +
    +

    Media heading

    + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
    +
    +
    + + + +
    +

    Media heading

    + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
    + + + +
    +

    Media heading

    + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
    +
    +
    +
    +
    +
    +<div class="media">
    +  <a class="pull-left" href="#">
    +    <img class="media-object" src="http://placehold.it/64x64">
    +  </a>
    +  <div class="media-body">
    +    <h4 class="media-heading">Media heading</h4>
    +    ...
    +
    +    <!-- Nested media object -->
    +    <div class="media">
    +      ...
    +    </div>
    +  </div>
    +</div>
    +
    + + +
    + + +

    Media list

    +

    With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).

    +
    +
      +
    • + + + +
      +

      Media heading

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      + +
      + + + +
      +

      Nested media heading

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. + +
      + + + +
      +

      Nested media heading

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. +
      +
      +
      +
      + +
      + + + +
      +

      Nested media heading

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. +
      +
      +
      +
    • +
    • + + + +
      +

      Media heading

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. +
      +
    • +
    +
    +
    +<ul class="media-list">
    +  <li class="media">
    +    <a class="pull-left" href="#">
    +      <img class="media-object" src="http://placehold.it/64x64">
    +    </a>
    +    <div class="media-body">
    +      <h4 class="media-heading">Media heading</h4>
    +      ...
    +
    +      <!-- Nested media object -->
    +      <div class="media">
    +        ...
    +     </div>
    +    </div>
    +  </li>
    +</ul>
    +
    + +
    + + + + diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache index 53936e5d0d..8c3ab81717 100644 --- a/docs/templates/pages/components.mustache +++ b/docs/templates/pages/components.mustache @@ -27,6 +27,7 @@
  • {{_i}}Thumbnails{{/i}}
  • {{_i}}Alerts{{/i}}
  • {{_i}}Progress bars{{/i}}
  • +
  • {{_i}}Media object{{/i}}
  • {{_i}}Misc{{/i}}
  • @@ -1856,6 +1857,7 @@ +
    @@ -1958,6 +1960,7 @@ +
    @@ -2104,6 +2107,144 @@ + +
    + +

    {{_i}}Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.{{/i}}

    + +

    {{_i}}Default example{{/i}}

    +

    {{_i}}The default media allow to float a media object (images, video, audio) to the left or right of a content block.{{/i}}

    +
    +
    + + + +
    +

    {{_i}}Media heading{{/i}}

    + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
    +
    +
    + + + +
    +

    {{_i}}Media heading{{/i}}

    + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
    + + + +
    +

    {{_i}}Media heading{{/i}}

    + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
    +
    +
    +
    +
    {{! /.bs-docs-example }} +
    +<div class="media">
    +  <a class="pull-left" href="#">
    +    <img class="media-object" src="http://placehold.it/64x64">
    +  </a>
    +  <div class="media-body">
    +    <h4 class="media-heading">{{_i}}Media heading{{/i}}</h4>
    +    ...
    +
    +    <!-- Nested media object -->
    +    <div class="media">
    +      ...
    +    </div>
    +  </div>
    +</div>
    +
    + + +
    + + +

    {{_i}}Media list{{/i}}

    +

    {{_i}}With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).{{/i}}

    +
    +
      +
    • + + + +
      +

      {{_i}}Media heading{{/i}}

      +

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      + +
      + + + +
      +

      {{_i}}Nested media heading{{/i}}

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. + +
      + + + +
      +

      {{_i}}Nested media heading{{/i}}

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. +
      +
      +
      +
      + +
      + + + +
      +

      {{_i}}Nested media heading{{/i}}

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. +
      +
      +
      +
    • +
    • + + + +
      +

      {{_i}}Media heading{{/i}}

      + Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. +
      +
    • +
    +
    +
    +<ul class="media-list">
    +  <li class="media">
    +    <a class="pull-left" href="#">
    +      <img class="media-object" src="http://placehold.it/64x64">
    +    </a>
    +    <div class="media-body">
    +      <h4 class="media-heading">{{_i}}Media heading{{/i}}</h4>
    +      ...
    +
    +      <!-- Nested media object -->
    +      <div class="media">
    +        ...
    +     </div>
    +    </div>
    +  </li>
    +</ul>
    +
    + +
    + + + + diff --git a/less/media.less b/less/media.less index dbcc212a06..1decab71de 100644 --- a/less/media.less +++ b/less/media.less @@ -1,69 +1,55 @@ -// COMMON STYLES -// ------------- +// Media objects +// Source: http://stubbornella.org/content/?p=497 +// -------------------------------------------------- -.media, + +// Common styles +// ------------------------- + +// Clear the floats +.media, .media-body { overflow: hidden; *overflow: visible; zoom: 1; } -.media { - margin-bottom: 10px; -} + +// Proper spacing between instances of .media +.media, .media .media { - margin-top: 20px; + margin-top: 15px; } +.media:first-child { + margin-top: 0; +} + +// For images and videos, set to block +.media-object { + display: block; +} + +// Reset margins on headings for tighter default spacing +.media-heading { + margin: 0 0 5px; +} + + +// Media image alignment +// ------------------------- + .media .pull-left { margin-right: 10px; } .media .pull-right { margin-left: 10px; } -.media .media-object { - display: block; -} -// Media list -.medias { - margin-top: 20px; + +// Media list variation +// ------------------------- + +// Undo default ul/ol styles +.media-list { margin-left: 0; - list-style-type: none; + list-style: none; } -.medias .media { - padding-bottom: 10px; - border-bottom: 1px solid rgba(0,0,0,.07); -} -.medias > .media.last { - margin: 0; - border-bottom: none; -} -.medias > .media .media { - margin-bottom: 0; - padding-bottom: 0; - border-bottom: none; -} - -// Media box -.media-box { - margin-bottom: 19px; - padding: 10px; - background-color: #fff; - border: 1px solid rgba(0,0,0,.09); - .border-radius(4px); - .box-shadow(1px 1px 2px rgba(0,0,0,.1)); -} - -@media (max-width: 480px) { -.media .pull-left, -.media .pull-right { - float: none; - display: block; - margin-bottom: 10px; -} -.media .pull-left { - margin-right: 0; // we stack the components so the indent is not needed anymore -} -.media .pull-right { - margin-left: 0; // we stack the components so the indent is not needed anymore -} -} \ No newline at end of file diff --git a/less/responsive-767px-max.less b/less/responsive-767px-max.less index 322acae217..5a23fc6834 100644 --- a/less/responsive-767px-max.less +++ b/less/responsive-767px-max.less @@ -156,16 +156,16 @@ } // Medias + // Reset float and spacing to stack .media .pull-left, - .media .pull-right { + .media .pull-right { float: none; display: block; margin-bottom: 10px; } - .media .pull-left { + // Remove side margins since we stack instead of indent + .media-object { margin-right: 0; - } - .media .pull-right { margin-left: 0; }