bs4 docs sync

This commit is contained in:
Kevin Ross 2016-03-01 09:16:31 -06:00
parent 283ae05c07
commit 2faec6e72b
10 changed files with 92 additions and 62 deletions

View File

@ -5,7 +5,7 @@ module Jekyll
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
"IE" => ["https://connect.microsoft.com/IE/feedback/details/", "IE bug"],
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
"Chromium" => ["https://code.google.com/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"],
"Safari" => ["https://openradar.appspot.com/", "Apple Safari Radar"],
"Normalize" => ["https://github.com/necolas/normalize.css/issues/", "Normalize"]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -71,7 +71,7 @@ Alerts can also contain additional HTML elements like headings and paragraphs.
<div class="alert alert-success" role="alert">
<h4 class="alert-heading">Well done!</h4>
<p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
<p class="m-b-0">Whenever you need to, be sure to use a margin utilities to keep things nice and tidy.</p>
<p class="m-b-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
{% endexample %}

View File

@ -56,8 +56,6 @@ You can optionally use `<button>` elements in your dropdowns instead of `<a>`s.
</div>
{% endexample %}
## Alignment
By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. Add `.dropdown-menu-right` to a `.dropdown-menu` to right align the dropdown menu.
@ -66,11 +64,18 @@ By default, a dropdown menu is automatically positioned 100% from the top and al
**Heads up!** Dropdowns are positioned only with CSS and may need some additional styles for exact alignment.
{% endcallout %}
{% highlight html %}
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dLabel">
...
{% example html %}
<div class="btn-group">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
This dropdown's menu is right-aligned
</button>
<div class="dropdown-menu dropdown-menu-right">
<button class="dropdown-item" type="button">Action</button>
<button class="dropdown-item" type="button">Another action</button>
<button class="dropdown-item" type="button">Something else here</button>
</div>
{% endhighlight %}
</div>
{% endexample %}
## Menu headers

View File

