From f2e39233f54a733df54d5d998abd79233e0f143f Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 10 Jun 2012 15:12:02 -0700 Subject: [PATCH] rewrite alerts and progress bars sections --- docs/assets/css/bootstrap.css | 4 - docs/assets/css/docs.css | 5 +- docs/components.html | 238 +++++++++++++++-------- docs/templates/pages/components.mustache | 238 +++++++++++++++-------- less/alerts.less | 5 +- 5 files changed, 317 insertions(+), 173 deletions(-) diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index fe957d19f1..9803e2a6a2 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -3169,10 +3169,6 @@ input[type="submit"].btn.btn-mini { border-radius: 4px; } -.alert-heading { - color: inherit; -} - .alert .close { position: relative; top: -2px; diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index 4c7a7ddab0..4d65f6b045 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -739,7 +739,10 @@ form.well { .bs-docs-example p:last-child { margin-bottom: 0; } -.bs-docs-example .table { +.bs-docs-example .table, +.bs-docs-example .progress, +.bs-docs-example .well, +.bs-docs-example .alert { margin-bottom: 5px; } form.bs-docs-example { diff --git a/docs/components.html b/docs/components.html index fc8857041b..312e03c201 100644 --- a/docs/components.html +++ b/docs/components.html @@ -1579,50 +1579,68 @@

Alerts Styles for success, warning, and error messages

-

Lightweight defaults

- -

Rewritten base class

-

With Bootstrap 2, we've simplified the base class: .alert instead of .alert-message. We've also reduced the minimum required markup—no <p> is required by default, just the outer <div>.

-

Single alert message

-

For a more durable component with less code, we've removed the differentiating look for block alerts, messages that come with more padding and typically more text. The class also has changed to .alert-block.

-
-

Goes great with javascript

-

Bootstrap comes with a great jQuery plugin that supports alert messages, making dismissing them quick and easy.

-

Get the plugin »

- -

Example alerts

-

Wrap your message and an optional close icon in a div with simple class.

-
- - Warning! Best check yo self, you're not looking too good. +

Default alert

+

Wrap any text and an optional dismiss button in .alert for a basic warning alert message.

+
+
+ + Warning! Best check yo self, you're not looking too good. +
 <div class="alert">
-  <button class="close" data-dismiss="alert">×</button>
+  <button type="button" class="close" data-dismiss="alert">×</button>
   <strong>Warning!</strong> Best check yo self, you're not looking too good.
 </div>
 
-

Heads up! iOS devices require an href="#" for the dismissal of alerts. Be sure to include it and the data attribute for anchor close icons. Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.

-

Easily extend the standard alert message with two optional classes: .alert-block for more padding and text controls and .alert-heading for a matching heading.

-
- -

Warning!

-

Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

+ +

Dismiss buttons

+

Mobile Safari and Mobile Opera browsers, in addition to the data-dismiss="alert" attribute, require an href="#" for the dismissal of alerts when using an <a> tag.

+
+<a href="#" class="close" data-dismiss="alert">×</button>
+
+

Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.

+
+<button type="button" class="close" data-dismiss="alert">×</button>
+
+ +

Dismiss alerts via javascript

+

Use the alerts jQuery plugin for quick and easy dismissal of alerts.

+ + +
+ + +

Options

+

For longer messages, increase the padding on the top and bottom of the alert wrapper by adding .alert-block.

+
+
+ +

Warning!

+

Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

+
 <div class="alert alert-block">
-  <a class="close" data-dismiss="alert" href="#">×</a>
-  <h4 class="alert-heading">Warning!</h4>
+  <a class="close" data-dismiss="alert" href="#">&times;</a>
+  <h4>Warning!</h4>
   Best check yo self, you're not...
 </div>
 
-

Contextual alternatives Add optional classes to change an alert's connotation

+ +
+ + +

Contextual alternatives

+

Add optional classes to change an alert's connotation.

Error or danger

-
- - Oh snap! Change a few things up and try submitting again. +
+
+ + Oh snap! Change a few things up and try submitting again. +
 <div class="alert alert-error">
@@ -1631,9 +1649,11 @@
 

Success

-
- - Well done! You successfully read this important alert message. +
+
+ + Well done! You successfully read this important alert message. +
 <div class="alert alert-success">
@@ -1642,9 +1662,11 @@
 

Information

-
- - Heads up! This alert needs your attention, but it's not super important. +
+
+ + Heads up! This alert needs your attention, but it's not super important. +
 <div class="alert alert-info">
@@ -1667,78 +1689,116 @@
 
   

Basic

Default progress bar with a vertical gradient.

-
-
+
+
+
+
 <div class="progress">
-  <div class="bar"
-       style="width: 60%;"></div>
+  <div class="bar" style="width: 60%;"></div>
 </div>
 

Striped

-

Uses a gradient to create a striped effect (no IE).

-
-
+

Uses a gradient to create a striped effect. Not available in IE7-8.

+
+
+
+
 <div class="progress progress-striped">
-  <div class="bar"
-       style="width: 20%;"></div>
+  <div class="bar" style="width: 20%;"></div>
 </div>
 

Animated

-

Takes the striped example and animates it (no IE).

-
-
+

Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.

+
+
+
+
-<div class="progress progress-striped
-     active">
-  <div class="bar"
-       style="width: 40%;"></div>
+<div class="progress progress-striped active">
+  <div class="bar" style="width: 40%;"></div>
 </div>
 
-

Options and browser support

+ +
+ + +

Options

Additional colors

Progress bars use some of the same button and alert classes for consistent styles.

-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<div class="progress progress-info">
+  <div class="bar" style="width: 20%"></div>
+</div>
+<div class="progress progress-success">
+  <div class="bar" style="width: 40%"></div>
+</div>
+<div class="progress progress-warning">
+  <div class="bar" style="width: 60%"></div>
+</div>
+<div class="progress progress-danger">
+  <div class="bar" style="width: 80%"></div>
+</div>
+

Striped bars

Similar to the solid colors, we have varied striped progress bars.

-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<div class="progress progress-info progress-striped">
+  <div class="bar" style="width: 20%"></div>
+</div>
+<div class="progress progress-success progress-striped">
+  <div class="bar" style="width: 40%"></div>
+</div>
+<div class="progress progress-warning progress-striped">
+  <div class="bar" style="width: 60%"></div>
+</div>
+<div class="progress progress-danger progress-striped">
+  <div class="bar" style="width: 80%"></div>
+</div>
+
-

Behavior

-

Progress bars use CSS3 transitions, so if you dynamically adjust the width via javascript, it will smoothly resize.

-

If you use the .active class, your .progress-striped progress bars will animate the stripes left to right.

-

Browser support

+
+ + +

Browser support

Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in IE7-9 or older versions of Firefox.

Opera and IE do not support animations at this time.

@@ -1757,21 +1817,33 @@

Wells

Use the well as a simple effect on an element to give it an inset effect.

-
- Look, I'm in a well! +
+
+ Look, I'm in a well! +
 <div class="well">
   ...
 </div>
 
-

Optional classes

+

Optional classes

Control padding and rounded corners with two optional modifier classes.

+
+
+ Look, I'm in a well! +
+
 <div class="well well-large">
   ...
 </div>
 
+
+
+ Look, I'm in a well! +
+
 <div class="well well-small">
   ...
@@ -1779,7 +1851,9 @@
 

Close icon

Use the generic close icon for dismissing content like modals and alerts.

-

+
+

+
<button class="close">&times;</button>

iOS devices require an href="#" for click events if you rather use an anchor.

<a class="close" href="#">&times;</a>
diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache index acdae3d925..c90b2997ea 100644 --- a/docs/templates/pages/components.mustache +++ b/docs/templates/pages/components.mustache @@ -1502,50 +1502,68 @@

{{_i}}Alerts{{/i}} {{_i}}Styles for success, warning, and error messages{{/i}}

-

{{_i}}Lightweight defaults{{/i}}

- -

{{_i}}Rewritten base class{{/i}}

-

{{_i}}With Bootstrap 2, we've simplified the base class: .alert instead of .alert-message. We've also reduced the minimum required markup—no <p> is required by default, just the outer <div>.{{/i}}

-

{{_i}}Single alert message{{/i}}

-

{{_i}}For a more durable component with less code, we've removed the differentiating look for block alerts, messages that come with more padding and typically more text. The class also has changed to .alert-block.{{/i}}

-
-

{{_i}}Goes great with javascript{{/i}}

-

{{_i}}Bootstrap comes with a great jQuery plugin that supports alert messages, making dismissing them quick and easy.{{/i}}

-

{{_i}}Get the plugin »{{/i}}

- -

{{_i}}Example alerts{{/i}}

-

{{_i}}Wrap your message and an optional close icon in a div with simple class.{{/i}}

-
- - {{_i}}Warning!{{/i}} {{_i}}Best check yo self, you're not looking too good.{{/i}} +

{{_i}}Default alert{{/i}}

+

{{_i}}Wrap any text and an optional dismiss button in .alert for a basic warning alert message.{{/i}}

+
+
+ + {{_i}}Warning!{{/i}} {{_i}}Best check yo self, you're not looking too good.{{/i}} +
 <div class="alert">
-  <button class="close" data-dismiss="alert">×</button>
+  <button type="button" class="close" data-dismiss="alert">×</button>
   <strong>{{_i}}Warning!{{/i}}</strong> {{_i}}Best check yo self, you're not looking too good.{{/i}}
 </div>
 
-

{{_i}}Heads up!{{/i}} {{_i}}iOS devices require an href="#" for the dismissal of alerts. Be sure to include it and the data attribute for anchor close icons. Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.{{/i}}

-

{{_i}}Easily extend the standard alert message with two optional classes: .alert-block for more padding and text controls and .alert-heading for a matching heading.{{/i}}

-
- -

{{_i}}Warning!{{/i}}

-

{{_i}}Best check yo self, you're not looking too good.{{/i}} Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

+ +

{{_i}}Dismiss buttons{{/i}}

+

{{_i}}Mobile Safari and Mobile Opera browsers, in addition to the data-dismiss="alert" attribute, require an href="#" for the dismissal of alerts when using an <a> tag.{{/i}}

+
+<a href="#" class="close" data-dismiss="alert">×</button>
+
+

{{_i}}Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.{{/i}}

+
+<button type="button" class="close" data-dismiss="alert">×</button>
+
+ +

{{_i}}Dismiss alerts via javascript{{/i}}

+

{{_i}}Use the alerts jQuery plugin for quick and easy dismissal of alerts.{{/i}}

+ + +
+ + +

{{_i}}Options{{/i}}

+

{{_i}}For longer messages, increase the padding on the top and bottom of the alert wrapper by adding .alert-block.{{/i}}

+
+
+ +

{{_i}}Warning!{{/i}}

+

{{_i}}Best check yo self, you're not looking too good.{{/i}} Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

+
 <div class="alert alert-block">
-  <a class="close" data-dismiss="alert" href="#">×</a>
-  <h4 class="alert-heading">{{_i}}Warning!{{/i}}</h4>
+  <a class="close" data-dismiss="alert" href="#">&times;</a>
+  <h4>{{_i}}Warning!{{/i}}</h4>
   {{_i}}Best check yo self, you're not...{{/i}}
 </div>
 
-

{{_i}}Contextual alternatives{{/i}} {{_i}}Add optional classes to change an alert's connotation{{/i}}

+ +
+ + +

{{_i}}Contextual alternatives{{/i}}

+

{{_i}}Add optional classes to change an alert's connotation.{{/i}}

{{_i}}Error or danger{{/i}}

-
- - {{_i}}Oh snap!{{/i}} {{_i}}Change a few things up and try submitting again.{{/i}} +
+
+ + {{_i}}Oh snap!{{/i}} {{_i}}Change a few things up and try submitting again.{{/i}} +
 <div class="alert alert-error">
@@ -1554,9 +1572,11 @@
 

{{_i}}Success{{/i}}

-
- - {{_i}}Well done!{{/i}} {{_i}}You successfully read this important alert message.{{/i}} +
+
+ + {{_i}}Well done!{{/i}} {{_i}}You successfully read this important alert message.{{/i}} +
 <div class="alert alert-success">
@@ -1565,9 +1585,11 @@
 

{{_i}}Information{{/i}}

-
- - {{_i}}Heads up!{{/i}} {{_i}}This alert needs your attention, but it's not super important.{{/i}} +
+
+ + {{_i}}Heads up!{{/i}} {{_i}}This alert needs your attention, but it's not super important.{{/i}} +
 <div class="alert alert-info">
@@ -1590,78 +1612,116 @@
 
   

{{_i}}Basic{{/i}}

{{_i}}Default progress bar with a vertical gradient.{{/i}}

-
-
+
+
+
+
 <div class="progress">
-  <div class="bar"
-       style="width: 60%;"></div>
+  <div class="bar" style="width: 60%;"></div>
 </div>
 

{{_i}}Striped{{/i}}

-

{{_i}}Uses a gradient to create a striped effect (no IE).{{/i}}

-
-
+

{{_i}}Uses a gradient to create a striped effect. Not available in IE7-8.{{/i}}

+
+
+
+
 <div class="progress progress-striped">
-  <div class="bar"
-       style="width: 20%;"></div>
+  <div class="bar" style="width: 20%;"></div>
 </div>
 

{{_i}}Animated{{/i}}

-

{{_i}}Takes the striped example and animates it (no IE).{{/i}}

-
-
+

{{_i}}Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.{{/i}}

+
+
+
+
-<div class="progress progress-striped
-     active">
-  <div class="bar"
-       style="width: 40%;"></div>
+<div class="progress progress-striped active">
+  <div class="bar" style="width: 40%;"></div>
 </div>
 
-

{{_i}}Options and browser support{{/i}}

+ +
+ + +

{{_i}}Options{{/i}}

{{_i}}Additional colors{{/i}}

{{_i}}Progress bars use some of the same button and alert classes for consistent styles.{{/i}}

-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<div class="progress progress-info">
+  <div class="bar" style="width: 20%"></div>
+</div>
+<div class="progress progress-success">
+  <div class="bar" style="width: 40%"></div>
+</div>
+<div class="progress progress-warning">
+  <div class="bar" style="width: 60%"></div>
+</div>
+<div class="progress progress-danger">
+  <div class="bar" style="width: 80%"></div>
+</div>
+

{{_i}}Striped bars{{/i}}

{{_i}}Similar to the solid colors, we have varied striped progress bars.{{/i}}

-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<div class="progress progress-info progress-striped">
+  <div class="bar" style="width: 20%"></div>
+</div>
+<div class="progress progress-success progress-striped">
+  <div class="bar" style="width: 40%"></div>
+</div>
+<div class="progress progress-warning progress-striped">
+  <div class="bar" style="width: 60%"></div>
+</div>
+<div class="progress progress-danger progress-striped">
+  <div class="bar" style="width: 80%"></div>
+</div>
+
-

{{_i}}Behavior{{/i}}

-

{{_i}}Progress bars use CSS3 transitions, so if you dynamically adjust the width via javascript, it will smoothly resize.{{/i}}

-

{{_i}}If you use the .active class, your .progress-striped progress bars will animate the stripes left to right.{{/i}}

-

{{_i}}Browser support{{/i}}

+
+ + +

{{_i}}Browser support{{/i}}

{{_i}}Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in IE7-9 or older versions of Firefox.{{/i}}

{{_i}}Opera and IE do not support animations at this time.{{/i}}

@@ -1680,21 +1740,33 @@

{{_i}}Wells{{/i}}

{{_i}}Use the well as a simple effect on an element to give it an inset effect.{{/i}}

-
- {{_i}}Look, I'm in a well!{{/i}} +
+
+ {{_i}}Look, I'm in a well!{{/i}} +
 <div class="well">
   ...
 </div>
 
-

{{_i}}Optional classes{{/i}}

+

{{_i}}Optional classes{{/i}}

{{_i}}Control padding and rounded corners with two optional modifier classes.{{/i}}

+
+
+ {{_i}}Look, I'm in a well!{{/i}} +
+
 <div class="well well-large">
   ...
 </div>
 
+
+
+ {{_i}}Look, I'm in a well!{{/i}} +
+
 <div class="well well-small">
   ...
@@ -1702,7 +1774,9 @@
 

{{_i}}Close icon{{/i}}

{{_i}}Use the generic close icon for dismissing content like modals and alerts.{{/i}}

-

+
+

+
<button class="close">&times;</button>

{{_i}}iOS devices require an href="#" for click events if you rather use an anchor.{{/i}}

<a class="close" href="#">&times;</a>
diff --git a/less/alerts.less b/less/alerts.less index 46a0d77bfd..1f73314c11 100644 --- a/less/alerts.less +++ b/less/alerts.less @@ -11,9 +11,6 @@ .border-radius(4px); color: @warningText; } -.alert-heading { - color: inherit; -} // Adjust close link position .alert .close { @@ -28,7 +25,7 @@ .alert-success { background-color: @successBackground; - border-color: @successBorder; + border-color: @successBorder; color: @successText; } .alert-danger,