diff options
| author | Mark Otto <[email protected]> | 2016-12-28 15:52:28 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-12-28 15:52:28 -0800 |
| commit | 047d4a77da5af8b59fd562935669c550272f57a6 (patch) | |
| tree | 7a2daf4d737693826c6d264113adc6e987c3ae2a /docs/content | |
| parent | 11d52ba9498990483d822a5a42d371393a110080 (diff) | |
| parent | e1e621be046a4541a2fd36e445015ee44de3c67e (diff) | |
| download | bootstrap-047d4a77da5af8b59fd562935669c550272f57a6.tar.xz bootstrap-047d4a77da5af8b59fd562935669c550272f57a6.zip | |
Merge branch 'v4-dev' into v4-docs-streamlined
Diffstat (limited to 'docs/content')
| -rw-r--r-- | docs/content/code.md | 1 | ||||
| -rw-r--r-- | docs/content/figures.md | 11 | ||||
| -rw-r--r-- | docs/content/images.md | 31 | ||||
| -rw-r--r-- | docs/content/reboot.md | 19 | ||||
| -rw-r--r-- | docs/content/tables.md | 293 | ||||
| -rw-r--r-- | docs/content/typography.md | 27 |
6 files changed, 178 insertions, 204 deletions
diff --git a/docs/content/code.md b/docs/content/code.md index 79059a1d1..a62e0845f 100644 --- a/docs/content/code.md +++ b/docs/content/code.md @@ -1,6 +1,7 @@ --- layout: docs title: Code +description: Documentation and examples for displaying inline and multiline blocks of code with Bootstrap. group: content --- diff --git a/docs/content/figures.md b/docs/content/figures.md index d57270518..4f90018c9 100644 --- a/docs/content/figures.md +++ b/docs/content/figures.md @@ -1,25 +1,26 @@ --- layout: docs title: Figures +description: Documentation and examples for displaying related images and text with the figure component in Bootstrap. group: content --- -Anytime you need to display a piece of content—like an image—with an optional caption, consider using a `<figure>`. +Anytime you need to display a piece of content—like an image with an optional caption, consider using a `<figure>`. Use the included `.figure` , `.figure-img` and `.figure-caption` classes to provide some baseline styles for the HTML5 `<figure>` and `<figcaption>` elements. Images in figures have no explicit size, so be sure to add the `.img-fluid` class to your `<img>` to make it responsive. {% example html %} <figure class="figure"> - <img data-src="holder.js/400x300" class="figure-img img-fluid img-rounded" alt="A generic square placeholder image with rounded corners in a figure."> + <img data-src="holder.js/400x300" class="figure-img img-fluid rounded" alt="A generic square placeholder image with rounded corners in a figure."> <figcaption class="figure-caption">A caption for the above image.</figcaption> </figure> {% endexample %} -Aligning the figure's caption is easy with our [text utilities]({{ site.baseurl }}/components/utilities/#text-alignment). +Aligning the figure's caption is easy with our [text utilities]({{ site.baseurl }}/utilities/typography/#text-alignment). {% example html %} <figure class="figure"> - <img data-src="holder.js/400x300" class="figure-img img-fluid img-rounded" alt="A generic square placeholder image with rounded corners in a figure."> - <figcaption class="figure-caption text-xs-right">A caption for the above image.</figcaption> + <img data-src="holder.js/400x300" class="figure-img img-fluid rounded" alt="A generic square placeholder image with rounded corners in a figure."> + <figcaption class="figure-caption text-right">A caption for the above image.</figcaption> </figure> {% endexample %} diff --git a/docs/content/images.md b/docs/content/images.md index f21010f0f..fc8cda6b4 100644 --- a/docs/content/images.md +++ b/docs/content/images.md @@ -1,6 +1,7 @@ --- layout: docs title: Images +description: Documentation and examples for styling images with Bootstrap. group: content --- @@ -29,52 +30,48 @@ Images in Bootstrap are made responsive with `.img-fluid`. `max-width: 100%;` an In Internet Explorer 9-10, SVG images with `.img-fluid` are disproportionately sized. To fix this, add `width: 100% \9;` where necessary. This fix improperly sizes other image formats, so Bootstrap doesn't apply it automatically. {% endcallout %} -## Image shapes +## Image thumbnails -Add classes to an `<img>` element to easily style images in any project. +In addition to our [border-radius utilities]({{ site.baseurl }}/utilities/borders/), you can use `.img-thumbnail` to give an image a rounded 1px border appearance. <div class="bd-example bd-example-images"> - <img data-src="holder.js/200x200" class="img-rounded" alt="A generic square placeholder image with rounded corners"> - <img data-src="holder.js/200x200" class="img-circle" alt="A generic square placeholder image where only the portion within the circle circumscribed about said square is visible"> <img data-src="holder.js/200x200" class="img-thumbnail" alt="A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera"> </div> {% highlight html %} -<img src="..." alt="..." class="img-rounded"> -<img src="..." alt="..." class="img-circle"> <img src="..." alt="..." class="img-thumbnail"> {% endhighlight %} ## Aligning images -Align images with the [helper float classes]({{ site.baseurl }}/components/utilities/#responsive-floats) or [text alignment classes]({{ site.baseurl }}/components/utilities/#text-alignment). `block`-level images can be centered using [the `.m-x-auto` margin utility class]({{ site.baseurl }}/components/utilities/#horizontal-centering). +Align images with the [helper float classes]({{ site.baseurl }}/utilities/responsive-helpers/#responsive-floats) or [text alignment classes]({{ site.baseurl }}/utilities/typography/#text-alignment). `block`-level images can be centered using [the `.mx-auto` margin utility class]({{ site.baseurl }}/utilities/spacing/#horizontal-centering). <div class="bd-example bd-example-images"> - <img data-src="holder.js/200x200" class="img-rounded pull-xs-left" alt="A generic square placeholder image with rounded corners"> - <img data-src="holder.js/200x200" class="img-rounded pull-xs-right" alt="A generic square placeholder image with rounded corners"> + <img data-src="holder.js/200x200" class="rounded float-left" alt="A generic square placeholder image with rounded corners"> + <img data-src="holder.js/200x200" class="rounded float-right" alt="A generic square placeholder image with rounded corners"> </div> {% highlight html %} -<img src="..." class="img-rounded pull-xs-left" alt="..."> -<img src="..." class="img-rounded pull-xs-right" alt="..."> +<img src="..." class="rounded float-left" alt="..."> +<img src="..." class="rounded float-right" alt="..."> {% endhighlight %} <div class="bd-example bd-example-images"> - <img data-src="holder.js/200x200" class="img-rounded m-x-auto d-block" alt="A generic square placeholder image with rounded corners"> + <img data-src="holder.js/200x200" class="rounded mx-auto d-block" alt="A generic square placeholder image with rounded corners"> </div> {% highlight html %} -<img src="..." class="img-rounded m-x-auto d-block" alt="..."> +<img src="..." class="rounded mx-auto d-block" alt="..."> {% endhighlight %} <div class="bd-example bd-example-images"> - <div class="text-xs-center"> - <img data-src="holder.js/200x200" class="img-rounded" alt="A generic square placeholder image with rounded corners"> + <div class="text-center"> + <img data-src="holder.js/200x200" class="rounded" alt="A generic square placeholder image with rounded corners"> </div> </div> {% highlight html %} -<div class="text-xs-center"> - <img src="..." class="img-rounded" alt="..."> +<div class="text-center"> + <img src="..." class="rounded" alt="..."> </div> {% endhighlight %} diff --git a/docs/content/reboot.md b/docs/content/reboot.md index ad8a8a6f6..08ad15a6a 100644 --- a/docs/content/reboot.md +++ b/docs/content/reboot.md @@ -1,6 +1,7 @@ --- layout: docs title: Reboot +description: Documentation and examples for Reboot, Bootstrap's collection of element-specific CSS that builds on Normalize.css. group: content redirect_from: "/content/" --- @@ -40,20 +41,14 @@ The default web fonts (Helvetica Neue, Helvetica, and Arial) have been dropped i $font-family-sans-serif: // Safari for OS X and iOS (San Francisco) -apple-system, - // Chrome for OS X (San Francisco) + // Chrome >= 56 for OS X (San Francisco), Windows, Linux and Android + system-ui, + // Chrome < 56 for OS X (San Francisco) BlinkMacSystemFont, // Windows "Segoe UI", // Android "Roboto", - // Linux - "Oxygen", // KDE - "Ubuntu", - "Cantarell", // GNOME - // Firefox OS [R.I.P.] - "Fira Sans", - // Older Android - "Droid Sans", // Basic web fallback "Helvetica Neue", Arial, sans-serif !default; {% endhighlight %} @@ -316,7 +311,7 @@ The `<abbr>` element receives basic styling to make it stand out amongst paragra ## HTML5 `[hidden]` attribute -HTML5 adds [a new global attribute named `[hidden]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden), which is styled as `display: none` by default. Borrowing an idea from [PureCSS](http://purecss.io), we improve upon this default by making `[hidden] { display: none !important; }` to help prevent its `display` from getting accidentally overridden. While `[hidden]` isn't natively supported by IE9-10, the explicit declaration in our CSS gets around that problem. +HTML5 adds [a new global attribute named `[hidden]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden), which is styled as `display: none` by default. Borrowing an idea from [PureCSS](http://purecss.io), we improve upon this default by making `[hidden] { display: none !important; }` to help prevent its `display` from getting accidentally overridden. While `[hidden]` isn't natively supported by IE10, the explicit declaration in our CSS gets around that problem. {% highlight html %} <input type="text" hidden> @@ -328,7 +323,7 @@ HTML5 adds [a new global attribute named `[hidden]`](https://developer.mozilla.o `[hidden]` is not compatible with jQuery's `$(...).hide()` and `$(...).show()` methods. This could potentially change in jQuery 3, but we're not holding our breath. Therefore, we don't currently especially endorse `[hidden]` over other techniques for managing the `display` of elements. {% endcallout %} -To merely toggle the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document, use [the `.invisible` class]({{ site.baseurl }}/components/utilities/#invisible-content) instead. +To merely toggle the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document, use [the `.invisible` class]({{ site.baseurl }}/utilities/invisible-content/) instead. ## Click delay optimization for touch @@ -342,4 +337,4 @@ To address this problem in IE11 and Microsoft Edge on desktop, as well as IE11 o In the case of old iOS versions (prior to 9.3), the suggested approach is to use additional scripts such as [FastClick](https://github.com/ftlabs/fastclick) to explicitly work around the delay. -For further details, see the compatibility table for [suppressing 300ms delay for touchscreen interactions](http://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay). +For further details, see the compatibility table for [suppressing 300ms delay for touchscreen interactions](https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay). diff --git a/docs/content/tables.md b/docs/content/tables.md index 3b4d58b36..da847611f 100644 --- a/docs/content/tables.md +++ b/docs/content/tables.md @@ -1,6 +1,7 @@ --- layout: docs title: Tables +description: Documentation and examples for styling tables with Bootstrap. group: content --- @@ -13,7 +14,7 @@ Due to the widespread use of tables across third-party widgets like calendars an ## Examples -Using the most basic table markup, here's how `.table`-based tables look in Bootstrap. +Using the most basic table markup, here's how `.table`-based tables look in Bootstrap. **All table styles are inherited in Bootstrap 4**, meaning any nested tables will be styled in the same manner as the parent. {% example html %} <table class="table"> @@ -441,52 +442,50 @@ Add `.table-sm` to make tables more compact by cutting cell padding in half. Use contextual classes to color table rows or individual cells. -<div class="table-responsive"> - <table class="table table-bordered table-striped"> - <colgroup> - <col class="col-xs-1"> - <col class="col-xs-7"> - </colgroup> - <thead> - <tr> - <th>Class</th> - <th>Description</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row"> - <code>.table-active</code> - </th> - <td>Applies the hover color to a particular row or cell</td> - </tr> - <tr> - <th scope="row"> - <code>.table-success</code> - </th> - <td>Indicates a successful or positive action</td> - </tr> - <tr> - <th scope="row"> - <code>.table-info</code> - </th> - <td>Indicates a neutral informative change or action</td> - </tr> - <tr> - <th scope="row"> - <code>.table-warning</code> - </th> - <td>Indicates a warning that might need attention</td> - </tr> - <tr> - <th scope="row"> - <code>.table-danger</code> - </th> - <td>Indicates a dangerous or potentially negative action</td> - </tr> - </tbody> - </table> -</div> +<table class="table table-bordered table-striped table-responsive"> + <colgroup> + <col class="col-1"> + <col class="col-7"> + </colgroup> + <thead> + <tr> + <th>Class</th> + <th>Description</th> + </tr> + </thead> + <tbody> + <tr> + <th scope="row"> + <code>.table-active</code> + </th> + <td>Applies the hover color to a particular row or cell</td> + </tr> + <tr> + <th scope="row"> + <code>.table-success</code> + </th> + <td>Indicates a successful or positive action</td> + </tr> + <tr> + <th scope="row"> + <code>.table-info</code> + </th> + <td>Indicates a neutral informative change or action</td> + </tr> + <tr> + <th scope="row"> + <code>.table-warning</code> + </th> + <td>Indicates a warning that might need attention</td> + </tr> + <tr> + <th scope="row"> + <code>.table-danger</code> + </th> + <td>Indicates a dangerous or potentially negative action</td> + </tr> + </tbody> +</table> <div class="bd-example"> <table class="table"> @@ -575,7 +574,7 @@ Use contextual classes to color table rows or individual cells. </tr> {% endhighlight %} -Regular table background variants are not available with the inverse table, however, you may use [text or background utilities](/components/utilities/#contextual-colors-and-backgrounds) to achieve similar styles. +Regular table background variants are not available with the inverse table, however, you may use [text or background utilities]({{ site.baseurl }}/utilities/colors/) to achieve similar styles. <div class="bd-example"> <table class="table table-inverse"> @@ -669,7 +668,7 @@ Regular table background variants are not available with the inverse table, howe ## Responsive tables -Create responsive tables by wrapping any `.table` in `.table-responsive` to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables. +Create responsive tables by adding `.table-responsive` to any `.table` to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables. {% callout warning %} #### Vertical clipping/truncation @@ -677,118 +676,98 @@ Create responsive tables by wrapping any `.table` in `.table-responsive` to make Responsive tables make use of `overflow-y: hidden`, which clips off any content that goes beyond the bottom or top edges of the table. In particular, this can clip off dropdown menus and other third-party widgets. {% endcallout %} -{% callout warning %} -#### Firefox and fieldsets - -Firefox has some awkward fieldset styling involving `width` that interferes with the responsive table. This cannot be overridden without a Firefox-specific hack that we **don't** provide in Bootstrap: - -{% highlight css %} -@-moz-document url-prefix() { - fieldset { display: table-cell; } -} -{% endhighlight %} - -For more information, read [this Stack Overflow answer](https://stackoverflow.com/questions/17408815/fieldset-resizes-wrong-appears-to-have-unremovable-min-width-min-content/17863685#17863685). -{% endcallout %} - <div class="bd-example"> - <div class="table-responsive"> - <table class="table"> - <thead> - <tr> - <th>#</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row">1</th> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - </tr> - <tr> - <th scope="row">2</th> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - </tr> - <tr> - <th scope="row">3</th> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - </tr> - </tbody> - </table> - </div> - - <div class="table-responsive"> - <table class="table table-bordered"> - <thead> - <tr> - <th>#</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - <th>Table heading</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row">1</th> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - </tr> - <tr> - <th scope="row">2</th> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - </tr> - <tr> - <th scope="row">3</th> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - <td>Table cell</td> - </tr> - </tbody> - </table> - </div> -</div> + <table class="table table-responsive"> + <thead> + <tr> + <th>#</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + </tr> + </thead> + <tbody> + <tr> + <th scope="row">1</th> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + </tr> + <tr> + <th scope="row">2</th> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + </tr> + <tr> + <th scope="row">3</th> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + </tr> + </tbody> + </table> -{% highlight html %} -<div class="table-responsive"> - <table class="table"> - ... + <table class="table table-bordered table-responsive"> + <thead> + <tr> + <th>#</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + <th>Table heading</th> + </tr> + </thead> + <tbody> + <tr> + <th scope="row">1</th> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + </tr> + <tr> + <th scope="row">2</th> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + </tr> + <tr> + <th scope="row">3</th> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + <td>Table cell</td> + </tr> + </tbody> </table> </div> + +{% highlight html %} +<table class="table table-responsive""> + ... +</table> {% endhighlight %} diff --git a/docs/content/typography.md b/docs/content/typography.md index 139a7e00e..073734768 100644 --- a/docs/content/typography.md +++ b/docs/content/typography.md @@ -1,10 +1,11 @@ --- layout: docs title: Typography +description: Documentation and examples for Bootstrap typography, including global settings, body text, lists, and more. group: content --- -Bootstrap includes simple and easily customized typography for headings, body text, lists, and more. For even more control, check out the [textual utility classes]({{ site.baseurl }}/components/utilities/). +Bootstrap includes simple and easily customized typography for headings, body text, lists, and more. For even more control, check out the [textual utility classes]({{ site.baseurl }}/utilities/typography). ## Contents @@ -15,7 +16,7 @@ Bootstrap includes simple and easily customized typography for headings, body te Bootstrap sets basic global display, typography, and link styles. Specifically, we: -- Use a [native font stack](/content/reboot/#native-font-stack) that selects the best `font-family` for each OS and device. +- Use a [native font stack]({{ site.baseurl }}/content/reboot/#native-font-stack) that selects the best `font-family` for each OS and device. - Use the `$font-family-base`, `$font-size-base`, and `$line-height-base` attributes as our typographic base applied to the `<body>`. - Set the global link color via `$link-color` and apply link underlines only on `:hover`. - Use `$body-bg` to set a `background-color` on the `<body>` (`#fff` by default). @@ -31,27 +32,27 @@ All HTML headings, `<h1>` through `<h6>`, are available. <tbody> <tr> <td><h1>h1. Bootstrap heading</h1></td> - <td class="type-info">Semibold 36px</td> + <td class="type-info">Semibold 2.5rem (40px)</td> </tr> <tr> <td><h2>h2. Bootstrap heading</h2></td> - <td class="type-info">Semibold 30px</td> + <td class="type-info">Semibold 2rem (32px)</td> </tr> <tr> <td><h3>h3. Bootstrap heading</h3></td> - <td class="type-info">Semibold 24px</td> + <td class="type-info">Semibold 1.75rem (28px)</td> </tr> <tr> <td><h4>h4. Bootstrap heading</h4></td> - <td class="type-info">Semibold 18px</td> + <td class="type-info">Semibold 1.5rem (24px)</td> </tr> <tr> <td><h5>h5. Bootstrap heading</h5></td> - <td class="type-info">Semibold 14px</td> + <td class="type-info">Semibold 1.25rem (20px)</td> </tr> <tr> <td><h6>h6. Bootstrap heading</h6></td> - <td class="type-info">Semibold 12px</td> + <td class="type-info">Semibold 1rem (16px)</td> </tr> </tbody> </table> @@ -149,11 +150,11 @@ While not shown above, feel free to use `<b>` and `<i>` in HTML5. `<b>` is meant ## Text utilities -Change text alignment, transform, style, weight, and color with our [text utilities]({{ site.baseurl }}/components/utilities/#text-alignment). +Change text alignment, transform, style, weight, and color with our [text utilities]({{ site.baseurl }}/utilities/typography/#text-alignment). ## Abbreviations -Stylized implementation of HTML's `<abbr>` element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a `title` attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover and to users of assistive technologies. +Stylized implementation of HTML's `<abbr>` element for abbreviations and acronyms to show the expanded version on hover. Abbreviations have a default underline from Normalize.css and gain a help cursor to provide additional context on hover and to users of assistive technologies. Add `.initialism` to an abbreviation for a slightly smaller font-size. @@ -168,7 +169,7 @@ For quoting blocks of content from another source within your document. Wrap `<b {% example html %} <blockquote class="blockquote"> - <p class="m-b-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> + <p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> </blockquote> {% endexample %} @@ -178,7 +179,7 @@ Add a `<footer class="blockquote-footer">` for identifying the source. Wrap the {% example html %} <blockquote class="blockquote"> - <p class="m-b-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> + <p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer> </blockquote> {% endexample %} @@ -189,7 +190,7 @@ Add `.blockquote-reverse` for a blockquote with right-aligned content. {% example html %} <blockquote class="blockquote blockquote-reverse"> - <p class="m-b-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> + <p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer> </blockquote> {% endexample %} |
