aboutsummaryrefslogtreecommitdiff
path: root/docs/components
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2015-04-16 16:56:40 -0700
committerMark Otto <[email protected]>2015-04-16 16:56:40 -0700
commit466d36e54175ee00927d6518d9481acd2d210590 (patch)
treeb24687c6657e786c372a4467d059ca064b590dbb /docs/components
parent801d49fb32ffe03a9cc9fd4225896d747b37a0a5 (diff)
downloadbootstrap-466d36e54175ee00927d6518d9481acd2d210590.tar.xz
bootstrap-466d36e54175ee00927d6518d9481acd2d210590.zip
Redo all our callouts with the custom callout plugin
- Replaces manual use of .bd-callout with {% callout [type] %} - Rearranged some callouts for proximity to others - Turned long lists of callouts--like those on tooltips, plugings, etc--into a list because holy shit that's overwhelming
Diffstat (limited to 'docs/components')
-rw-r--r--docs/components/alerts.md18
-rw-r--r--docs/components/button-dropdown.md9
-rw-r--r--docs/components/button-group.md21
-rw-r--r--docs/components/carousel.md27
-rw-r--r--docs/components/collapse.md19
-rw-r--r--docs/components/dropdowns.md18
-rw-r--r--docs/components/helpers.md37
-rw-r--r--docs/components/modal.md50
-rw-r--r--docs/components/popovers.md79
-rw-r--r--docs/components/scrollspy.md18
-rw-r--r--docs/components/tooltips.md62
11 files changed, 189 insertions, 169 deletions
diff --git a/docs/components/alerts.md b/docs/components/alerts.md
index 796b463ba..83f34f5b7 100644
--- a/docs/components/alerts.md
+++ b/docs/components/alerts.md
@@ -7,10 +7,11 @@ Provide contextual feedback messages for typical user actions with the handful o
Wrap any text and an optional dismiss button in `.alert` and one of the four contextual classes (e.g., `.alert-success`) for basic alert messages.
-<div class="bd-callout bd-callout-info">
- <h4>No default class</h4>
- <p>Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.</p>
-</div>
+{% callout info %}
+#### No default class
+
+Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
+{% endcallout %}
{% example html %}
<div class="alert alert-success" role="alert">
@@ -41,10 +42,11 @@ Build on any alert by adding an optional `.alert-dismissible` and [close button]
</div>
{% endexample %}
-<div class="bd-callout bd-callout-warning">
- <h4>Ensure proper behavior across all devices</h4>
- <p>Be sure to use the <code>&lt;button&gt;</code> element with the <code>data-dismiss="alert"</code> data attribute.</p>
-</div>
+{% callout warning %}
+#### Ensure proper behavior across all devices
+
+Be sure to use the `<button>` element with the `data-dismiss="alert"` data attribute.
+{% endcallout %}
### Link color
diff --git a/docs/components/button-dropdown.md b/docs/components/button-dropdown.md
index 4b2d6e87a..1e44d7853 100644
--- a/docs/components/button-dropdown.md
+++ b/docs/components/button-dropdown.md
@@ -5,10 +5,11 @@ title: Button dropdown
Use any button to trigger a dropdown menu by placing it within a `.btn-group` and providing the proper dropdown menu markup.
-<div class="bd-callout bd-callout-danger">
- <h4>Plugin dependency</h4>
- <p>Button dropdowns require the <a href="../javascript/#dropdowns">dropdown plugin</a> to be included in your version of Bootstrap.</p>
-</div>
+{% callout danger %}
+#### Plugin dependency
+
+Button dropdowns require the [dropdown plugin](../javascript/#dropdowns) to be included in your version of Bootstrap.
+{% endcallout %}
### Single button dropdowns
diff --git a/docs/components/button-group.md b/docs/components/button-group.md
index 3b90e61c9..9f223c7de 100644
--- a/docs/components/button-group.md
+++ b/docs/components/button-group.md
@@ -5,16 +5,19 @@ title: Button group
Group a series of buttons together on a single line with the button group. Add on optional JavaScript radio and checkbox style behavior with [our buttons plugin](../javascript/#buttons).
-<div class="bd-callout bd-callout-warning">
- <h4>Tooltips &amp; popovers in button groups require special setting</h4>
- <p>When using tooltips or popovers on elements within a <code>.btn-group</code>, you'll have to specify the option <code>container: 'body'</code> to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).</p>
-</div>
+{% callout warning %}
+#### Tooltips & popovers in button groups require special setting
-<div class="bd-callout bd-callout-warning">
- <h4>Ensure correct <code>role</code> and provide a label</h4>
- <p>In order for assistive technologies – such as screen readers – to convey that a series of buttons is grouped, an appropriate <code>role</code> attribute needs to be provided. For button groups, this would be <code>role="group"</code>, while toolbars should have a <code>role="toolbar"</code>.</p>
- <p>In addition, groups and toolbars should be given an explicit label, as most assistive technologies will otherwise not announce them, despite the presence of the correct <code>role</code> attribute. In the examples provided here, we use <code>aria-label</code>, but alternatives such as <code>aria-labelledby</code> can also be used.</p>
-</div>
+When using tooltips or popovers on elements within a `.btn-group`, you'll have to specify the option `container: 'body'` to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).
+{% endcallout %}
+
+{% callout warning %}
+#### Ensure correct `role` and provide a label
+
+In order for assistive technologies – such as screen readers – to convey that a series of buttons is grouped, an appropriate `role` attribute needs to be provided. For button groups, this would be `role="group"`, while toolbars should have a `role="toolbar"`.
+
+In addition, groups and toolbars should be given an explicit label, as most assistive technologies will otherwise not announce them, despite the presence of the correct `role` attribute. In the examples provided here, we use `aria-label`, but alternatives such as `aria-labelledby` can also be used.
+{% endcallout %}
### Basic example
diff --git a/docs/components/carousel.md b/docs/components/carousel.md
index d8de77c63..138358f37 100644
--- a/docs/components/carousel.md
+++ b/docs/components/carousel.md
@@ -36,15 +36,17 @@ A slideshow component for cycling through elements—images or slides of text—
</div>
{% endexample %}
-<div class="bd-callout bd-callout-warning" id="callout-carousel-transitions">
- <h4>Transition animations not supported in Internet Explorer 9</h4>
- <p>Bootstrap exclusively uses CSS3 for its animations, but Internet Explorer 9 doesn't support the necessary CSS properties. Thus, there are no slide transition animations when using that browser. We have intentionally decided not to include jQuery-based fallbacks for the transitions.</p>
-</div>
+{% callout warning %}
+#### Transition animations not supported in Internet Explorer 9
-<div class="bd-callout bd-callout-warning" id="callout-carousel-active">
- <h4>Initial active element required</h4>
- <p>The <code>.active</code> class needs to be added to one of the slides. Otherwise, the carousel will not be visible.</p>
-</div>
+Bootstrap exclusively uses CSS3 for its animations, but Internet Explorer 9 doesn't support the necessary CSS properties. Thus, there are no slide transition animations when using that browser. We have intentionally decided not to include jQuery-based fallbacks for the transitions.
+{% endcallout %}
+
+{% callout warning %}
+#### Initial active element required
+
+The `.active` class needs to be added to one of the slides. Otherwise, the carousel will not be visible.
+{% endcallout %}
### Optional captions
@@ -101,10 +103,11 @@ Add captions to your slides easily with the `.carousel-caption` element within a
</div>
{% endhighlight %}
-<div class="bd-callout bd-callout-danger">
- <h4>Accessibility issue</h4>
- <p>The carousel component is generally not compliant with accessibility standards. If you need to be compliant, please consider other options for presenting your content.</p>
-</div>
+{% callout danger %}
+#### Accessibility issue
+
+The carousel component is generally not compliant with accessibility standards. If you need to be compliant, please consider other options for presenting your content.
+{% endcallout %}
## Usage
diff --git a/docs/components/collapse.md b/docs/components/collapse.md
index 1f5f02f70..e61fb82b5 100644
--- a/docs/components/collapse.md
+++ b/docs/components/collapse.md
@@ -5,10 +5,11 @@ title: Collapse
Flexible plugin that utilizes a handful of classes for easy toggle behavior.
-<div class="bd-callout bd-callout-danger">
- <h4>Plugin dependency</h4>
- <p>Collapse requires the <a href="#transitions">transitions plugin</a> to be included in your version of Bootstrap.</p>
-</div>
+{% callout danger %}
+#### Plugin dependency
+
+Collapse requires the [transitions plugin](#transitions) to be included in your version of Bootstrap.
+{% endcallout %}
## Example
@@ -87,11 +88,11 @@ Extend the default collapse behavior to create an accordion with the panel compo
</div>
{% endexample %}
-<div class="bd-callout bd-callout-warning">
- <h4>Make expand/collapse controls accessible</h4>
- <p>Be sure to add <code>aria-expanded</code> to the control element. This attribute explicitly defines the current state of the collapsible element to screen readers and similar assistive technologies. If the collapsible element is closed by default, it should have a value of <code>aria-expanded="false"</code>. If you've set the collapsible element to be open by default using the <code>in</code> class, set <code>aria-expanded="true"</code> on the control instead. The plugin will automatically toggle this attribute based on whether or not the collapsible element has been opened or closed.</p>
- <p>Additionally, if your control element is targetting a single collapsible element – i.e. the <code>data-target</code> attribute is pointing to an <code>id</code> selector – you may add an additional <code>aria-controls</code> attribute to the control element, containing the <code>id</code> of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.</p>
-</div>
+## Accessibility
+
+Be sure to add `aria-expanded` to the control element. This attribute explicitly defines the current state of the collapsible element to screen readers and similar assistive technologies. If the collapsible element is closed by default, it should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `in` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute based on whether or not the collapsible element has been opened or closed.
+
+Additionally, if your control element is targetting a single collapsible element – i.e. the `data-target` attribute is pointing to an `id` selector – you may add an additional `aria-controls` attribute to the control element, containing the `id` of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.
## Usage
diff --git a/docs/components/dropdowns.md b/docs/components/dropdowns.md
index fe5f81e47..a24093d9a 100644
--- a/docs/components/dropdowns.md
+++ b/docs/components/dropdowns.md
@@ -32,10 +32,11 @@ Wrap the dropdown's trigger and the dropdown menu within `.dropdown`, or another
By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. Add `.dropdown-menu-right` to a `.dropdown-menu` to right align the dropdown menu.
-<div class="bd-callout bd-callout-warning">
- <h4>May require additional positioning</h4>
- <p>Dropdowns are automatically positioned via CSS within the normal flow of the document. This means dropdowns may be cropped by parents with certain <code>overflow</code> properties or appear out of bounds of the viewport. Address these issues on your own as they arise.</p>
-</div>
+{% callout warning %}
+#### May require additional positioning
+
+Dropdowns are automatically positioned via CSS within the normal flow of the document. This means dropdowns may be cropped by parents with certain `overflow` properties or appear out of bounds of the viewport. Address these issues on your own as they arise.
+{% endcallout %}
{% highlight html %}
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="dLabel">
@@ -146,10 +147,11 @@ Call the dropdowns via JavaScript:
$('.dropdown-toggle').dropdown()
{% endhighlight %}
-<div class="bd-callout bd-callout-info">
- <h4><code>data-toggle="dropdown"</code> still required</h4>
- <p>Regardless of whether you call your dropdown via JavaScript or instead use the data-api, <code>data-toggle="dropdown"</code> is always required to be present on the dropdown's trigger element.</p>
-</div>
+{% callout info %}
+#### `data-toggle="dropdown"` still required
+
+Regardless of whether you call your dropdown via JavaScript or instead use the data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element.
+{% endcallout %}
### Options
diff --git a/docs/components/helpers.md b/docs/components/helpers.md
index 9962fea40..d2f165bce 100644
--- a/docs/components/helpers.md
+++ b/docs/components/helpers.md
@@ -16,14 +16,17 @@ Convey meaning through color with a handful of emphasis utility classes. These m
<p class="text-danger">Donec ullamcorper nulla non metus auctor fringilla.</p>
{% endexample %}
-<div class="bd-callout bd-callout-info">
- <h4>Dealing with specificity</h4>
- <p>Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <code>&lt;span&gt;</code> with the class.</p>
-</div>
-<div class="bd-callout bd-callout-warning">
- <h4>Conveying meaning to assistive technologies</h4>
- <p>Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the contextual colors are only used to reinforce meaning that is already present in the text/markup), or is included through alternative means, such as additional text hidden with the <code>.sr-only</code> class.</p>
-</div>
+{% callout info %}
+#### Dealing with specificity
+
+Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a `<span>` with the class.
+{% endcallout %}
+
+{% callout warning %}
+#### Conveying meaning to assistive technologies
+
+Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the contextual colors are only used to reinforce meaning that is already present in the text/markup), or is included through alternative means, such as additional text hidden with the `.sr-only` class.
+{% endcallout %}
### Contextual backgrounds
@@ -37,15 +40,17 @@ Similar to the contextual text color classes, easily set the background of an el
<div class="bg-danger">Donec ullamcorper nulla non metus auctor fringilla.</div>
{% endexample %}
-<div class="bd-callout bd-callout-info">
- <h4>Dealing with specificity</h4>
- <p>Sometimes contextual background classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a <code>&lt;div&gt;</code> with the class.</p>
-</div>
+{% callout info %}
+#### Dealing with specificity
+
+Sometimes contextual background classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a `<div>` with the class.
+{% endcallout %}
+
+{% callout warning %}
+#### Conveying meaning to assistive technologies
-<div class="bd-callout bd-callout-warning">
- <h4>Conveying meaning to assistive technologies</h4>
- <p>As with <a href="#helper-classes-colors">contextual colors</a>, ensure that any meaning conveyed through color is also conveyed in a format that is not purely presentational.</p>
-</div>
+As with [contextual colors](#helper-classes-colors), ensure that any meaning conveyed through color is also conveyed in a format that is not purely presentational.
+{% endcallout %}
### Close icon
diff --git a/docs/components/modal.md b/docs/components/modal.md
index 7a88ad88e..b80b41405 100644
--- a/docs/components/modal.md
+++ b/docs/components/modal.md
@@ -13,18 +13,23 @@ $('#myModal').on('shown.bs.modal', function () {
})
{% endhighlight %}
-<div class="bd-callout bd-callout-warning" id="callout-stacked-modals">
- <h4>Overlapping modals not supported</h4>
- <p>Be sure not to open a modal while another is still visible. Showing more than one modal at a time requires custom code.</p>
-</div>
-<div class="bd-callout bd-callout-warning" id="callout-modal-markup-placement">
- <h4>Modal markup placement</h4>
- <p>Always try to place a modal's HTML code in a top-level position in your document to avoid other components affecting the modal's appearance and/or functionality.</p>
-</div>
-<div class="bd-callout bd-callout-warning">
- <h4>Mobile device caveats</h4>
- <p>There are some caveats regarding using modals on mobile devices. <a href="../getting-started/#support-fixed-position-keyboards">See our browser support docs</a> for details.</p>
-</div>
+{% callout warning %}
+#### Overlapping modals not supported
+
+Be sure not to open a modal while another is still visible. Showing more than one modal at a time requires custom code.
+{% endcallout %}
+
+{% callout warning %}
+#### Modal markup placement
+
+Always try to place a modal's HTML code in a top-level position in your document to avoid other components affecting the modal's appearance and/or functionality.
+{% endcallout %}
+
+{% callout warning %}
+#### Mobile device caveats
+
+There are some caveats regarding using modals on mobile devices. [See our browser support docs](../getting-started/#support-fixed-position-keyboards) for details.
+{% endcallout %}
### Static example
@@ -158,16 +163,19 @@ Toggle a modal via JavaScript by clicking the button below. It will slide down a
</div>
{% endhighlight %}
-<div class="bd-callout bd-callout-warning">
- <h4>Make modals accessible</h4>
- <p>Be sure to add <code>role="dialog"</code> to <code>.modal</code>, <code>aria-labelledby="myModalLabel"</code> attribute to reference the modal title, and <code>aria-hidden="true"</code> to tell assistive technologies to skip the modal's DOM elements.</p>
- <p>Additionally, you may give a description of your modal dialog with <code>aria-describedby</code> on <code>.modal</code>.</p>
-</div>
+{% callout warning %}
+#### Make modals accessible
-<div class="bd-callout bd-callout-info">
- <h4>Embedding YouTube videos</h4>
- <p>Embedding YouTube videos in modals requires additional JavaScript not in Bootstrap to automatically stop playback and more. <a href="http://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal">See this helpful Stack Overflow post</a> for more information.</p>
-</div>
+Be sure to add `role="dialog"` to `.modal`, `aria-labelledby="myModalLabel"` attribute to reference the modal title, and `aria-hidden="true"` to tell assistive technologies to skip the modal's DOM elements.
+
+Additionally, you may give a description of your modal dialog with `aria-describedby` on `.modal`.
+{% endcallout %}
+
+{% callout info %}
+#### Embedding YouTube videos
+
+Embedding YouTube videos in modals requires additional JavaScript not in Bootstrap to automatically stop playback and more. [See this helpful Stack Overflow post](http://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal) for more information.
+{% endcallout %}
## Optional sizes
diff --git a/docs/components/popovers.md b/docs/components/popovers.md
index 01be0e1b6..478e75f0b 100644
--- a/docs/components/popovers.md
+++ b/docs/components/popovers.md
@@ -3,42 +3,41 @@ layout: page
title: Popovers
---
-Add small overlays of content, like those on the iPad, to any element for housing secondary information.
+Add small overlays of content, like those found in iOS, to any element for housing secondary information.
-Popovers whose both title and content are zero-length are never displayed.
+## Overview
+
+Things to know when using the popover plugin:
+
+- Popovers require the [tooltip plugin](/components/tooltips) as a dependency.
+- Popovers are opt-in for performance reasons, so **you must initialize them yourself**.
+- Zero-length `title` and `content` values will never show a popover.
+- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).
+- Triggering popovers on hidden elements will not work.
+- Popovers for `.disabled` or `disabled` elements must be triggered on a wrapper element.
+- When triggered from hyperlinks that span multiple lines, popovers will be centered. Use `white-space: nowrap;` on your `<a>`s to avoid this behavior.
+
+## Example: Enable popovers everywhere
+
+One way to initialize all popovers on a page would be to select them by their `data-toggle` attribute:
-<div class="bd-callout bd-callout-danger">
- <h4>Plugin dependency</h4>
- <p>Popovers require the <a href="#tooltips">tooltip plugin</a> to be included in your version of Bootstrap.</p>
-</div>
-<div class="bd-callout bd-callout-danger">
- <h4>Opt-in functionality</h4>
- <p>For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning <strong>you must initialize them yourself</strong>.</p>
- <p>One way to initialize all popovers on a page would be to select them by their <code>data-toggle</code> attribute:</p>
{% highlight js %}
$(function () {
$('[data-toggle="popover"]').popover()
})
{% endhighlight %}
-</div>
-<div class="bd-callout bd-callout-warning">
- <h4>Popovers in button groups and input groups require special setting</h4>
- <p>When using popovers on elements within a <code>.btn-group</code> or an <code>.input-group</code>, you'll have to specify the option <code>container: 'body'</code> (documented below) to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the popover is triggered).</p>
-</div>
-<div class="bd-callout bd-callout-warning">
- <h4>Don't try to show popovers on hidden elements</h4>
- <p>Invoking <code>$(...).popover('show')</code> when the target element is <code>display: none;</code> will cause the popover to be incorrectly positioned.</p>
-</div>
-<div class="bd-callout bd-callout-info">
- <h4>Popovers on disabled elements require wrapper elements</h4>
- <p>To add a popover to a <code>disabled</code> or <code>.disabled</code> element, put the element inside of a <code>&lt;div&gt;</code> and apply the popover to that <code>&lt;div&gt;</code> instead.</p>
-</div>
-<div class="bd-callout bd-callout-info">
- <h4>Multiple-line links</h4>
- <p>Sometimes you want to add a popover to a hyperlink that wraps multiple lines. The default behavior of the popover plugin is to center it horizontally and vertically. Add <code>white-space: nowrap;</code> to your anchors to avoid this.</p>
-</div>
-### Static popover
+## Example: Using the `container` option
+
+{% highlight js %}
+$(function () {
+ $('.example-popover').popover(
+ container: 'body'
+ )
+})
+{% endhighlight %}
+
+## Static popover
Four options are available: top, right, bottom, and left aligned.
@@ -79,13 +78,13 @@ Four options are available: top, right, bottom, and left aligned.
<div class="clearfix"></div>
</div>
-### Live demo
+## Live demo
{% example html %}
<button type="button" class="btn btn-lg btn-danger bd-popover" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
{% endexample %}
-#### Four directions
+### Four directions
<div class="bd-example popover-demo">
<div class="bd-example-popovers">
@@ -123,14 +122,15 @@ sagittis lacus vel augue laoreet rutrum faucibus.">
</button>
{% endhighlight %}
-#### Dismiss on next click
+### Dismiss on next click
Use the `focus` trigger to dismiss popovers on the next click that the user makes.
-<div class="bd-callout bd-callout-danger">
- <h4>Specific markup required for dismiss-on-next-click</h4>
- <p>For proper cross-browser and cross-platform behavior, you must use the <code>&lt;a&gt;</code> tag, <i>not</i> the <code>&lt;button&gt;</code> tag, and you also must include a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#tabindex"><code>tabindex</code></a> attribute.</p>
-</div>
+{% callout danger %}
+#### Specific markup required for dismiss-on-next-click
+
+For proper cross-browser and cross-platform behavior, you must use the `<a>` tag, _not_ the `<button>` tag, and you also must include a [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#tabindex) attribute.
+{% endcallout %}
{% example html %}
<a tabindex="0" class="btn btn-lg btn-danger bd-popover" role="button" data-toggle="popover" data-trigger="focus" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
@@ -258,10 +258,11 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</table>
</div>
-<div class="bd-callout bd-callout-info">
- <h4>Data attributes for individual popovers</h4>
- <p>Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.</p>
-</div>
+{% callout info %}
+#### Data attributes for individual popovers
+
+Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.
+{% endcallout %}
### Methods
diff --git a/docs/components/scrollspy.md b/docs/components/scrollspy.md
index 1164c7563..dde50fc2a 100644
--- a/docs/components/scrollspy.md
+++ b/docs/components/scrollspy.md
@@ -93,15 +93,17 @@ After adding `position: relative;` in your CSS, call the scrollspy via JavaScrip
$('body').scrollspy({ target: '#navbar-example' })
{% endhighlight %}
-<div class="bd-callout bd-callout-danger">
- <h4>Resolvable ID targets required</h4>
- <p>Navbar links must have resolvable id targets. For example, a <code>&lt;a href="#home"&gt;home&lt;/a&gt;</code> must correspond to something in the DOM like <code>&lt;div id="home"&gt;&lt;/div&gt;</code>.</p>
-</div>
+{% callout danger %}
+#### Resolvable ID targets required
-<div class="bd-callout bd-callout-info">
- <h4>Non-<code>:visible</code> target elements ignored</h4>
- <p>Target elements that are not <a href="http://api.jquery.com/visible-selector/"><code>:visible</code> according to jQuery</a> will be ignored and their corresponding nav items will never be highlighted.</p>
-</div>
+Navbar links must have resolvable id targets. For example, a `<a href="#home">home</a>` must correspond to something in the DOM like `<div id="home"></div>`.
+{% endcallout %}
+
+{% callout info %}
+#### Non-`:visible` target elements ignored
+
+Target elements that are not [`:visible` according to jQuery](http://api.jquery.com/visible-selector/) will be ignored and their corresponding nav items will never be highlighted.
+{% endcallout %}
### Methods
diff --git a/docs/components/tooltips.md b/docs/components/tooltips.md
index b8600d912..3bb3763d5 100644
--- a/docs/components/tooltips.md
+++ b/docs/components/tooltips.md
@@ -3,11 +3,30 @@ layout: page
title: Tooltips
---
-## Examples
-
Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.
-Tooltips with zero-length titles are never displayed.
+## Overview
+
+Things to know when using the popover plugin:
+
+- Tooltips are opt-in for performance reasons, so **you must initialize them yourself**.
+- Tooltips with zero-length titles are never displayed.
+- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).
+- Triggering tooltips on hidden elements will not work.
+- Tooltips for `.disabled` or `disabled` elements must be triggered on a wrapper element.
+- When triggered from hyperlinks that span multiple lines, tooltips will be centered. Use `white-space: nowrap;` on your `<a>`s to avoid this behavior.
+
+## Example: Enable popovers everywhere
+
+One way to initialize all tooltips on a page would be to select them by their `data-toggle` attribute:
+
+{% highlight js %}
+$(function () {
+ $('[data-toggle="tooltip"]').tooltip()
+})
+{% endhighlight %}
+
+## Examples
Hover over the links below to see tooltips:
@@ -75,29 +94,6 @@ Hover over the buttons below to see their tooltips.
</button>
{% endhighlight %}
-<div class="bd-callout bd-callout-danger">
- <h4>Opt-in functionality</h4>
- <p>For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning <strong>you must initialize them yourself</strong>.</p>
- <p>One way to initialize all tooltips on a page would be to select them by their <code>data-toggle</code> attribute:</p>
-{% highlight js %}
-$(function () {
- $('[data-toggle="tooltip"]').tooltip()
-})
-{% endhighlight %}
-</div>
-<div class="bd-callout bd-callout-warning">
- <h4>Tooltips in button groups and input groups require special setting</h4>
- <p>When using tooltips on elements within a <code>.btn-group</code> or an <code>.input-group</code>, you'll have to specify the option <code>container: 'body'</code> (documented below) to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip is triggered).</p>
-</div>
-<div class="bd-callout bd-callout-warning">
- <h4>Don't try to show tooltips on hidden elements</h4>
- <p>Invoking <code>$(...).tooltip('show')</code> when the target element is <code>display: none;</code> will cause the tooltip to be incorrectly positioned.</p>
-</div>
-<div class="bd-callout bd-callout-info">
- <h4>Tooltips on disabled elements require wrapper elements</h4>
- <p>To add a tooltip to a <code>disabled</code> or <code>.disabled</code> element, put the element inside of a <code>&lt;div&gt;</code> and apply the tooltip to that <code>&lt;div&gt;</code> instead.</p>
-</div>
-
## Usage
The tooltip plugin generates content and markup on demand, and by default places tooltips after their trigger element.
@@ -112,11 +108,6 @@ $('#example').tooltip(options)
The required markup for a tooltip is only a `data` attribute and `title` on the HTML element you wish to have a tooltip. The generated markup of a tooltip is rather simple, though it does require a position (by default, set to `top` by the plugin).
-<div class="bd-callout bd-callout-warning">
- <h4>Multiple-line links</h4>
- <p>Sometimes you want to add a tooltip to a hyperlink that wraps multiple lines. The default behavior of the tooltip plugin is to center it horizontally and vertically. Add <code>white-space: nowrap;</code> to your anchors to avoid this.</p>
-</div>
-
{% highlight html %}
<!-- HTML to write -->
<a href="#" data-toggle="tooltip" title="Some tooltip text!">Hover over me</a>
@@ -228,10 +219,11 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</table>
</div>
-<div class="bd-callout bd-callout-info">
- <h4>Data attributes for individual tooltips</h4>
- <p>Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.</p>
-</div>
+{% callout info %}
+#### Data attributes for individual tooltips
+
+Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.
+{% endcallout %}
### Methods