0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-28 20:52:21 +01:00

namespace progress bars and labels classes

This commit is contained in:
Mark Otto 2012-01-28 22:14:51 -08:00
parent 59d9983ebc
commit 487dbfdda4
5 changed files with 58 additions and 66 deletions

View File

@ -3003,16 +3003,16 @@ a.thumbnail:hover {
-moz-border-radius: 3px; -moz-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
.label.important { .label-important {
background-color: #b94a48; background-color: #b94a48;
} }
.label.warning { .label-warning {
background-color: #f89406; background-color: #f89406;
} }
.label.success { .label-success {
background-color: #468847; background-color: #468847;
} }
.label.info { .label-info {
background-color: #3a87ad; background-color: #3a87ad;
} }
@-webkit-keyframes progress-bar-stripes { @-webkit-keyframes progress-bar-stripes {
@ -3105,7 +3105,7 @@ a.thumbnail:hover {
-moz-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite;
} }
.progress.danger .bar { .progress-danger .bar {
background-color: #dd514c; background-color: #dd514c;
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
@ -3116,7 +3116,7 @@ a.thumbnail:hover {
background-repeat: repeat-x; background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
} }
.progress.danger.striped .bar { .progress-danger.progress-striped .bar {
background-color: #ee5f5b; background-color: #ee5f5b;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
@ -3125,7 +3125,7 @@ a.thumbnail:hover {
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
} }
.progress.success .bar { .progress-success .bar {
background-color: #5eb95e; background-color: #5eb95e;
background-image: -moz-linear-gradient(top, #62c462, #57a957); background-image: -moz-linear-gradient(top, #62c462, #57a957);
background-image: -ms-linear-gradient(top, #62c462, #57a957); background-image: -ms-linear-gradient(top, #62c462, #57a957);
@ -3136,7 +3136,7 @@ a.thumbnail:hover {
background-repeat: repeat-x; background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);
} }
.progress.success.striped .bar { .progress-success.progress-striped .bar {
background-color: #62c462; background-color: #62c462;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
@ -3145,7 +3145,7 @@ a.thumbnail:hover {
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
} }
.progress.info .bar { .progress-info .bar {
background-color: #4bb1cf; background-color: #4bb1cf;
background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);
@ -3156,7 +3156,7 @@ a.thumbnail:hover {
background-repeat: repeat-x; background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
} }
.progress.info.striped .bar { .progress-info.progress-striped .bar {
background-color: #5bc0de; background-color: #5bc0de;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);

View File

@ -1007,34 +1007,34 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label success">New</span> <span class="label label-success">New</span>
</td> </td>
<td> <td>
<code>&lt;span class="label success"&gt;New&lt;/span&gt;</code> <code>&lt;span class="label label-success"&gt;New&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label warning">Warning</span> <span class="label label-warning">Warning</span>
</td> </td>
<td> <td>
<code>&lt;span class="label warning"&gt;Warning&lt;/span&gt;</code> <code>&lt;span class="label label-warning"&gt;Warning&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label important">Important</span> <span class="label label-important">Important</span>
</td> </td>
<td> <td>
<code>&lt;span class="label important"&gt;Important&lt;/span&gt;</code> <code>&lt;span class="label label-important"&gt;Important&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label info">Info</span> <span class="label label-info">Info</span>
</td> </td>
<td> <td>
<code>&lt;span class="label info"&gt;Info&lt;/span&gt;</code> <code>&lt;span class="label label-info"&gt;Info&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -1307,12 +1307,12 @@
<div class="span4"> <div class="span4">
<h3>Striped</h3> <h3>Striped</h3>
<p>Uses a gradient to create a striped effect.</p> <p>Uses a gradient to create a striped effect.</p>
<div class="progress info striped"> <div class="progress progress-info progress-striped">
<div class="bar" style="width: 20%;"></div> <div class="bar" style="width: 20%;"></div>
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="progress info &lt;div class="progress progress-info
striped"&gt; progress-striped"&gt;
&lt;div class="bar" &lt;div class="bar"
style="width: 20%;"&gt;&lt;/div&gt; style="width: 20%;"&gt;&lt;/div&gt;
&lt;/div&gt; &lt;/div&gt;
@ -1321,12 +1321,12 @@
<div class="span4"> <div class="span4">
<h3>Animated</h3> <h3>Animated</h3>
<p>Takes the striped example and animates it.</p> <p>Takes the striped example and animates it.</p>
<div class="progress danger active striped"> <div class="progress progress-danger progress-striped active">
<div class="bar" style="width: 45%"></div> <div class="bar" style="width: 45%"></div>
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="progress danger &lt;div class="progress progress-danger
striped active"&gt; progress-striped active"&gt;
&lt;div class="bar" &lt;div class="bar"
style="width: 40%;"&gt;&lt;/div&gt; style="width: 40%;"&gt;&lt;/div&gt;
&lt;/div&gt; &lt;/div&gt;
@ -1338,18 +1338,18 @@
<div class="row"> <div class="row">
<div class="span4"> <div class="span4">
<h3>Additional colors</h3> <h3>Additional colors</h3>
<p>Progress bars utilize some of the same classes as buttons and alert messages for quick styling.</p> <p>Progress bars utilize some of the same class names as buttons and alerts for similar styling.</p>
<ul> <ul>
<li><code>.info</code></li> <li><code>.progress-info</code></li>
<li><code>.success</code></li> <li><code>.progress-success</code></li>
<li><code>.danger</code></li> <li><code>.progress-danger</code></li>
</ul> </ul>
<p>Alternatively, you can customize the LESS files and roll your own colors and sizes.</p> <p>Alternatively, you can customize the LESS files and roll your own colors and sizes.</p>
</div> </div>
<div class="span4"> <div class="span4">
<h3>Behavior</h3> <h3>Behavior</h3>
<p>Progress bars use CSS3 transitions, so if you dynamically adjust the width via javascript, it will smoothly resize.</p> <p>Progress bars use CSS3 transitions, so if you dynamically adjust the width via javascript, it will smoothly resize.</p>
<p>If you use the <code>.active</code> class, your <code>.striped</code> progress bars will animate the stripes left to right.</p> <p>If you use the <code>.active</code> class, your <code>.progress-striped</code> progress bars will animate the stripes left to right.</p>
</div> </div>
<div class="span4"> <div class="span4">
<h3>Browser support</h3> <h3>Browser support</h3>
@ -1398,10 +1398,6 @@
</section> </section>
<!-- Footer <!-- Footer
================================================== --> ================================================== -->
<footer class="footer"> <footer class="footer">

View File

@ -935,34 +935,34 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label success">{{_i}}New{{/i}}</span> <span class="label label-success">{{_i}}New{{/i}}</span>
</td> </td>
<td> <td>
<code>&lt;span class="label success"&gt;{{/_i}}New{{/i}}&lt;/span&gt;</code> <code>&lt;span class="label label-success"&gt;{{/_i}}New{{/i}}&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label warning">{{_i}}Warning{{/i}}</span> <span class="label label-warning">{{_i}}Warning{{/i}}</span>
</td> </td>
<td> <td>
<code>&lt;span class="label warning"&gt;{{_i}}Warning{{/i}}&lt;/span&gt;</code> <code>&lt;span class="label label-warning"&gt;{{_i}}Warning{{/i}}&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label important">{{_i}}Important{{/i}}</span> <span class="label label-important">{{_i}}Important{{/i}}</span>
</td> </td>
<td> <td>
<code>&lt;span class="label important"&gt;{{_i}}Important{{/i}}&lt;/span&gt;</code> <code>&lt;span class="label label-important"&gt;{{_i}}Important{{/i}}&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span class="label info">{{_i}}Info{{/i}}</span> <span class="label label-info">{{_i}}Info{{/i}}</span>
</td> </td>
<td> <td>
<code>&lt;span class="label info"&gt;{{_i}}Info{{/i}}&lt;/span&gt;</code> <code>&lt;span class="label label-info"&gt;{{_i}}Info{{/i}}&lt;/span&gt;</code>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -1235,12 +1235,12 @@
<div class="span4"> <div class="span4">
<h3>{{_i}}Striped{{/i}}</h3> <h3>{{_i}}Striped{{/i}}</h3>
<p>{{_i}}Uses a gradient to create a striped effect.{{/i}}</p> <p>{{_i}}Uses a gradient to create a striped effect.{{/i}}</p>
<div class="progress info striped"> <div class="progress progress-info progress-striped">
<div class="bar" style="width: 20%;"></div> <div class="bar" style="width: 20%;"></div>
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="progress info &lt;div class="progress progress-info
striped"&gt; progress-striped"&gt;
&lt;div class="bar" &lt;div class="bar"
style="width: 20%;"&gt;&lt;/div&gt; style="width: 20%;"&gt;&lt;/div&gt;
&lt;/div&gt; &lt;/div&gt;
@ -1249,12 +1249,12 @@
<div class="span4"> <div class="span4">
<h3>{{_i}}Animated{{/i}}</h3> <h3>{{_i}}Animated{{/i}}</h3>
<p>{{_i}}Takes the striped example and animates it.{{/i}}</p> <p>{{_i}}Takes the striped example and animates it.{{/i}}</p>
<div class="progress danger active striped"> <div class="progress progress-danger progress-striped active">
<div class="bar" style="width: 45%"></div> <div class="bar" style="width: 45%"></div>
</div> </div>
<pre class="prettyprint linenums"> <pre class="prettyprint linenums">
&lt;div class="progress danger &lt;div class="progress progress-danger
striped active"&gt; progress-striped active"&gt;
&lt;div class="bar" &lt;div class="bar"
style="width: 40%;"&gt;&lt;/div&gt; style="width: 40%;"&gt;&lt;/div&gt;
&lt;/div&gt; &lt;/div&gt;
@ -1266,18 +1266,18 @@
<div class="row"> <div class="row">
<div class="span4"> <div class="span4">
<h3>{{_i}}Additional colors{{/i}}</h3> <h3>{{_i}}Additional colors{{/i}}</h3>
<p>{{_i}}Progress bars utilize some of the same classes as buttons and alert messages for quick styling.{{/i}}</p> <p>{{_i}}Progress bars utilize some of the same class names as buttons and alerts for similar styling.{{/i}}</p>
<ul> <ul>
<li><code>.info</code></li> <li><code>.progress-info</code></li>
<li><code>.success</code></li> <li><code>.progress-success</code></li>
<li><code>.danger</code></li> <li><code>.progress-danger</code></li>
</ul> </ul>
<p>{{_i}}Alternatively, you can customize the LESS files and roll your own colors and sizes.{{/i}}</p> <p>{{_i}}Alternatively, you can customize the LESS files and roll your own colors and sizes.{{/i}}</p>
</div> </div>
<div class="span4"> <div class="span4">
<h3>{{_i}}Behavior{{/i}}</h3> <h3>{{_i}}Behavior{{/i}}</h3>
<p>{{_i}}Progress bars use CSS3 transitions, so if you dynamically adjust the width via javascript, it will smoothly resize.{{/i}}</p> <p>{{_i}}Progress bars use CSS3 transitions, so if you dynamically adjust the width via javascript, it will smoothly resize.{{/i}}</p>
<p>{{_i}}If you use the <code>.active</code> class, your <code>.striped</code> progress bars will animate the stripes left to right.{{/i}}</p> <p>{{_i}}If you use the <code>.active</code> class, your <code>.progress-striped</code> progress bars will animate the stripes left to right.{{/i}}</p>
</div> </div>
<div class="span4"> <div class="span4">
<h3>{{_i}}Browser support{{/i}}</h3> <h3>{{_i}}Browser support{{/i}}</h3>
@ -1324,7 +1324,3 @@
</div><!--/span--> </div><!--/span-->
</div><!--/row--> </div><!--/row-->
</section> </section>

View File

@ -9,8 +9,8 @@
text-transform: uppercase; text-transform: uppercase;
background-color: @grayLight; background-color: @grayLight;
.border-radius(3px); .border-radius(3px);
&.important { background-color: @errorText; }
&.warning { background-color: @orange; }
&.success { background-color: @successText; }
&.info { background-color: @infoText; }
} }
.label-important { background-color: @errorText; }
.label-warning { background-color: @orange; }
.label-success { background-color: @successText; }
.label-info { background-color: @infoText; }

View File

@ -71,25 +71,25 @@
// ------ // ------
// Danger (red) // Danger (red)
.progress.danger .bar { .progress-danger .bar {
#gradient > .vertical(#ee5f5b, #c43c35); #gradient > .vertical(#ee5f5b, #c43c35);
} }
.progress.danger.striped .bar { .progress-danger.progress-striped .bar {
#gradient > .striped(#ee5f5b); #gradient > .striped(#ee5f5b);
} }
// Success (green) // Success (green)
.progress.success .bar { .progress-success .bar {
#gradient > .vertical(#62c462, #57a957); #gradient > .vertical(#62c462, #57a957);
} }
.progress.success.striped .bar { .progress-success.progress-striped .bar {
#gradient > .striped(#62c462); #gradient > .striped(#62c462);
} }
// Info (teal) // Info (teal)
.progress.info .bar { .progress-info .bar {
#gradient > .vertical(#5bc0de, #339bb9); #gradient > .vertical(#5bc0de, #339bb9);
} }
.progress.info.striped .bar { .progress-info.progress-striped .bar {
#gradient > .striped(#5bc0de); #gradient > .striped(#5bc0de);
} }