diff options
| author | Mark Otto <[email protected]> | 2016-05-11 11:07:06 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-05-11 11:07:06 -0700 |
| commit | b280e36b788e4b42bbb359f0a13db410adf7dd8c (patch) | |
| tree | bc8115b9b11cb78767655917a482c25c9f711526 /docs/content | |
| parent | ef50b7839cb2ca9171eec12c2bf22fc38ad9d7ae (diff) | |
| parent | 9d6b41c1276af04d5e81043059035660add82b8d (diff) | |
| download | bootstrap-b280e36b788e4b42bbb359f0a13db410adf7dd8c.tar.xz bootstrap-b280e36b788e4b42bbb359f0a13db410adf7dd8c.zip | |
Merge branch 'v4-dev' into v4-split-buttons
Diffstat (limited to 'docs/content')
| -rw-r--r-- | docs/content/images.md | 6 | ||||
| -rw-r--r-- | docs/content/reboot.md | 20 | ||||
| -rw-r--r-- | docs/content/tables.md | 112 | ||||
| -rw-r--r-- | docs/content/typography.md | 17 |
4 files changed, 137 insertions, 18 deletions
diff --git a/docs/content/images.md b/docs/content/images.md index e3e616de2..f21010f0f 100644 --- a/docs/content/images.md +++ b/docs/content/images.md @@ -47,7 +47,7 @@ Add classes to an `<img>` element to easily style images in any project. ## 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). A simple centering class can also be used for `block` level 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). <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"> @@ -60,11 +60,11 @@ Align images with the [helper float classes]({{ site.baseurl }}/components/utili {% endhighlight %} <div class="bd-example bd-example-images"> - <img data-src="holder.js/200x200" class="img-rounded center-block" alt="A generic square placeholder image with rounded corners"> + <img data-src="holder.js/200x200" class="img-rounded m-x-auto d-block" alt="A generic square placeholder image with rounded corners"> </div> {% highlight html %} -<img src="..." class="img-rounded center-block" alt="..."> +<img src="..." class="img-rounded m-x-auto d-block" alt="..."> {% endhighlight %} <div class="bd-example bd-example-images"> diff --git a/docs/content/reboot.md b/docs/content/reboot.md index 2c65e6e21..20a76c82c 100644 --- a/docs/content/reboot.md +++ b/docs/content/reboot.md @@ -34,20 +34,24 @@ The `<html>` and `<body>` elements are updated to provide better page-wide defau ## Native font stack -The default web (Helvetica Neue, Helvetica, and Arial) fonts have been dropped in Bootstrap 4 and replaced with a "native font stack" for optimum text rendering on every device and OS. Read more about [native font stacks in this Smashing Magazine article](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/). +The default web fonts (Helvetica Neue, Helvetica, and Arial) have been dropped in Bootstrap 4 and replaced with a "native font stack" for optimum text rendering on every device and OS. Read more about [native font stacks in this *Smashing Magazine* article](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/). {% highlight sass %} $font-family-sans-serif: // Safari for OS X and iOS (San Francisco) -apple-system, - // Chrome for OS X (San Francisco) and Windows (Segoe UI) + // Chrome for OS X (San Francisco) BlinkMacSystemFont, // Windows "Segoe UI", // Android "Roboto", - // Linux distros - "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", + // Linux + "Oxygen", // KDE + "Ubuntu", + "Cantarell", // GNOME + // Firefox OS [R.I.P.] + "Fira Sans", // Older Android "Droid Sans", // Basic web fallback @@ -144,7 +148,7 @@ The `<pre>` element is reset to remove its `margin-top` and use `rem` units for ## Tables -Tables are slightly adjusted to style `<caption>`s and ensure consistent `text-align` throughout. Additional changes for borders, padding, and more come with [the `.table` class]({{ site.baseurl }}/content/tables/). +Tables are slightly adjusted to style `<caption>`s, collapse borders, and ensure consistent `text-align` throughout. Additional changes for borders, padding, and more come with [the `.table` class]({{ site.baseurl }}/content/tables/). <div class="bd-example"> <table> @@ -189,7 +193,7 @@ Various form elements have been rebooted for simpler base styles. Here are some - `<fieldset>`s have no borders, padding, or margin so they can be easily used as wrappers for individual inputs or groups of inputs. - `<legend>`s, like fieldsets, have also been restyled to be displayed as a heading of sorts. - `<label>`s are set to `display: inline-block` to allow `margin` to be applied. -- `<input>`s, `<selects>`s, `<textareas>`s, and `<buttons>`s are mostly addressed by Normalize, but Reboot removes their `margin` and sets `line-height: inherit`, too. +- `<input>`s, `<select>`s, `<textarea>`s, and `<button>`s are mostly addressed by Normalize, but Reboot removes their `margin` and sets `line-height: inherit`, too. - `<textarea>`s are modified to only be resizable vertically as horizontal resizing often "breaks" page layout. These changes, and more, are demonstrated below. @@ -330,12 +334,12 @@ To merely toggle the visibility of an element, meaning its `display` is not modi Traditionally, browsers on touchscreen devices have a delay of approximately 300ms between the end of a "tap" – the moment when a finger/stylus is lifted from screen – and the [`click` event](https://developer.mozilla.org/en-US/docs/Web/Events/click) being fired. This delay is necessary for these browsers to correctly handle "double-tap to zoom" gestures without prematurely triggering actions or links after the first "tap", but it can make your site feel slightly sluggish and unresponsive. -Most mobile browsers automatically optimize away this 300ms delay for sites that use the `width=device-width` property as part of their [responsive meta tag]({{ site.baseurl }}/getting-started/introduction/#responsive-meta-tag) (as well as for sites that disable zooming, for instance with `user-scalable=no`, though this practice is strongly discouraged for accessibility and usability reasons). The biggest exceptions here are currently iOS Safari (and any other iOS WebView-based browser) – though this is likely to change in iOS 10, see [WebKit bug #150604](https://bugs.webkit.org/show_bug.cgi?id=150604) – and IE11 on Windows Phone 8.1. +Most mobile browsers automatically optimize away this 300ms delay for sites that use the `width=device-width` property as part of their [responsive meta tag]({{ site.baseurl }}/getting-started/introduction/#responsive-meta-tag) (as well as for sites that disable zooming, for instance with `user-scalable=no`, though this practice is strongly discouraged for accessibility and usability reasons). The biggest exceptions here are IE11 on Windows Phone 8.1, and iOS Safari (and any other iOS WebView-based browser) [prior to iOS 9.3](https://webkit.org/blog/5610/more-responsive-tapping-on-ios/). On touch-enabled laptop/desktop devices, IE11 and Microsoft Edge are currently the only browsers with "double-tap to zoom" functionality. As the [responsive meta tag]({{ site.baseurl }}/getting-started/introduction/#responsive-meta-tag) is ignored by all desktop browsers, using `width=device-width` will have no effect on the 300ms delay here. To address this problem in IE11 and Microsoft Edge on desktop, as well as IE11 on Windows Phone 8.1, Bootstrap explicitly uses the [`touch-action:manipulation` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) on all interactive elements (such as buttons and links). This property essentially disables double-tap functionality on those elements, eliminating the 300ms delay. -In the case of iOS, the currently suggested approach is to use additional scripts such as [FastClick](https://github.com/ftlabs/fastclick) to explicitly work around the delay. +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). diff --git a/docs/content/tables.md b/docs/content/tables.md index 80bbbf854..fc6a6b19b 100644 --- a/docs/content/tables.md +++ b/docs/content/tables.md @@ -4,14 +4,16 @@ title: Tables group: content --- -Due to the widespread use of tables across third-party widgets like calendars and date pickers, we've designed our tables to be **opt-in**. Just add the base class `.table` to any `<table>`. +Due to the widespread use of tables across third-party widgets like calendars and date pickers, we've designed our tables to be **opt-in**. Just add the base class `.table` to any `<table>`, then extend with custom styles or our various included modifier classes. ## Contents * Will be replaced with the ToC, excluding the "Contents" header {:toc} -## Basic example +## Examples + +Using the most basic table markup, here's how `.table`-based tables look in Bootstrap. {% example html %} <table class="table"> @@ -46,7 +48,7 @@ Due to the widespread use of tables across third-party widgets like calendars an </table> {% endexample %} -## Inverse table +You can also invert the colors—with light text on dark backgrounds—with `.table-inverse`. {% example html %} <table class="table table-inverse"> @@ -83,7 +85,7 @@ Due to the widespread use of tables across third-party widgets like calendars an ## Table head options -Use one of two modifier classes to make `<thead>`s appear light or dark gray. +Similar to default and inverse tables, use one of two modifier classes to make `<thead>`s appear light or dark gray. {% example html %} <table class="table"> @@ -438,6 +440,98 @@ 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. + +<div class="bd-example"> + <table class="table table-inverse"> + <thead> + <tr> + <th>#</th> + <th>Column heading</th> + <th>Column heading</th> + <th>Column heading</th> + </tr> + </thead> + <tbody> + <tr class="bg-primary"> + <th scope="row">1</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr> + <th scope="row">2</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr class="bg-success"> + <th scope="row">3</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr> + <th scope="row">4</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr class="bg-info"> + <th scope="row">5</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr> + <th scope="row">6</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr class="bg-warning"> + <th scope="row">7</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr> + <th scope="row">8</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + <tr class="bg-danger"> + <th scope="row">9</th> + <td>Column content</td> + <td>Column content</td> + <td>Column content</td> + </tr> + </tbody> + </table> +</div> + +{% highlight html %} +<!-- On rows --> +<tr class="bg-primary">...</tr> +<tr class="bg-success">...</tr> +<tr class="bg-warning">...</tr> +<tr class="bg-danger">...</tr> +<tr class="bg-info">...</tr> + +<!-- On cells (`td` or `th`) --> +<tr> + <td class="bg-primary">...</td> + <td class="bg-success">...</td> + <td class="bg-warning">...</td> + <td class="bg-danger">...</td> + <td class="bg-info">...</td> +</tr> +{% endhighlight %} + +{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %} +{{ callout-include | markdownify }} + ## 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. @@ -564,6 +658,16 @@ For more information, read [this Stack Overflow answer](https://stackoverflow.co ### Reflow +Turn traditional tables on their side by using `table-reflow`. When using reflow, the table header becomes the first column of the table, the first row within the table body becomes the second column, the second row becomes the third column, etc. + +{% callout warning %} +#### Content order and complex tables + +Beware that the `table-reflow` style changes the visual order of content. Make sure that you only apply this style to well-formed and simple data tables (and in particular, don't use this for layout tables) with appropriate `<th>` table header cells for each row and column. + +In addition, this class will not work correctly for tables with cells that span multiple rows or columns (using `rowspan` or `colspan` attributes). + +{% endcallout %} {% example html %} <table class="table table-reflow"> diff --git a/docs/content/typography.md b/docs/content/typography.md index 0c6d53aa2..139a7e00e 100644 --- a/docs/content/typography.md +++ b/docs/content/typography.md @@ -24,7 +24,7 @@ These styles can be found within `_reboot.scss`, and the global variables are de ## Headings -All HTML headings, `<h1>` through `<h6>`, are available. `.h1` through `.h6` classes are also available, for when you want to match the font styling of a heading but still want your text to be displayed inline. +All HTML headings, `<h1>` through `<h6>`, are available. <div class="bd-example bd-example-type"> <table class="table"> @@ -66,6 +66,17 @@ All HTML headings, `<h1>` through `<h6>`, are available. `.h1` through `.h6` cla <h6>h6. Bootstrap heading</h6> {% endhighlight %} +`.h1` through `.h6` classes are also available, for when you want to match the font styling of a heading but cannot use the associated HTML element. + +{% example html %} +<p class="h1">h1. Bootstrap heading</p> +<p class="h2">h2. Bootstrap heading</p> +<p class="h3">h3. Bootstrap heading</p> +<p class="h4">h4. Bootstrap heading</p> +<p class="h5">h5. Bootstrap heading</p> +<p class="h6">h6. Bootstrap heading</p> +{% endexample %} + ### Customizing headings Use the included utility classes to recreate the small secondary heading text from Bootstrap 3. @@ -138,7 +149,7 @@ 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](http://localhost:9001/components/utilities/#text-alignment). +Change text alignment, transform, style, weight, and color with our [text utilities]({{ site.baseurl }}/components/utilities/#text-alignment). ## Abbreviations @@ -211,7 +222,7 @@ Remove the default `list-style` and left margin on list items (immediate childre ### Inline -Place all list items on a single line with `display: inline-block;` and some basic margin between. +Remove a list's bullets and apply some light `margin` with a combination of two classes, `.list-inline` and `.list-inline-item`. {% example html %} <ul class="list-inline"> |
