diff options
| author | Mark Otto <[email protected]> | 2016-12-04 21:05:19 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-12-04 21:05:19 -0800 |
| commit | 1e3ec8935520e2d118d9d7742abd80183d34beb2 (patch) | |
| tree | 3a2e940d7d91d578db4fe86675fa9d2a11bb9512 /docs/components | |
| parent | 6782dd6e92637f85e3778584ec417a775d01243f (diff) | |
| parent | 5a19d4870537ca85ba38beeb7eabe80858417b72 (diff) | |
| download | bootstrap-1e3ec8935520e2d118d9d7742abd80183d34beb2.tar.xz bootstrap-1e3ec8935520e2d118d9d7742abd80183d34beb2.zip | |
Merge branch 'v4-dev' into carousel
Diffstat (limited to 'docs/components')
| -rw-r--r-- | docs/components/card.md | 40 | ||||
| -rw-r--r-- | docs/components/forms.md | 125 | ||||
| -rw-r--r-- | docs/components/list-group.md | 8 | ||||
| -rw-r--r-- | docs/components/modal.md | 2 | ||||
| -rw-r--r-- | docs/components/navbar.md | 6 | ||||
| -rw-r--r-- | docs/components/navs.md | 2 | ||||
| -rw-r--r-- | docs/components/progress.md | 12 | ||||
| -rw-r--r-- | docs/components/tooltips.md | 2 |
8 files changed, 100 insertions, 97 deletions
diff --git a/docs/components/card.md b/docs/components/card.md index f876ccad2..7d350708c 100644 --- a/docs/components/card.md +++ b/docs/components/card.md @@ -151,13 +151,13 @@ You can quickly change the text alignment of any card—in its entirety or speci <a href="#" class="btn btn-primary">Go somewhere</a> </div> -<div class="card card-block text-xs-center"> +<div class="card card-block text-center"> <h4 class="card-title">Special title treatment</h4> <p class="card-text">With supporting text below as a natural lead-in to additional content.</p> <a href="#" class="btn btn-primary">Go somewhere</a> </div> -<div class="card card-block text-xs-right"> +<div class="card card-block text-right"> <h4 class="card-title">Special title treatment</h4> <p class="card-text">With supporting text below as a natural lead-in to additional content.</p> <a href="#" class="btn btn-primary">Go somewhere</a> @@ -209,7 +209,7 @@ Card headers can be styled by adding `.card-header` to `<h*>` elements. {% endexample %} {% example html %} -<div class="card text-xs-center"> +<div class="card text-center"> <div class="card-header"> Featured </div> @@ -229,7 +229,7 @@ Card headers can be styled by adding `.card-header` to `<h*>` elements. Use Bootstrap's nav pills or tabs within a card header. Be sure to always include a `.float-*-*` utility class for proper alignment. {% example html %} -<div class="card text-xs-center"> +<div class="card text-center"> <div class="card-header"> <ul class="nav nav-tabs card-header-tabs float-left"> <li class="nav-item"> @@ -252,7 +252,7 @@ Use Bootstrap's nav pills or tabs within a card header. Be sure to always includ {% endexample %} {% example html %} -<div class="card text-xs-center"> +<div class="card text-center"> <div class="card-header"> <ul class="nav nav-pills card-header-pills float-left"> <li class="nav-item"> @@ -314,7 +314,7 @@ Turn an image into a card background and overlay your card's text. Depending on ## Inverted text -Cards include a class for quickly toggling **the text color**. By default, cards use dark text and assume a light background. **Add `.card-inverse` for white text** and specify the `background-color` and `border-color` to go with it. +By default, cards use dark text and assume a light background. You can reverse that by toggling the `color` of text within, as well as that of the card's subcomponents, with `.card-inverse`. Then, specify a dark `background-color` and `border-color` to go with it. You can also use `.card-inverse` with the [contextual backgrounds variants](#background-variants). @@ -333,7 +333,7 @@ You can also use `.card-inverse` with the [contextual backgrounds variants](#bac Cards include their own variant classes for quickly changing the `background-color` and `border-color` of a card. **Darker colors require the use of `.card-inverse`.** {% example html %} -<div class="card card-inverse card-primary text-xs-center"> +<div class="card card-inverse card-primary text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -341,7 +341,7 @@ Cards include their own variant classes for quickly changing the `background-col </blockquote> </div> </div> -<div class="card card-inverse card-success text-xs-center"> +<div class="card card-inverse card-success text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -349,7 +349,7 @@ Cards include their own variant classes for quickly changing the `background-col </blockquote> </div> </div> -<div class="card card-inverse card-info text-xs-center"> +<div class="card card-inverse card-info text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -357,7 +357,7 @@ Cards include their own variant classes for quickly changing the `background-col </blockquote> </div> </div> -<div class="card card-inverse card-warning text-xs-center"> +<div class="card card-inverse card-warning text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -365,7 +365,7 @@ Cards include their own variant classes for quickly changing the `background-col </blockquote> </div> </div> -<div class="card card-inverse card-danger text-xs-center"> +<div class="card card-inverse card-danger text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -383,7 +383,7 @@ Cards include their own variant classes for quickly changing the `background-col In need of a colored card, but not the hefty background colors they bring? Replace the default modifier classes with the `.card-outline-*` ones to style just the `border-color` of a card. {% example html %} -<div class="card card-outline-primary text-xs-center"> +<div class="card card-outline-primary text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -391,7 +391,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla </blockquote> </div> </div> -<div class="card card-outline-secondary text-xs-center"> +<div class="card card-outline-secondary text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -399,7 +399,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla </blockquote> </div> </div> -<div class="card card-outline-success text-xs-center"> +<div class="card card-outline-success text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -407,7 +407,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla </blockquote> </div> </div> -<div class="card card-outline-info text-xs-center"> +<div class="card card-outline-info text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -415,7 +415,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla </blockquote> </div> </div> -<div class="card card-outline-warning text-xs-center"> +<div class="card card-outline-warning text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -423,7 +423,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla </blockquote> </div> </div> -<div class="card card-outline-danger text-xs-center"> +<div class="card card-outline-danger text-center"> <div class="card-block"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> @@ -542,7 +542,7 @@ Only applies to small devices and above. <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> </div> </div> - <div class="card card-block card-inverse card-primary text-xs-center"> + <div class="card card-block card-inverse card-primary text-center"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p> <footer> @@ -552,7 +552,7 @@ Only applies to small devices and above. </footer> </blockquote> </div> - <div class="card card-block text-xs-center"> + <div class="card card-block text-center"> <h4 class="card-title">Card title</h4> <p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p> <p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> @@ -560,7 +560,7 @@ Only applies to small devices and above. <div class="card"> <img class="card-img img-fluid" data-src="holder.js/100px260/" alt="Card image"> </div> - <div class="card card-block text-xs-right"> + <div class="card card-block text-right"> <blockquote class="card-blockquote"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <footer> diff --git a/docs/components/forms.md b/docs/components/forms.md index 8915c9e7b..4cbf20412 100644 --- a/docs/components/forms.md +++ b/docs/components/forms.md @@ -152,8 +152,7 @@ Below is a complete list of the specific form controls supported by Bootstrap an <tr> <td class="text-nowrap"> {% markdown %} -`.form-check`<br> -`.form-check-inline` +`.form-check` {% endmarkdown %} </td> <td class="text-nowrap"> @@ -274,62 +273,54 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o ### Inline forms -Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms behave differently: +Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms vary slightly from their default states. -- Controls are `display: inline-block` to provide alignment control via `vertical-align` and `margin`. -- Controls receive `width: auto` to override the Bootstrap default `width: 100%`. -- Controls **only appear inline in viewports that are at least 768px wide** to account for narrow viewports on mobile devices. +- Controls are `display: inline-block` (or `flex` when enabled) to provide alignment control via `vertical-align` and `margin`. Those also means you'll have some HTML character spaces between elements by default. +- Controls and input groups receive `width: auto` to override the Bootstrap default `width: 100%`. +- Controls **only appear inline in viewports that are at least 576px wide** to account for narrow viewports on mobile devices. -Because of this, you may need to manually address the width and alignment of individual form controls. Lastly, as shown below, you should always include a `<label>` with each form control. - -#### Visible labels +You may need to manually address the width and alignment of individual form controls with [spacing utilities]({{ site.baseurl }}/utilities/spacing/) (as shown below). Lastly, be sure to always include a `<label>` with each form control, even if you need to hide it from non-screenreader visitors with `.sr-only`. {% example html %} <form class="form-inline"> - <div class="form-group"> - <label for="exampleInputName2">Name</label> - <input type="text" class="form-control" id="exampleInputName2" placeholder="Jane Doe"> - </div> - <div class="form-group"> - <label for="exampleInputEmail2">Email</label> - <input type="email" class="form-control" id="exampleInputEmail2" placeholder="[email protected]"> - </div> - <button type="submit" class="btn btn-primary">Send invitation</button> -</form> -{% endexample %} + <label class="sr-only" for="inlineFormInput">Name</label> + <input type="text" class="form-control mb-2 mr-sm-2 mb-sm-0" id="inlineFormInput" placeholder="Jane Doe"> -#### Hidden labels - -{% example html %} -<form class="form-inline"> - <div class="form-group"> - <label class="sr-only" for="exampleInputEmail3">Email address</label> - <input type="email" class="form-control" id="exampleInputEmail3" placeholder="Enter email"> - </div> - <div class="form-group"> - <label class="sr-only" for="exampleInputPassword3">Password</label> - <input type="password" class="form-control" id="exampleInputPassword3" placeholder="Password"> + <label class="sr-only" for="inlineFormInputGroup">Username</label> + <div class="input-group mb-2 mr-sm-2 mb-sm-0"> + <div class="input-group-addon">@</div> + <input type="text" class="form-control" id="inlineFormInputGroup" placeholder="Username"> </div> - <div class="form-check"> + + <div class="form-check mb-2 mr-sm-2 mb-sm-0"> <label class="form-check-label"> <input class="form-check-input" type="checkbox"> Remember me </label> </div> - <button type="submit" class="btn btn-primary">Sign in</button> + + <button type="submit" class="btn btn-primary">Submit</button> </form> {% endexample %} +Custom form controls and selects are also supported. + {% example html %} <form class="form-inline"> - <div class="form-group"> - <label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label> - <div class="input-group"> - <div class="input-group-addon">$</div> - <input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount"> - <div class="input-group-addon">.00</div> - </div> - </div> - <button type="submit" class="btn btn-primary">Transfer cash</button> + <label class="mr-sm-2" for="inlineFormCustomSelect">Preference</label> + <select class="custom-select mb-2 mr-sm-2 mb-sm-0" id="inlineFormCustomSelect"> + <option selected>Choose...</option> + <option value="1">One</option> + <option value="2">Two</option> + <option value="3">Three</option> + </select> + + <label class="custom-control custom-checkbox mb-2 mr-sm-2 mb-sm-0"> + <input type="checkbox" class="custom-control-input"> + <span class="custom-control-indicator"></span> + <span class="custom-control-description">Remember my preference</span> + </label> + + <button type="submit" class="btn btn-primary">Submit</button> </form> {% endexample %} @@ -471,30 +462,42 @@ By default, any number of checkboxes and radios that are immediate sibling will ### Inline -Groups of checkboxes or radios that appear on the same horizontal row are similar to their stacked counterparts, but require different HTML and a single class. To switch from stacked to inline, drop the surrounding `<div>`, add `.form-check-inline` to the `<label>`, and keep the `.form-check-input` on the `<input>`. +Group checkboxes or radios on the same horizontal row by adding `.form-check-inline` to any `.form-check`. {% example html %} -<label class="form-check-inline"> - <input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1"> 1 -</label> -<label class="form-check-inline"> - <input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2"> 2 -</label> -<label class="form-check-inline"> - <input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3"> 3 -</label> +<div class="form-check form-check-inline"> + <label class="form-check-label"> + <input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1"> 1 + </label> +</div> +<div class="form-check form-check-inline"> + <label class="form-check-label"> + <input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2"> 2 + </label> +</div> +<div class="form-check form-check-inline disabled"> + <label class="form-check-label"> + <input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3" disabled> 3 + </label> +</div> {% endexample %} {% example html %} -<label class="form-check-inline"> - <input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1 -</label> -<label class="form-check-inline"> - <input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 2 -</label> -<label class="form-check-inline"> - <input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3"> 3 -</label> +<div class="form-check form-check-inline"> + <label class="form-check-label"> + <input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1 + </label> +</div> +<div class="form-check form-check-inline"> + <label class="form-check-label"> + <input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 2 + </label> +</div> +<div class="form-check form-check-inline disabled"> + <label class="form-check-label"> + <input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3" disabled> 3 + </label> +</div> {% endexample %} ### Without labels diff --git a/docs/components/list-group.md b/docs/components/list-group.md index 49a6ced63..820470bbb 100644 --- a/docs/components/list-group.md +++ b/docs/components/list-group.md @@ -46,19 +46,19 @@ Add badges to any list group item to show unread counts, activity, etc. </ul> {% endexample %} -When in flexbox mode, you'll need to rearrange the contents of your list group items. To replicate the right-aligned badges as shown above, use the following example's code. Note the [`flex-items-xs-between` utility class]({{ site.baseurl }}/layout/flexbox-grid/#horizontal-alignment), the badge's placement, and the lack of a float utility on the badges. +When in flexbox mode, you'll need to rearrange the contents of your list group items. To replicate the right-aligned badges as shown above, use the following example's code. Note the [`flex-items-between` utility class]({{ site.baseurl }}/layout/flexbox-grid/#horizontal-alignment), the badge's placement, and the lack of a float utility on the badges. {% highlight html %} <ul class="list-group"> - <li class="list-group-item flex-items-xs-between"> + <li class="list-group-item flex-items-between"> Cras justo odio <span class="badge badge-default badge-pill">14</span> </li> - <li class="list-group-item flex-items-xs-between"> + <li class="list-group-item flex-items-between"> Dapibus ac facilisis in <span class="badge badge-default badge-pill">2</span> </li> - <li class="list-group-item flex-items-xs-between"> + <li class="list-group-item flex-items-between"> Morbi leo risus <span class="badge badge-default badge-pill">1</span> </li> diff --git a/docs/components/modal.md b/docs/components/modal.md index 9c3746116..5b482f93b 100644 --- a/docs/components/modal.md +++ b/docs/components/modal.md @@ -29,7 +29,7 @@ Be sure not to open a modal while another is still visible. Showing more than on {% 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. +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. Placing it within a `position: fixed;` element may adversely affect placement. {% endcallout %} {% callout warning %} diff --git a/docs/components/navbar.md b/docs/components/navbar.md index 34fb6f28b..06a90a212 100644 --- a/docs/components/navbar.md +++ b/docs/components/navbar.md @@ -44,7 +44,7 @@ Here's an example of all the sub-components included in a default, non-responsiv <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> - <a class="nav-link" href="#">Link</a> + <a class="nav-link disabled" href="#">Disabled</a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="http://example.com" id="supportedContentDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a> @@ -118,7 +118,7 @@ Active states—with `.active`—to indicate the current page can be applied dir <a class="nav-link" href="#">Pricing</a> </li> <li class="nav-item"> - <a class="nav-link" href="#">About</a> + <a class="nav-link disabled" href="#">Disabled</a> </li> </ul> </nav> @@ -132,7 +132,7 @@ And because we use classes for our navs, you can avoid the list-based approach e <a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a> <a class="nav-item nav-link" href="#">Features</a> <a class="nav-item nav-link" href="#">Pricing</a> - <a class="nav-item nav-link" href="#">About</a> + <a class="nav-item nav-link disabled" href="#">Disabled</a> </div> </nav> {% endexample %} diff --git a/docs/components/navs.md b/docs/components/navs.md index 86fd0463f..7ac1b5232 100644 --- a/docs/components/navs.md +++ b/docs/components/navs.md @@ -282,7 +282,7 @@ And pills, too: Using our [flexbox utilities]({{ site.baseurl }}/layout/flexbox-grid/#horizontal-alignment), you can also customize your navigation components to change the alignment of nav items. For example, here are center aligned links on the inline nav component. {% example html %} -<ul class="nav nav-inline d-flex flex-items-xs-center"> +<ul class="nav nav-inline d-flex flex-items-center"> <li class="nav-item"> <a class="nav-link active" href="#">Active</a> </li> diff --git a/docs/components/progress.md b/docs/components/progress.md index 2d8db33cb..50d1f1b55 100644 --- a/docs/components/progress.md +++ b/docs/components/progress.md @@ -18,19 +18,19 @@ To caption a progress bar, simply add a `<div>` with your caption text, [align t {% example html %} -<div class="text-xs-center" id="example-caption-1">Reticulating splines… 0%</div> +<div class="text-center" id="example-caption-1">Reticulating splines… 0%</div> <progress class="progress" value="0" max="100" aria-describedby="example-caption-1"></progress> -<div class="text-xs-center" id="example-caption-2">Reticulating splines… 25%</div> +<div class="text-center" id="example-caption-2">Reticulating splines… 25%</div> <progress class="progress" value="25" max="100" aria-describedby="example-caption-2"></progress> -<div class="text-xs-center" id="example-caption-3">Reticulating splines… 50%</div> +<div class="text-center" id="example-caption-3">Reticulating splines… 50%</div> <progress class="progress" value="50" max="100" aria-describedby="example-caption-3"></progress> -<div class="text-xs-center" id="example-caption-4">Reticulating splines… 75%</div> +<div class="text-center" id="example-caption-4">Reticulating splines… 75%</div> <progress class="progress" value="75" max="100" aria-describedby="example-caption-4"></progress> -<div class="text-xs-center" id="example-caption-5">Reticulating splines… 100%</div> +<div class="text-center" id="example-caption-5">Reticulating splines… 100%</div> <progress class="progress" value="100" max="100" aria-describedby="example-caption-5"></progress> {% endexample %} @@ -39,7 +39,7 @@ To caption a progress bar, simply add a `<div>` with your caption text, [align t Internet Explorer 9 doesn't support the HTML5 `<progress>` element, but we can work around that. {% example html %} -<div class="text-xs-center" id="example-caption-6">Reticulating splines… 25%</div> +<div class="text-center" id="example-caption-6">Reticulating splines… 25%</div> <progress class="progress" value="25" max="100" aria-describedby="example-caption-6"> <div class="progress"> <span class="progress-bar" style="width: 25%;"></span> diff --git a/docs/components/tooltips.md b/docs/components/tooltips.md index b6dc451ec..31fb2c1c7 100644 --- a/docs/components/tooltips.md +++ b/docs/components/tooltips.md @@ -165,7 +165,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap </tr> <tr> <td>container</td> - <td>string | false</td> + <td>string | element | false</td> <td>false</td> <td> <p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.</p> |
