0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-29 21:52:22 +01:00

Documentation cleanup (inc. use of <input ... readonly> for static form controls example)

* Fix incorrect code indentation
* Remove unnecessary vendor prefix for `box-sizing` - all modern browsers now support this unprefixed
* Remove incorrect `<label>` and change static controls to readonly inputs
* Allow `<img>` elements without `src` to allow for `holder.js` images used in the docs, which lack `src` and use `data-src` instead
This commit is contained in:
Patrick H. Lauke 2017-04-27 23:57:10 +01:00 committed by GitHub
parent ebf0c3104e
commit f7f644a4e5
13 changed files with 189 additions and 192 deletions

View File

@ -9,6 +9,7 @@
"html-valid-content-model": false,
"id-class-ignore-regex": "(onclick|content|[a-z]+([A-Z][a-z])+)",
"id-class-style": "dash",
"img-req-src": false,
"img-req-alt": false,
"indent-style": "spaces",
"indent-width": 2,

View File

@ -225,9 +225,7 @@ Bootstrap's collapse class exposes a few events for hooking into collapse functi
</tr>
<tr>
<td>hide.bs.collapse</td>
<td>
This event is fired immediately when the <code>hide</code> method has been called.
</td>
<td>This event is fired immediately when the <code>hide</code> method has been called.</td>
</tr>
<tr>
<td>hidden.bs.collapse</td>

View File

@ -376,7 +376,7 @@ Be sure to add `.col-form-label` to your `<label>`s as well so they're verticall
</div>
</fieldset>
<div class="form-group row">
<label class="col-sm-2">Checkbox</label>
<div class="col-sm-2">Checkbox</div>
<div class="col-sm-10">
<div class="form-check">
<label class="form-check-label">
@ -569,14 +569,14 @@ Should you have no text within the `<label>`, the input is positioned as you'd e
## Static controls
When you need to place plain text next to a form label within a form, use the `.form-control-static` class on an element of your choice.
If you want to have read-only fields in your form styled as plain text, use the `.form-control-static` class to remove the default form field styling and preserve the correct margin and padding.
{% example html %}
<form>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Email</label>
<label for="staticEmail" class="col-sm-2 col-form-label">Email</label>
<div class="col-sm-10">
<p class="form-control-static">email@example.com</p>
<input type="text" readonly class="form-control-static" id="staticEmail" value="email@example.com">
</div>
</div>
<div class="form-group row">
@ -591,8 +591,8 @@ When you need to place plain text next to a form label within a form, use the `.
{% example html %}
<form class="form-inline">
<div class="form-group">
<label class="sr-only">Email</label>
<p class="form-control-static">email@example.com</p>
<label for="staticEmail2" class="sr-only">Email</label>
<input type="text" readonly class="form-control-static" id="staticEmail2" value="email@example.com">
</div>
<div class="form-group mx-sm-3">
<label for="inputPassword2" class="sr-only">Password</label>
@ -604,7 +604,7 @@ When you need to place plain text next to a form label within a form, use the `.
## Disabled states
Add the `disabled` boolean attribute on an input to prevent user interactions. Disabled inputs appear lighter and add a `not-allowed` cursor.
Add the `disabled` boolean attribute on an input to prevent user interactions and make it appear lighter.
{% highlight html %}
<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>

View File

@ -96,8 +96,6 @@ On the rare occasion you need to override it, use something like the following:
{% highlight scss %}
.selector-for-some-widget {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
{% endhighlight %}