aboutsummaryrefslogtreecommitdiff
path: root/docs/content
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2015-04-16 18:54:17 -0700
committerMark Otto <[email protected]>2015-04-16 18:54:17 -0700
commit0ab1576ae227663d9e97040a486e1ca2818bab1e (patch)
treed852285be3a39c9cc73d17bea3602a0b62c0faad /docs/content
parent605990400eb470e50bcdfd3643b8cc10f2684836 (diff)
parent06c2862d257935871fc846670148c8767e2f6a82 (diff)
downloadbootstrap-0ab1576ae227663d9e97040a486e1ca2818bab1e.tar.xz
bootstrap-0ab1576ae227663d9e97040a486e1ca2818bab1e.zip
Merge branch 'v4' of https://github.com/twbs/derpstrap into v4
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/buttons.md54
-rw-r--r--docs/content/forms.md97
-rw-r--r--docs/content/images.md19
-rw-r--r--docs/content/tables.md26
-rw-r--r--docs/content/typography.md9
5 files changed, 105 insertions, 100 deletions
diff --git a/docs/content/buttons.md b/docs/content/buttons.md
index e559c4635..cf9d8dab6 100644
--- a/docs/content/buttons.md
+++ b/docs/content/buttons.md
@@ -29,10 +29,11 @@ Bootstrap includes six predefined button styles, each serving its own semantic p
<button type="button" class="btn btn-link">Link</button>
{% endexample %}
-<div class="bs-callout bs-callout-warning">
- <h4>Conveying meaning to assistive technologies</h4>
- <p>Using color to add meaning to a button 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 visible text of the button), or is included through alternative means, such as additional text hidden with the <code>.sr-only</code> class.</p>
-</div>
+{% callout warning %}
+#### Conveying meaning to assistive technologies
+
+Using color to add meaning to a button 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 visible text of the button), or is included through alternative means, such as additional text hidden with the `.sr-only` class.
+{% endcallout %}
## Button tags
@@ -45,15 +46,17 @@ Use the button classes on an `<a>`, `<button>`, or `<input>` element.
<input class="btn btn-secondary" type="submit" value="Submit">
{% endexample %}
-<div class="bs-callout bs-callout-warning">
- <h4>Links acting as buttons</h4>
- <p>If the <code>&lt;a&gt;</code> elements are used to act as buttons – triggering in-page functionality, rather than navigating to another document or section within the current page – they should also be given an appropriate <code>role="button"</code>.</p>
-</div>
+{% callout warning %}
+#### Links acting as buttons
+
+If the `<a>` elements are used to act as buttons – triggering in-page functionality, rather than navigating to another document or section within the current page – they should also be given an appropriate `role="button"`.
+{% endcallout %}
+
+{% callout warning %}
+#### Cross-browser rendering
-<div class="bs-callout bs-callout-warning">
- <h4>Cross-browser rendering</h4>
- <p>As a best practice, <strong>we highly recommend using the <code>&lt;button&gt;</code> element whenever possible</strong> to ensure matching cross-browser rendering.</p>
-</div>
+As a best practice, **we highly recommend using the `<button>` element whenever possible** to ensure matching cross-browser rendering.
+{% endcallout %}
## Sizes
@@ -106,17 +109,20 @@ As `<a>` elements don't support the `disabled` attribute, you must add the `.dis
<a href="#" class="btn btn-secondary btn-lg disabled" role="button">Link</a>
{% endexample %}
-<div class="bs-callout bs-callout-warning">
- <h4>Cross-browser compatibility</h4>
- <p>If you add the <code>disabled</code> attribute to a <code>&lt;button&gt;</code>, Internet Explorer 9 and below will render text gray with a nasty text-shadow that we cannot fix.</p>
-</div>
+{% callout warning %}
+#### Cross-browser compatibility
+
+If you add the `disabled` attribute to a `<button>`, Internet Explorer 9 and below will render text gray with a nasty text-shadow that we cannot fix.
+{% endcallout %}
+
+{% callout warning %}
+#### Link functionality caveat
+
+This class uses `pointer-events: none` to try to disable the link functionality of `<a>`s, but that CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11\. In addition, even in browsers that do support `pointer-events: none`, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, use custom JavaScript to disable such links.
+{% endcallout %}
-<div class="bs-callout bs-callout-warning">
- <h4>Link functionality caveat</h4>
- <p>This class uses <code>pointer-events: none</code> to try to disable the link functionality of <code>&lt;a&gt;</code>s, but that CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11. In addition, even in browsers that do support <code>pointer-events: none</code>, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, use custom JavaScript to disable such links.</p>
-</div>
+{% callout warning %}
+#### Context-specific usage
-<div class="bs-callout bs-callout-warning">
- <h4>Context-specific usage</h4>
- <p>While button classes can be used on <code>&lt;a&gt;</code> and <code>&lt;button&gt;</code> elements, only <code>&lt;button&gt;</code> elements are supported within our nav and navbar components.</p>
-</div>
+While button classes can be used on `<a>` and `<button>` elements, only `<button>` elements are supported within our nav and navbar components.
+{% endcallout %}
diff --git a/docs/content/forms.md b/docs/content/forms.md
index ac056a8b9..24f9b1a5b 100644
--- a/docs/content/forms.md
+++ b/docs/content/forms.md
@@ -9,6 +9,8 @@ Bootstrap normalizes common HTML5 form elements and adds a number of layout opti
Individual form controls automatically receive some global styling. All textual `<input>`, `<textarea>`, and `<select>` elements with `.form-control` are set to `width: 100%;` by default. Wrap labels and controls in `.form-group` for optimum spacing.
+**Do not mix form groups directly with [input groups](/components/#input-groups).** Instead, nest the input group inside of the form group.
+
{% example html %}
<form>
<div class="form-group">
@@ -33,28 +35,16 @@ Individual form controls automatically receive some global styling. All textual
</form>
{% endexample %}
-<div class="bs-callout bs-callout-warning">
- <h4>Don't mix form groups with input groups</h4>
- <p>Do not mix form groups directly with <a href="/components/#input-groups">input groups</a>. Instead, nest the input group inside of the form group.</p>
-</div>
-
## Inline forms
-Add `.form-inline` to your `<form>` or a parent element for left-aligned and inline-block controls. **This only applies to form controls within viewports that are at least 768px wide.**
+Add `.form-inline` to your `<form>` or a parent element for left-aligned and inline-block controls. Inputs and selects are set to `width: auto;` in inline forms. Depending on your layout, additional custom widths may be required. As shown below, you should alwys include a `<label>` with each form control.
-<div class="bs-callout bs-callout-danger">
- <h4>May require custom widths</h4>
- <p>Inputs and selects have `width: 100%;` applied by default in Bootstrap. Within inline forms, we reset that to `width: auto;` so multiple controls can reside on the same line. Depending on your layout, additional custom widths may be required.</p>
-</div>
-<div class="bs-callout bs-callout-warning">
- <h4>Always add labels</h4>
- <p>Screen readers will have trouble with your forms if you don't include a label for every input. For these inline forms, you can hide the labels using the `.sr-only` class.</p>
-</div>
+**Inline forms only appear inline in viewports that are at least 768px wide.**
### Visible labels
{% example html %}
-<div class="bs-example" data-example-id="simple-form-inline">
+<div class="bd-example" data-example-id="simple-form-inline">
<form class="form-inline">
<div class="form-group">
<label for="exampleInputName2">Name</label>
@@ -145,22 +135,29 @@ Examples of standard form controls supported in an example form layout.
### Inputs
-Most common form control, text-based input fields. Includes support for all HTML5 types: `text`, `password`, `datetime`, `datetime-local`, `date`, `month`, `time`, `week`, `number`, `email`, `url`, `search`, `tel`, and `color`.
-
-<div class="bs-callout bs-callout-danger">
- <h4>Type declaration required</h4>
- <p>Inputs will only be fully styled if their `type` is properly declared.</p>
-</div>
+The most common form control, text-based input fields. Includes support for all HTML5 types:
+
+- `text`
+- `password`
+- `datetime`
+- `datetime-local`
+- `date`
+- `month`
+- `time`
+- `week`
+- `number`
+- `email`
+- `url`
+- `search`
+- `tel`
+- `color`
+
+Since Bootstrap requires the HTML5 doctype, **all inputs must have a `type` attribute.**
{% example html %}
<input type="text" class="form-control" placeholder="Text input">
{% endexample %}
-<div class="bs-callout bs-callout-info">
- <h4>Input groups</h4>
- <p>To add integrated text or buttons before and/or after any text-based `&lt;input&gt;`, <a href="../components/#input-groups">check out the input group component</a>.</p>
-</div>
-
### Textarea
Form control which supports multiple lines of text. Change `rows` attribute as necessary.
@@ -321,19 +318,14 @@ When you need to place plain text next to a form label within a form, use the `.
## Focus state
-We remove the default `outline` styles on some form controls and apply a `box-shadow` in its place for `:focus`.
+We remove the default `outline` styles on some form controls and apply a `box-shadow` in its place for `:focus`. Shown below is a custom input that only **demonstrates** the `:focus` state on an `<input>` with `.form-control`.
-<div class="bs-example">
+<div class="bd-example">
<form>
<input class="form-control" id="focusedInput" type="text" value="Demonstrative focus state">
</form>
</div>
-<div class="bs-callout bs-callout-info">
- <h4>Demo `:focus` state</h4>
- <p>The above example input uses custom styles in our documentation to demonstrate the `:focus` state on a `.form-control`.</p>
-</div>
-
## Disabled states
Add the `disabled` boolean attribute on an input to prevent user interactions. Disabled inputs appear lighter and add a `not-allowed` cursor.
@@ -367,15 +359,17 @@ Add the `disabled` attribute to a `<fieldset>` to disable all the controls withi
</form>
{% endexample %}
-<div class="bs-callout bs-callout-warning">
- <h4>Caveat about link functionality of `&lt;a&gt;`</h4>
- <p>By default, browsers will treat all native form controls (<code>&lt;input&gt;</code>, <code>&lt;select&gt;</code> and <code>&lt;button&gt;</code> elements) inside a <code>&lt;fieldset disabled&gt;</code> as disabled, preventing both keyboard and mouse interactions on them. However, if your form also includes <code>&lt;a ... class="btn btn-*"&gt;</code> elements, these will only be given a style of <code>pointer-events: none</code>. As noted in the section about <a href="#buttons-disabled">disabled state for buttons</a> (and specifically in the sub-section for anchor elements), this CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11, and won't prevent keyboard users from being able to focus or activate these links. So to be safe, use custom JavaScript to disable such links.</p>
-</div>
+{% callout warning %}
+#### Caveat about link functionality of `<a>`
-<div class="bs-callout bs-callout-danger">
- <h4>Cross-browser compatibility</h4>
- <p>While Bootstrap will apply these styles in all browsers, Internet Explorer 11 and below don't fully support the <code>disabled</code> attribute on a <code>&lt;fieldset&gt;</code>. Use custom JavaScript to disable the fieldset in these browsers.</p>
-</div>
+By default, browsers will treat all native form controls (`<input>`, `<select>` and `<button>` elements) inside a `<fieldset disabled>` as disabled, preventing both keyboard and mouse interactions on them. However, if your form also includes `<a ... class="btn btn-*">` elements, these will only be given a style of `pointer-events: none`. As noted in the section about [disabled state for buttons](#buttons-disabled) (and specifically in the sub-section for anchor elements), this CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11, and won't prevent keyboard users from being able to focus or activate these links. So to be safe, use custom JavaScript to disable such links.
+{% endcallout %}
+
+{% callout danger %}
+#### Cross-browser compatibility
+
+While Bootstrap will apply these styles in all browsers, Internet Explorer 11 and below don't fully support the `disabled` attribute on a `<fieldset>`. Use custom JavaScript to disable the fieldset in these browsers.
+{% endcallout %}
## Readonly inputs
@@ -389,11 +383,13 @@ Add the `readonly` boolean attribute on an input to prevent modification of the
Bootstrap includes validation styles for error, warning, and success states on form controls. To use, add `.has-warning`, `.has-error`, or `.has-success` to the parent element. Any `.control-label`, `.form-control`, and `.help-block` within that element will receive the validation styles.
-<div class="bs-callout bs-callout-warning" id="callout-form-validation-state-accessibility">
- <h4>Conveying validation state to assistive technologies and colorblind users</h4>
- <p>Using these validation styles to denote the state of a form control only provides a visual, color-based indication, which will not be conveyed to users of assistive technologies - such as screen readers - or to colorblind users.</p>
- <p>Ensure that an alternative indication of state is also provided. For instance, you can include a hint about state in the form control's <code>&lt;label&gt;</code> text itself (as is the case in the following code example), include a <a href="../components/#glyphicons">Glyphicon</a> (with appropriate alternative text using the <code>.sr-only</code> class - see the <a href="../components/#glyphicons-examples">Glyphicon examples</a>), or by providing an additional <a href="#forms-help-text">help text</a> block. Specifically for assistive technologies, invalid form controls can also be assigned an <code>aria-invalid="true"</code> attribute.</p>
-</div>
+{% callout warning %}
+#### Conveying validation state to assistive technologies and colorblind users
+
+Using these validation styles to denote the state of a form control only provides a visual, color-based indication, which will not be conveyed to users of assistive technologies - such as screen readers - or to colorblind users.
+
+Ensure that an alternative indication of state is also provided. For instance, you can include a hint about state in the form control's `<label>` text itself (as is the case in the following code example), include a [Glyphicon](../components/#glyphicons) (with appropriate alternative text using the `.sr-only` class - see the [Glyphicon examples](../components/#glyphicons-examples)), or by providing an additional [help text](#forms-help-text) block. Specifically for assistive technologies, invalid form controls can also be assigned an `aria-invalid="true"` attribute.
+{% endcallout %}
{% example html %}
<div class="form-group has-success">
@@ -436,10 +432,11 @@ Bootstrap includes validation styles for error, warning, and success states on f
You can also add optional feedback icons with the addition of `.has-feedback` and the right icon.
-<div class="bs-callout bs-callout-warning">
- <h4>Icons, labels, and input groups</h4>
- <p>Manual positioning of feedback icons is required for inputs without a label and for <a href="../components#input-groups">input groups</a> with an add-on on the right. You are strongly encouraged to provide labels for all inputs for accessibility reasons. If you wish to prevent labels from being displayed, hide them with the `sr-only` class. If you must do without labels, adjust the `top` value of the feedback icon. For input groups, adjust the `right` value to an appropriate pixel value depending on the width of your addon.</p>
-</div>
+{% callout warning %}
+#### Icons, labels, and input groups
+
+Manual positioning of feedback icons is required for inputs without a label and for [input groups](../components#input-groups) with an add-on on the right. You are strongly encouraged to provide labels for all inputs for accessibility reasons. If you wish to prevent labels from being displayed, hide them with the `sr-only` class. If you must do without labels, adjust the `top` value of the feedback icon. For input groups, adjust the `right` value to an appropriate pixel value depending on the width of your addon.
+{% endcallout %}
{% example html %}
<div class="form-group has-success has-feedback">
diff --git a/docs/content/images.md b/docs/content/images.md
index e00be8098..e7b29d45a 100644
--- a/docs/content/images.md
+++ b/docs/content/images.md
@@ -9,7 +9,7 @@ Opt your images into responsive behavior (so they never become larger than their
Images in Bootstrap are responsive by default. `max-width: 100%;` and `height: auto;` are applied to the image so that it scales with the parent element.
-<div class="bs-example">
+<div class="bd-example">
<img data-src="holder.js/100%x250" class="img-responsive" alt="Generic responsive image">
</div>
@@ -17,16 +17,17 @@ Images in Bootstrap are responsive by default. `max-width: 100%;` and `height: a
<img src="..." class="img-responsive" alt="Responsive image">
{% endhighlight %}
-<div class="bs-callout bs-callout-warning">
- <h4>SVG images and IE 9-10</h4>
- <p>In Internet Explorer 9-10, SVG images with <code>.img-responsive</code> are disproportionately sized. To fix this, add <code>width: 100% \9;</code> where necessary. Bootstrap doesn't apply this automatically as it causes complications to other image formats.</p>
-</div>
+{% callout warning %}
+#### SVG images and IE 9-10
+
+In Internet Explorer 9-10, SVG images with `.img-responsive` are disproportionately sized. To fix this, add `width: 100% \9;` where necessary. Bootstrap doesn't apply this automatically as it causes complications to other image formats.
+{% endcallout %}
## Image shapes
Add classes to an `<img>` element to easily style images in any project.
-<div class="bs-example bs-example-images">
+<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">
@@ -42,7 +43,7 @@ Add classes to an `<img>` element to easily style images in any project.
Align images with the [helper float classes](/components/helpers) or [text alignment classes](/components/helpers). A simple centering class can also be used for `block` level images.
-<div class="bs-example bs-example-images">
+<div class="bd-example bd-example-images">
<img data-src="holder.js/200x200" class="img-rounded pull-left" alt="A generic square placeholder image with rounded corners">
<img data-src="holder.js/200x200" class="img-rounded pull-right" alt="A generic square placeholder image with rounded corners">
</div>
@@ -52,7 +53,7 @@ Align images with the [helper float classes](/components/helpers) or [text align
<img src="..." class="img-rounded pull-right" alt="...">
{% endhighlight %}
-<div class="bs-example bs-example-images">
+<div class="bd-example bd-example-images">
<img data-src="holder.js/200x200" class="img-rounded center-block" style="display: block;" alt="A generic square placeholder image with rounded corners">
</div>
@@ -60,7 +61,7 @@ Align images with the [helper float classes](/components/helpers) or [text align
<img src="..." class="img-rounded center-block" style="display: block;" alt="...">
{% endhighlight %}
-<div class="bs-example bs-example-images">
+<div class="bd-example bd-example-images">
<div class="text-center">
<img data-src="holder.js/200x200" class="img-rounded" alt="A generic square placeholder image with rounded corners">
</div>
diff --git a/docs/content/tables.md b/docs/content/tables.md
index 5e9107127..d2f9acece 100644
--- a/docs/content/tables.md
+++ b/docs/content/tables.md
@@ -342,7 +342,7 @@ Use contextual classes to color table rows or individual cells.
</table>
</div>
-<div class="bs-example">
+<div class="bd-example">
<table class="table">
<thead>
<tr>
@@ -433,23 +433,27 @@ Use contextual classes to color table rows or individual cells.
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.
-<div class="bs-callout bs-callout-warning" id="callout-tables-responsive-overflow">
- <h4>Vertical clipping/truncation</h4>
- <p>Responsive tables make use of <code>overflow-y: hidden</code>, 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.</p>
-</div>
+{% callout warning %}
+#### Vertical clipping/truncation
+
+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 overriden without a Firefox-specific hack that we **don't** provide in Bootstrap:
-<div class="bs-callout bs-callout-warning">
- <h4>Firefox and fieldsets</h4>
- <p>Firefox has some awkward fieldset styling involving <code>width</code> that interferes with the responsive table. This cannot be overriden without a Firefox-specific hack that we <strong>don't</strong> provide in Bootstrap:</p>
{% highlight css %}
@-moz-document url-prefix() {
fieldset { display: table-cell; }
}
{% endhighlight %}
- <p>For more information, read <a href="http://stackoverflow.com/questions/17408815/fieldset-resizes-wrong-appears-to-have-unremovable-min-width-min-content/17863685#17863685">this Stack Overflow answer</a>.</p>
-</div>
-<div class="bs-example">
+For more information, read [this Stack Overflow answer](http://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>
diff --git a/docs/content/typography.md b/docs/content/typography.md
index df4f9a9f7..6f2db8153 100644
--- a/docs/content/typography.md
+++ b/docs/content/typography.md
@@ -20,7 +20,7 @@ These styles can be found within `scaffolding.less`.
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.
-<div class="bs-example bs-example-type">
+<div class="bd-example bd-example-type">
<table class="table">
<tbody>
<tr>
@@ -62,7 +62,7 @@ All HTML headings, `<h1>` through `<h6>`, are available. `.h1` through `.h6` cla
Create lighter, secondary text in any heading with a generic `<small>` tag or the `.small` class.
-<div class="bs-example bs-example-type">
+<div class="bd-example bd-example-type">
<table class="table">
<tbody>
<tr>
@@ -131,10 +131,7 @@ Styling for common inline HTML5 elements.
<p><em>This line rendered as italicized text.</em></p>
{% endexample %}
-<div class="bs-callout bs-callout-info">
- <h4>Alternate elements</h4>
- <p>Feel free to use <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> in HTML5. <code>&lt;b&gt;</code> is meant to highlight words or phrases without conveying additional importance while <code>&lt;i&gt;</code> is mostly for voice, technical terms, etc.</p>
-</div>
+While not shown above, feel free to use `<b>` and `<i>` in HTML5. `<b>` is meant to highlight words or phrases without conveying additional importance while `<i>` is mostly for voice, technical terms, etc.
## Alignment classes