diff --git a/docs/assets/css/bootstrap-responsive.css b/docs/assets/css/bootstrap-responsive.css index 63ed85f76b..0161885af3 100644 --- a/docs/assets/css/bootstrap-responsive.css +++ b/docs/assets/css/bootstrap-responsive.css @@ -904,6 +904,16 @@ padding-right: 10px; padding-left: 10px; } + .media .pull-left, + .media .pull-right { + display: block; + float: none; + margin-bottom: 10px; + } + .media-object { + margin-right: 0; + margin-left: 0; + } .modal { top: 10px; right: 10px; diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index ce3e925849..201d1f8426 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -5285,6 +5285,43 @@ a.thumbnail:hover { color: #555555; } +.media, +.media-body { + overflow: hidden; + *overflow: visible; + zoom: 1; +} + +.media, +.media .media { + margin-top: 15px; +} + +.media:first-child { + margin-top: 0; +} + +.media-object { + display: block; +} + +.media-heading { + margin: 0 0 5px; +} + +.media .pull-left { + margin-right: 10px; +} + +.media .pull-right { + margin-left: 10px; +} + +.media-list { + margin-left: 0; + list-style: none; +} + .label, .badge { font-size: 11.844px; diff --git a/docs/components.html b/docs/components.html index d4211b4702..ad9e0b4539 100644 --- a/docs/components.html +++ b/docs/components.html @@ -98,6 +98,7 @@
  • Thumbnails
  • Alerts
  • Progress bars
  • +
  • Media object
  • Misc
  • @@ -1945,6 +1946,7 @@ +
    @@ -2047,6 +2049,7 @@ +
    @@ -2193,6 +2196,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 412e62ec29..7ef62a1da9 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}}
  • @@ -1874,6 +1875,7 @@ +
    @@ -1976,6 +1978,7 @@ +
    @@ -2122,6 +2125,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/bootstrap.less b/less/bootstrap.less index 3055c5cc4e..a097081732 100644 --- a/less/bootstrap.less +++ b/less/bootstrap.less @@ -52,6 +52,7 @@ // Components: Misc @import "thumbnails.less"; +@import "media.less"; @import "labels-badges.less"; @import "progress-bars.less"; @import "accordion.less"; diff --git a/less/media.less b/less/media.less new file mode 100644 index 0000000000..1decab71de --- /dev/null +++ b/less/media.less @@ -0,0 +1,55 @@ +// Media objects +// Source: http://stubbornella.org/content/?p=497 +// -------------------------------------------------- + + +// Common styles +// ------------------------- + +// Clear the floats +.media, +.media-body { + overflow: hidden; + *overflow: visible; + zoom: 1; +} + +// Proper spacing between instances of .media +.media, +.media .media { + 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 list variation +// ------------------------- + +// Undo default ul/ol styles +.media-list { + margin-left: 0; + list-style: none; +} diff --git a/less/responsive-767px-max.less b/less/responsive-767px-max.less index 6e42610475..5cd89e4035 100644 --- a/less/responsive-767px-max.less +++ b/less/responsive-767px-max.less @@ -158,6 +158,20 @@ } } + // Medias + // Reset float and spacing to stack + .media .pull-left, + .media .pull-right { + float: none; + display: block; + margin-bottom: 10px; + } + // Remove side margins since we stack instead of indent + .media-object { + margin-right: 0; + margin-left: 0; + } + // Modals .modal { top: 10px;