Commit 1438b14f authored by Mark Otto's avatar Mark Otto
Browse files

overhauled docs to include example markup, add language around browser support and classes

parent 418e2c7d
Showing with 330 additions and 305 deletions
+330 -305
This diff is collapsed.
This diff is collapsed.
......@@ -929,43 +929,82 @@ Lorem ipsum dolar sit amet illo error <a href="#" title="bottom">ipsum</a> verit
================================================== -->
<section id="progresss">
<div class="page-header">
<h1>Progress bars <small>... for indicating progress</small></h1>
<h1>Progress bars <small>For loading, redirecting, or action status</small></h1>
</div>
<h2>Examples and markup</h2>
<div class="row">
<div class="span3">
<h2>Basic bars</h2>
<p>Default look of progress bars. Absolute minimum.</p>
</div>
<div class="span9">
<div class="span4">
<h3>Basic</h3>
<p>Default progress bar with a vertical gradient.</p>
<div class="progress">
<div class="bar" style="width: 50%;"></div>
<div class="bar" style="width: 60%;"></div>
</div>
<pre class="prettyprint linenums">
&lt;div class="progress"&gt;
&lt;div class="bar"
style="width: 60%;"&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
</div>
</div>
<div class="row">
<div class="span3">
<h2>Striped bars</h2>
<p>Bars with stripes painted.</p>
</div>
<div class="span9">
<div class="span4">
<h3>Striped</h3>
<p>Uses a gradient to create a striped effect.</p>
<div class="progress info striped">
<div class="bar" style="width: 20%;"></div>
</div>
<pre class="prettyprint linenums">
&lt;div class="progress info
striped"&gt;
&lt;div class="bar"
style="width: 20%;"&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
</div>
</div>
<div class="row">
<div class="span3">
<h2>Active state</h2>
<p>Animated stripes! <small>Not on Opera, though :(</small></p>
</div>
<div class="span3">
<div class="span4">
<h3>Animated</h3>
<p>Takes the striped example and animates it.</p>
<div class="progress danger active striped">
<div class="bar" style="width: 45%"></div>
</div>
<pre class="prettyprint linenums">
&lt;div class="progress danger
striped active"&gt;
&lt;div class="bar"
style="width: 40%;"&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
</div>
</div>
<h2>Options and browser support</h2>
<div class="row">
<div class="span4">
<h3>Additional colors</h3>
<p>Progress bars utilize some of the same classes as buttons and alert messages for quick styling.</p>
<ul>
<li><code>.info</code></li>
<li><code>.success</code></li>
<li><code>.danger</code></li>
</ul>
<p>Alternatively, you can customize the LESS files and roll your own colors and sizes.</p>
</div>
<div class="span4">
<h3>Behavior</h3>
<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>
</div>
<div class="span4">
<h3>Browser support</h3>
<p>Progress bars use CSS3 gradients, transitions, and animations to achieve all theire effects. These features are not supported in IE7-8 or older versions of Firefox.</p>
<p>Opera does not support animations at this time.</p>
</div>
</div>
</section>
<!-- Footer
================================================== -->
<footer class="footer">
......
......@@ -30,7 +30,6 @@
@import "wells.less";
@import "component-animations.less";
@import "close.less";
@import "progress-bars.less";
// Components: Nav
@import "navbar.less";
......@@ -52,6 +51,7 @@
// Components: Misc
@import "thumbnails.less";
@import "labels.less";
@import "progress-bars.less";
// Responsive
@import "responsive.less";
\ No newline at end of file
......@@ -179,6 +179,13 @@
background-clip: @clip;
}
// Box sizing
.box-sizing(@boxmodel) {
-webkit-box-sizing: @boxmodel;
-moz-box-sizing: @boxmodel;
box-sizing: @boxmodel;
}
// Resize anything
.resizable(@direction: both) {
resize: @direction; // Options: horizontal, vertical, both
......@@ -272,12 +279,12 @@
}
.striped(@color,@angle: -45deg) {
background-color: @color;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(@angle, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(@angle, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
background-image: -ms-linear-gradient(@angle, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(@angle, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
background-image: linear-gradient(@angle, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: -ms-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
}
}
......
// PROGRESS BARS
// -------------
// ANIMATIONS
// ----------
// Webkit
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
from { background-position: 0 0; }
to { background-position: 40px 0; }
}
/* COMMENTED OUT SO LESS COMPILES
@-moz-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}
*/
// Temporarily commented out since LESS won't compile with this
// @-moz-keyframes progress-bar-stripes {
// from { background-position: 0 0; }
// to { background-position: 40px 0; }
// }
// Spec
@keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
from { background-position: 0 0; }
to { background-position: 40px 0; }
}
// THE BARS
// --------
// Common styles
.progress,
.progress .bar {
.border-radius(4px);
}
// Outer container
.progress {
height: 25px;
height: 18px;
margin-bottom: 18px;
overflow: hidden;
.box-shadow(inset 0 1px 1px 0 rgba(0,0,0,.3), 0 1px 0 0 #fff);
#gradient > .vertical(#fff, #f5f5f5);
.border-radius(10px);
#gradient > .vertical(#f5f5f5, #f9f9f9);
border: 1px solid #ddd;
border-color: rgba(0,0,0,.0);
&.active {
.bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
}
&.animated {
.bar {
.transition(width .6s ease);
}
}
&.danger,
&.error {
.bar {
#gradient > .vertical(#ee5f5b, #c43c35);
}
&.striped {
.bar {
.background-size(40px, 40px);
#gradient > .striped(#ee5f5b);
}
}
}
&.success {
.bar {
#gradient > .vertical(#62c462, #57a957);
}
&.striped {
.bar {
.background-size(40px, 40px);
#gradient > .striped(#62c462);
}
}
}
&.info {
.bar {
#gradient > .vertical(#5bc0de, #339bb9);
}
&.striped {
.bar {
.background-size(40px, 40px);
#gradient > .striped(#5bc0de);
}
}
}
&.striped {
.bar {
.background-size(40px, 40px);
#gradient > .striped(#62c462);
}
}
.bar {
width: 0%;
height: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
.gradientBar(#62c462, #57a957);
@shadow: inset 0 2px 0 rgba(255,255,255,.2), inset -1px -1px 0 rgba(0,0,0,.25),inset 1px 1px 0 rgba(0,0,0,.25);
.box-shadow(@shadow);
.border-radius(10px);
}
}
\ No newline at end of file
.box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
}
// Bar of progress
.progress .bar {
width: 0%;
height: 20px;
margin: -1px;
#gradient > .vertical(#62c462, #57a957);
#gradient > .vertical(#149bdf, #0480be);
.box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
.box-sizing(border-box);
.transition(width .6s ease);
}
// Striped bars
.progress.striped .bar {
#gradient > .striped(#62c462);
.background-size(40px, 40px);
}
// Call animation for the active one
.progress.active .bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
// COLORS
// ------
// Danger (red)
.progress.danger .bar {
#gradient > .vertical(#ee5f5b, #c43c35);
}
.progress.danger.striped .bar {
#gradient > .striped(#ee5f5b);
}
// Success (green)
.progress.success .bar {
#gradient > .vertical(#62c462, #57a957);
}
.progress.success.striped .bar {
#gradient > .striped(#62c462);
}
// Info (teal)
.progress.info .bar {
#gradient > .vertical(#5bc0de, #339bb9);
}
.progress.info.striped .bar {
#gradient > .striped(#5bc0de);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment