mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2025-03-11 15:25:46 +03:00
bs docs sync
This commit is contained in:
parent
09be69024e
commit
601d8a96b1
|
@ -3,7 +3,7 @@ module Jekyll
|
||||||
def bugify(input)
|
def bugify(input)
|
||||||
upstream_map = {
|
upstream_map = {
|
||||||
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
|
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
|
||||||
"IE" => ["https://connect.microsoft.com/IE/feedback/details/", "IE bug"],
|
"Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"],
|
||||||
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
|
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
|
||||||
"Chromium" => ["https://bugs.chromium.org/p/chromium/issues/detail?id=", "Chromium issue"],
|
"Chromium" => ["https://bugs.chromium.org/p/chromium/issues/detail?id=", "Chromium issue"],
|
||||||
"WebKit" => ["https://bugs.webkit.org/show_bug.cgi?id=", "WebKit bug"],
|
"WebKit" => ["https://bugs.webkit.org/show_bug.cgi?id=", "WebKit bug"],
|
||||||
|
|
|
@ -301,12 +301,6 @@
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
.bd-example > {
|
.bd-example > {
|
||||||
.center-block:not(img) {
|
|
||||||
max-width: 200px;
|
|
||||||
padding: .5rem;
|
|
||||||
background-color: #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-primary,
|
.bg-primary,
|
||||||
.bg-success,
|
.bg-success,
|
||||||
.bg-info,
|
.bg-info,
|
||||||
|
|
|
@ -98,7 +98,7 @@ Extend the default collapse behavior to create an accordion.
|
||||||
|
|
||||||
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.
|
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.
|
Additionally, if your control element is targeting 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
|
## Usage
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ Provide pagination links for your site or app with the multi-page pagination com
|
||||||
Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.
|
Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav>
|
<nav aria-label="Page navigation">
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="#" aria-label="Previous">
|
<a class="page-link" href="#" aria-label="Previous">
|
||||||
|
@ -51,6 +51,12 @@ Simple pagination inspired by Rdio, great for apps and search results. The large
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
{% callout info %}
|
||||||
|
### Labelling the pagination component
|
||||||
|
|
||||||
|
The pagination component should be wrapped in a `<nav>` element to identify it as a navigation section to screen readers and other assistive technologies. In addition, as a page is likely to have more than one such navigation section already (such as the primary navigation in the header, or a sidebar navigation), it is advisable to provide a descriptive `aria-label` for the `<nav>` which reflects its purpose. For example, if the pagination component is used to navigate between a set of search results, an appropriate label could be `aria-label="Search results pages"`.
|
||||||
|
{% endcallout %}
|
||||||
|
|
||||||
## Disabled and active states
|
## Disabled and active states
|
||||||
|
|
||||||
Links are customizable for different circumstances. Use `.disabled` for unclickable links and `.active` to indicate the current page.
|
Links are customizable for different circumstances. Use `.disabled` for unclickable links and `.active` to indicate the current page.
|
||||||
|
@ -62,7 +68,7 @@ The `.disabled` class uses `pointer-events: none` to try to disable the link fun
|
||||||
{% endcallout %}
|
{% endcallout %}
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav>
|
<nav aria-label="...">
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<a class="page-link" href="#" tabindex="-1" aria-label="Previous">
|
<a class="page-link" href="#" tabindex="-1" aria-label="Previous">
|
||||||
|
@ -90,7 +96,7 @@ The `.disabled` class uses `pointer-events: none` to try to disable the link fun
|
||||||
You can optionally swap out active or disabled anchors for `<span>`, or omit the anchor in the case of the prev/next arrows, to remove click functionality and prevent keyboard focus while retaining intended styles.
|
You can optionally swap out active or disabled anchors for `<span>`, or omit the anchor in the case of the prev/next arrows, to remove click functionality and prevent keyboard focus while retaining intended styles.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav>
|
<nav aria-label="...">
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<span class="page-link" aria-label="Previous">
|
<span class="page-link" aria-label="Previous">
|
||||||
|
@ -109,7 +115,7 @@ You can optionally swap out active or disabled anchors for `<span>`, or omit the
|
||||||
Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for additional sizes.
|
Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for additional sizes.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav>
|
<nav aria-label="...">
|
||||||
<ul class="pagination pagination-lg">
|
<ul class="pagination pagination-lg">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="#" aria-label="Previous">
|
<a class="page-link" href="#" aria-label="Previous">
|
||||||
|
@ -131,7 +137,7 @@ Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav>
|
<nav aria-label="...">
|
||||||
<ul class="pagination pagination-sm">
|
<ul class="pagination pagination-sm">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="#" aria-label="Previous">
|
<a class="page-link" href="#" aria-label="Previous">
|
||||||
|
|
|
@ -277,7 +277,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
||||||
<td>An array of constraints - passed through to Tether. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#constraints">constraint docs</a>.</td>
|
<td>An array of constraints - passed through to Tether. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#constraints">constraint docs</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>offsets</td>
|
<td>offset</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>'0 0'</td>
|
<td>'0 0'</td>
|
||||||
<td>Offset of the popover relative to its target. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#offset">offset docs</a>.</td>
|
<td>Offset of the popover relative to its target. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#offset">offset docs</a>.</td>
|
||||||
|
|
|
@ -241,7 +241,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
||||||
<td>An array of constraints - passed through to Tether. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#constraints">constraint docs</a>.</td>
|
<td>An array of constraints - passed through to Tether. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#constraints">constraint docs</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>offsets</td>
|
<td>offset</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>'0 0'</td>
|
<td>'0 0'</td>
|
||||||
<td>Offset of the popover relative to its target. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#constraints">offset docs</a>.</td>
|
<td>Offset of the popover relative to its target. For more information refer to Tether's <a href="http://github.hubspot.com/tether/#constraints">offset docs</a>.</td>
|
||||||
|
|
|
@ -177,6 +177,36 @@ Sometimes contextual classes cannot be applied due to the specificity of another
|
||||||
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
||||||
{{ callout-include | markdownify }}
|
{{ callout-include | markdownify }}
|
||||||
|
|
||||||
|
## Widths
|
||||||
|
|
||||||
|
Easily make an element as wide as its parent using the `.w-100` utility class, which sets `width: 100%`.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<img class="w-100" data-src="holder.js/200px100?outline=yes&text=Width%20%3D%20100%25" alt="Width = 100%">
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## CSS `display` (`block`, `inline`, `inline-block`)
|
||||||
|
|
||||||
|
Use `.d-block`, `.d-inline`, or `.d-inline-block` to simply set an element's [`display` property](https://developer.mozilla.org/en-US/docs/Web/CSS/display) to `block`, `inline`, or `inline-block` (respectively).
|
||||||
|
|
||||||
|
To make an element `display: none`, use our [responsive utilities](../layout/responsive-utilities/) instead.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="d-inline bg-success">Inline</div>
|
||||||
|
<div class="d-inline bg-success">Inline</div>
|
||||||
|
|
||||||
|
<span class="d-block bg-primary">Block</span>
|
||||||
|
|
||||||
|
<div class="d-inline-block bg-warning">
|
||||||
|
<h3>inline-block</h3>
|
||||||
|
Boot that strap!
|
||||||
|
</div>
|
||||||
|
<div class="d-inline-block bg-warning">
|
||||||
|
<h3>inline-block</h3>
|
||||||
|
Strap that boot!
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
## Close icon
|
## Close icon
|
||||||
|
|
||||||
Use a generic close icon for dismissing content like modals and alerts. **Be sure to include text for screen readers**, as we've done with `aria-label`.
|
Use a generic close icon for dismissing content like modals and alerts. **Be sure to include text for screen readers**, as we've done with `aria-label`.
|
||||||
|
|
|
@ -59,7 +59,7 @@ Add classes to an `<img>` element to easily style images in any project.
|
||||||
|
|
||||||
## Aligning images
|
## 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">
|
<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-left" alt="A generic square placeholder image with rounded corners">
|
||||||
|
@ -72,11 +72,11 @@ Align images with the [helper float classes]({{ site.baseurl }}/components/utili
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<div class="bd-example bd-example-images">
|
<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>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<img src="..." class="img-rounded center-block" alt="...">
|
<img src="..." class="img-rounded m-x-auto d-block" alt="...">
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<div class="bd-example bd-example-images">
|
<div class="bd-example bd-example-images">
|
||||||
|
|
|
@ -346,12 +346,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.
|
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.
|
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.
|
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).
|
For further details, see the compatibility table for [suppressing 300ms delay for touchscreen interactions](http://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay).
|
||||||
|
|
|
@ -223,7 +223,7 @@ Remove the default `list-style` and left margin on list items (immediate childre
|
||||||
|
|
||||||
### Inline
|
### 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 %}
|
{% example html %}
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user