@ -30,16 +30,16 @@ Remember, since Bootstrap utilizes the HTML5 doctype, **all inputs must have a `
{% example html %}
<form>
<fieldset class="form-group">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="text-muted">We'll never share your email with anyone else.</small>
</fieldset>
<fieldset class="form-group">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</fieldset>
<fieldset class="form-group">
</div>
<div class="form-group">
<label for="exampleSelect1">Example select</label>
<select class="form-control" id="exampleSelect1">
<option>1</option>
@ -48,8 +48,8 @@ Remember, since Bootstrap utilizes the HTML5 doctype, **all inputs must have a `
<option>4</option>
<option>5</option>
</select>
</fieldset>
<fieldset class="form-group">
</div>
<div class="form-group">
<label for="exampleSelect2">Example multiple select</label>
<select multiple class="form-control" id="exampleSelect2">
<option>1</option>
@ -58,16 +58,18 @@ Remember, since Bootstrap utilizes the HTML5 doctype, **all inputs must have a `
<option>4</option>
<option>5</option>
</select>
</fieldset>
<fieldset class="form-group">
</div>
<div class="form-group">
<label for="exampleTextarea">Example textarea</label>
<textarea class="form-control" id="exampleTextarea" rows="3"></textarea>
</fieldset>
<fieldset class="form-group">
</div>
<div class="form-group">
<label for="exampleInputFile">File input</label>
<input type="file" class="form-control-file" id="exampleInputFile" aria-describedby="fileHelp">
<small id="fileHelp" class="text-muted">This is some placeholder block-level help text for the above input. It's a bit lighter and easily wraps to a new line.</small>
</fieldset>
</div>
<fieldset class="form-group">
<legend>Radio buttons</legend>
<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
@ -86,6 +88,7 @@ Remember, since Bootstrap utilizes the HTML5 doctype, **all inputs must have a `
Option three is disabled
</label>
</div>
</fieldset>
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
@ -269,14 +272,14 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o
{% example html %}
<form>
<fieldset class="form-group">
<div class="form-group">
<label for="formGroupExampleInput">Example label</label>
<input type="text" class="form-control" id="formGroupExampleInput" placeholder="Example input">
</fieldset>
<fieldset class="form-group">
</div>
<div class="form-group">
<label for="formGroupExampleInput2">Another label</label>
<input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Another input">
</fieldset>
</div>
</form>
{% endexample %}
@ -341,11 +344,16 @@ Because of this, you may need to manually address the width and alignment of ind
</form>
{% endexample %}
{% callout warning %}
#### Alternatives to hidden labels
Assistive technologies such as 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. There are further alternative methods of providing a label for assistive technologies, such as the `aria-label`, `aria-labelledby` or `title` attribute. If none of these are present, assistive technologies may resort to using the `placeholder` attribute, if present, but note that use of `placeholder` as a replacement for other labelling methods is not advised.
{% endcallout %}
### Using the Grid
For more structured form layouts, you can utilize Bootstrap's predefined grid classes (or mixins) to create horizontal forms. Add the `.row` class to form groups and use the `.col-*-*` classes to specify the width of your labels and controls.
Be sure to add `.form-control-label` to your `<label>`s as well so they're vertically centered with their associated labels.
Be sure to add `.form-control-label` to your `<label>`s as well so they're vertically centered with their associated form controls. For `<legend>` elements, you can use `.form-control-legend` to make them appear similar to regular `<label>` elements.
{% example html %}
<form>
@ -361,8 +369,8 @@ Be sure to add `.form-control-label` to your `<label>`s as well so they're verti
<input type="password" class="form-control" id="inputPassword3" placeholder="Password">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2">Radios</label>
<fieldset class="form-group row">
<legend class="col-sm-2 form-control-legend">Radios</legend>
<div class="col-sm-10">
<div class="radio">
<label>
@ -383,9 +391,9 @@ Be sure to add `.form-control-label` to your `<label>`s as well so they're verti
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2">Checkbox</label>
</fieldset>
<fieldset class="form-group row">
<legend class="col-sm-2 form-control-legend">Checkbox</legend>
<div class="col-sm-10">
<div class="checkbox">
<label>
@ -393,7 +401,7 @@ Be sure to add `.form-control-label` to your `<label>`s as well so they're verti
</label>
</div>
</div>
</div>
</fieldset>
<div class="form-group row">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-secondary">Sign in</button>
@ -474,17 +482,17 @@ Use the `.checkbox-inline` or `.radio-inline` classes on a series of checkboxes
### Without labels
Should you have no text within the `<label>`, the input is positioned as you'd expect. **Currently only works on non-inline checkboxes and radios.**
Should you have no text within the `<label>`, the input is positioned as you'd expect. **Currently only works on non-inline checkboxes and radios.** Remember to still provide some form of label for assistive technologies (for instance, using `aria-label`).
{% example html %}
<div class="checkbox">
<label>
<input type="checkbox" id="blankCheckbox" value="option1">
<input type="checkbox" id="blankCheckbox" value="option1" aria-label="...">
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="blankRadio" id="blankRadio1" value="option1">
<input type="radio" name="blankRadio" id="blankRadio1" value="option1" aria-label="...">
</label>
</div>
{% endexample %}

View File

@ -25,7 +25,7 @@ See the <a href="/material-design/buttons">Material Design</a> section for more
The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.
<div class="bd-example">
<nav id="navbar-example2" class="navbar navbar-default" role="navigation">
<nav id="navbar-example2" class="navbar navbar-default">
<h3 class="navbar-brand">Project Name</h3>
<ul class="nav nav-pills">
<li class="nav-item"><a class="nav-link" href="#fat">@fat</a></li>

View File

@ -50,6 +50,8 @@ Where *size* is one of:
* `2` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 1.5` or `$spacer-y * 1.5`
* `3` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 3` or `$spacer-y * 3`
(You can add more sizes by adding entries to the `$spacers` Sass map variable.)
Here are some representative examples of these classes:
{% highlight scss %}
@ -238,6 +240,20 @@ Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes
}
{% endhighlight %}
## Fixed positioning
The `.pos-f-t` class can be used to easily position elements at the top of the viewport and make them as wide as the viewport. **Be sure you understand the ramifications of fixed-position elements within your project.** Here's how the class is defined:
{% highlight scss %}
.pos-f-t {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: $zindex-navbar-fixed;
}
{% endhighlight %}
## Invisible content
The `.invisible` class can be used to toggle only the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document.