0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

overhaul the docs and css to merge into 2.1.2 since this was against master

This commit is contained in:
Mark Otto 2012-09-17 18:15:39 -07:00
parent 917b46a343
commit 143fef9f95
6 changed files with 340 additions and 114 deletions

View File

@ -901,10 +901,8 @@
float: none;
margin-bottom: 10px;
}
.media .pull-left {
.media-object {
margin-right: 0;
}
.media .pull-right {
margin-left: 0;
}
.modal {

View File

@ -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,

View File

@ -98,6 +98,7 @@
<li><a href="#thumbnails"><i class="icon-chevron-right"></i> Thumbnails</a></li>
<li><a href="#alerts"><i class="icon-chevron-right"></i> Alerts</a></li>
<li><a href="#progress"><i class="icon-chevron-right"></i> Progress bars</a></li>
<li><a href="#media"><i class="icon-chevron-right"></i> Media object</a></li>
<li><a href="#misc"><i class="icon-chevron-right"></i> Misc</a></li>
</ul>
</div>
@ -1927,6 +1928,7 @@
<!-- Alerts
================================================== -->
<section id="alerts">
@ -2029,6 +2031,7 @@
<!-- Progress bars
================================================== -->
<section id="progress">
@ -2175,6 +2178,144 @@
<!-- Media object
================================================== -->
<section id="media">
<div class="page-header">
<h1>Media object</h1>
</div>
<p class="lead">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.</p>
<h2>Default example</h2>
<p>The default media allow to float a media object (images, video, audio) to the left or right of a content block.</p>
<div class="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">Media heading</h4>
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>
</div>
<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>
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>
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>
</div>
</div>
</div>
</div>
<pre class="prettyprint linenums">
&lt;div class="media"&gt;
&lt;a class="pull-left" href="#"&gt;
&lt;img class="media-object" src="http://placehold.it/64x64"&gt;
&lt;/a&gt;
&lt;div class="media-body"&gt;
&lt;h4 class="media-heading"&gt;Media heading&lt;/h4&gt;
...
&lt;!-- Nested media object --&gt;
&lt;div class="media"&gt;
...
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</pre>
<hr class="bs-docs-separator">
<h2>Media list</h2>
<p>With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).</p>
<div class="bs-docs-example">
<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>
<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>
<!-- Nested media object -->
<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">Nested media heading</h4>
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 object -->
<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">Nested media heading</h4>
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.
</div>
</div>
</div>
</div>
<!-- Nested media object -->
<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">Nested media heading</h4>
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.
</div>
</div>
</div>
</li>
<li class="media">
<a class="pull-right" href="#">
<img class="media-object" src="http://placehold.it/64x64">
</a>
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
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.
</div>
</li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="media-list"&gt;
&lt;li class="media"&gt;
&lt;a class="pull-left" href="#"&gt;
&lt;img class="media-object" src="http://placehold.it/64x64"&gt;
&lt;/a&gt;
&lt;div class="media-body"&gt;
&lt;h4 class="media-heading"&gt;Media heading&lt;/h4&gt;
...
&lt;!-- Nested media object --&gt;
&lt;div class="media"&gt;
...
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
</pre>
</section>
<!-- Miscellaneous
================================================== -->

View File

@ -27,6 +27,7 @@
<li><a href="#thumbnails"><i class="icon-chevron-right"></i> {{_i}}Thumbnails{{/i}}</a></li>
<li><a href="#alerts"><i class="icon-chevron-right"></i> {{_i}}Alerts{{/i}}</a></li>
<li><a href="#progress"><i class="icon-chevron-right"></i> {{_i}}Progress bars{{/i}}</a></li>
<li><a href="#media"><i class="icon-chevron-right"></i> {{_i}}Media object{{/i}}</a></li>
<li><a href="#misc"><i class="icon-chevron-right"></i> {{_i}}Misc{{/i}}</a></li>
</ul>
</div>
@ -1856,6 +1857,7 @@
<!-- Alerts
================================================== -->
<section id="alerts">
@ -1958,6 +1960,7 @@
<!-- Progress bars
================================================== -->
<section id="progress">
@ -2104,6 +2107,144 @@
<!-- Media object
================================================== -->
<section id="media">
<div class="page-header">
<h1>{{_i}}Media object{{/i}}</h1>
</div>
<p class="lead">{{_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}}</p>
<h2>{{_i}}Default example{{/i}}</h2>
<p>{{_i}}The default media allow to float a media object (images, video, audio) to the left or right of a content block.{{/i}}</p>
<div class="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>
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>
</div>
<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>
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">{{_i}}Media heading{{/i}}</h4>
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>
</div>
</div>
</div>
</div>{{! /.bs-docs-example }}
<pre class="prettyprint linenums">
&lt;div class="media"&gt;
&lt;a class="pull-left" href="#"&gt;
&lt;img class="media-object" src="http://placehold.it/64x64"&gt;
&lt;/a&gt;
&lt;div class="media-body"&gt;
&lt;h4 class="media-heading"&gt;{{_i}}Media heading{{/i}}&lt;/h4&gt;
...
&lt;!-- Nested media object --&gt;
&lt;div class="media"&gt;
...
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</pre>
<hr class="bs-docs-separator">
<h2>{{_i}}Media list{{/i}}</h2>
<p>{{_i}}With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).{{/i}}</p>
<div class="bs-docs-example">
<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>
<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>
<!-- Nested media object -->
<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}}Nested media heading{{/i}}</h4>
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 object -->
<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}}Nested media heading{{/i}}</h4>
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.
</div>
</div>
</div>
</div>
<!-- Nested media object -->
<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}}Nested media heading{{/i}}</h4>
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.
</div>
</div>
</div>
</li>
<li class="media">
<a class="pull-right" href="#">
<img class="media-object" src="http://placehold.it/64x64">
</a>
<div class="media-body">
<h4 class="media-heading">{{_i}}Media heading{{/i}}</h4>
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.
</div>
</li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="media-list"&gt;
&lt;li class="media"&gt;
&lt;a class="pull-left" href="#"&gt;
&lt;img class="media-object" src="http://placehold.it/64x64"&gt;
&lt;/a&gt;
&lt;div class="media-body"&gt;
&lt;h4 class="media-heading"&gt;{{_i}}Media heading{{/i}}&lt;/h4&gt;
...
&lt;!-- Nested media object --&gt;
&lt;div class="media"&gt;
...
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
</pre>
</section>
<!-- Miscellaneous
================================================== -->

View File

@ -1,69 +1,55 @@
// COMMON STYLES
// -------------
// Media objects
// Source: http://stubbornella.org/content/?p=497
// --------------------------------------------------
// 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;
}
.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
}
list-style: none;
}

View File

@ -156,16 +156,16 @@
}
// Medias
// Reset float and spacing to stack
.media .pull-left,
.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;
}