mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-23 18:40:03 +00:00
Merge branch 'v4-dev' into v4-docs-streamlined
This commit is contained in:
commit
047d4a77da
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
**/*.min.js
|
||||||
|
**/vendor/*
|
||||||
|
**/dist/*
|
@ -3,7 +3,6 @@ fail_on_violations: true
|
|||||||
scss:
|
scss:
|
||||||
config_file: scss/.scss-lint.yml
|
config_file: scss/.scss-lint.yml
|
||||||
enabled: true
|
enabled: true
|
||||||
ignore_file: scss/_normalize.scss
|
|
||||||
|
|
||||||
javascript:
|
javascript:
|
||||||
enabled: false
|
enabled: false
|
||||||
@ -11,6 +10,7 @@ javascript:
|
|||||||
eslint:
|
eslint:
|
||||||
enabled: true
|
enabled: true
|
||||||
config_file: js/.eslintrc.json
|
config_file: js/.eslintrc.json
|
||||||
|
ignore_file: .houndignore
|
||||||
|
|
||||||
jscs:
|
jscs:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
4
.houndignore
Normal file
4
.houndignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
**/*.min.js
|
||||||
|
**/vendor/*
|
||||||
|
**/dist/*
|
||||||
|
js/tests/*
|
20
.travis.yml
20
.travis.yml
@ -1,39 +1,33 @@
|
|||||||
sudo: required
|
sudo: false
|
||||||
dist: trusty
|
dist: trusty
|
||||||
language: node_js
|
language: node_js
|
||||||
git:
|
git:
|
||||||
depth: 10
|
depth: 3
|
||||||
node_js:
|
node_js:
|
||||||
- "4"
|
- "4"
|
||||||
- "6"
|
- "6"
|
||||||
before_install:
|
before_install:
|
||||||
# Remove ./node_modules/.bin from PATH so node-which doesn't replace Unix which and cause RVM to barf. See https://github.com/travis-ci/travis-ci/issues/5092
|
- if [[ `npm -v` != 3* ]]; then npm install -g npm@3; fi
|
||||||
- export PATH=$(python -c 'from sys import argv;from collections import OrderedDict as od;print(":".join(od((p,None) for p in argv[1].split(":") if p.startswith("/")).keys()))' "$PATH")
|
- "export TRAVIS_COMMIT_MSG=\"`git log --format=%B --no-merges -n 1`\""
|
||||||
- rvm install 2.2
|
|
||||||
- rvm use 2.2 --fuzzy
|
|
||||||
- npm install -g npm@3
|
|
||||||
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
|
|
||||||
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export TWBS_DO_VALIDATOR=$?; true
|
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export TWBS_DO_VALIDATOR=$?; true
|
||||||
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export TWBS_DO_SAUCE=$?; true
|
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export TWBS_DO_SAUCE=$?; true
|
||||||
- if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then export TWBS_DO_VALIDATOR=0; fi
|
- if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then export TWBS_DO_VALIDATOR=0; fi
|
||||||
install:
|
install:
|
||||||
- bundle install --deployment --jobs=3
|
- bundle install --deployment --jobs=3 --retry=3
|
||||||
- cp grunt/npm-shrinkwrap.json ./
|
- cp grunt/npm-shrinkwrap.json ./
|
||||||
- npm install
|
- npm install
|
||||||
|
after_success:
|
||||||
|
- if [ "$TWBS_TEST" = sauce-js-unit ]; then grunt/upload-preview.sh; fi
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
- vendor/bundle
|
- vendor/bundle
|
||||||
- "$HOME/google-cloud-sdk"
|
- "$HOME/google-cloud-sdk"
|
||||||
env:
|
env:
|
||||||
global:
|
|
||||||
- NPM_CONFIG_PROGRESS="false"
|
|
||||||
matrix:
|
|
||||||
- TWBS_TEST=core
|
- TWBS_TEST=core
|
||||||
- TWBS_TEST=validate-html
|
- TWBS_TEST=validate-html
|
||||||
- TWBS_TEST=sauce-js-unit
|
- TWBS_TEST=sauce-js-unit
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
|
||||||
exclude:
|
exclude:
|
||||||
- node_js: "4"
|
- node_js: "4"
|
||||||
env: TWBS_TEST=validate-html
|
env: TWBS_TEST=validate-html
|
||||||
|
@ -2,4 +2,4 @@ Bootstrap uses [GitHub's Releases feature](https://github.com/blog/1547-release-
|
|||||||
|
|
||||||
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap.
|
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap.
|
||||||
|
|
||||||
Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release.
|
Release announcement posts on [the official Bootstrap blog](https://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release.
|
||||||
|
@ -32,7 +32,7 @@ restrictions:
|
|||||||
[`Normalize`](https://github.com/necolas/normalize.css) (open them in
|
[`Normalize`](https://github.com/necolas/normalize.css) (open them in
|
||||||
its repository).
|
its repository).
|
||||||
|
|
||||||
* Please **do not** open issues regarding the official themes offered on <http://themes.getbootstrap.com/>.
|
* Please **do not** open issues regarding the official themes offered on <https://themes.getbootstrap.com/>.
|
||||||
Instead, please email any questions or feedback regarding those themes to `themes AT getbootstrap DOT com`.
|
Instead, please email any questions or feedback regarding those themes to `themes AT getbootstrap DOT com`.
|
||||||
|
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ Good bug reports are extremely helpful, so thanks!
|
|||||||
|
|
||||||
Guidelines for bug reports:
|
Guidelines for bug reports:
|
||||||
|
|
||||||
0. **Validate and lint your code** — [validate your HTML](http://html5.validator.nu)
|
0. **Validate and lint your code** — [validate your HTML](https://html5.validator.nu)
|
||||||
and [lint your HTML](https://github.com/twbs/bootlint) to ensure your
|
and [lint your HTML](https://github.com/twbs/bootlint) to ensure your
|
||||||
problem isn't caused by a simple error in your own code.
|
problem isn't caused by a simple error in your own code.
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ Guidelines for bug reports:
|
|||||||
|
|
||||||
3. **Isolate the problem** — ideally create a [reduced test
|
3. **Isolate the problem** — ideally create a [reduced test
|
||||||
case](https://css-tricks.com/reduced-test-cases/) and a live example.
|
case](https://css-tricks.com/reduced-test-cases/) and a live example.
|
||||||
[This JS Bin](http://jsbin.com/qusafa/edit?html,output) is a helpful template.
|
[This JS Bin](https://jsbin.com/lolome/edit?html,output) is a helpful template.
|
||||||
|
|
||||||
|
|
||||||
A good bug report shouldn't leave others needing to chase you up for more
|
A good bug report shouldn't leave others needing to chase you up for more
|
||||||
@ -104,7 +104,7 @@ Example:
|
|||||||
### Reporting upstream browser bugs
|
### Reporting upstream browser bugs
|
||||||
|
|
||||||
Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Bootstrap per se.
|
Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Bootstrap per se.
|
||||||
When feasible, we aim to report such upstream bugs to the relevant browser vendor(s), and then list them on our [Wall of Browser Bugs](http://getbootstrap.com/browser-bugs/) and [document them in MDN](https://developer.mozilla.org/en-US/docs/Web).
|
When feasible, we aim to report such upstream bugs to the relevant browser vendor(s), and then list them on our [Wall of Browser Bugs](https://getbootstrap.com/browser-bugs/) and [document them in MDN](https://developer.mozilla.org/en-US/docs/Web).
|
||||||
|
|
||||||
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
|
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
|
||||||
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
||||||
@ -232,8 +232,8 @@ includes code changes) and under the terms of the
|
|||||||
|
|
||||||
[Adhere to the Code Guide.](http://codeguide.co/#css)
|
[Adhere to the Code Guide.](http://codeguide.co/#css)
|
||||||
|
|
||||||
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](http://www.w3.org/TR/WCAG20/#visual-audio-contrast).
|
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG20/#visual-audio-contrast).
|
||||||
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](http://a11yproject.com/posts/never-remove-css-outlines) for more details.
|
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](http://a11yproject.com/posts/never-remove-css-outlines/) for more details.
|
||||||
|
|
||||||
### JS
|
### JS
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ includes code changes) and under the terms of the
|
|||||||
- 2 spaces (no tabs)
|
- 2 spaces (no tabs)
|
||||||
- strict mode
|
- strict mode
|
||||||
- "Attractive"
|
- "Attractive"
|
||||||
- Don't use [jQuery event alias convenience methods](https://github.com/jquery/jquery/blob/master/src/event/alias.js) (such as `$().focus()`). Instead, use [`$().trigger(eventType, ...)`](http://api.jquery.com/trigger/) or [`$().on(eventType, ...)`](http://api.jquery.com/on/), depending on whether you're firing an event or listening for an event. (For example, `$().trigger('focus')` or `$().on('focus', function (event) { /* handle focus event */ })`) We do this to be compatible with custom builds of jQuery where the event aliases module has been excluded.
|
- Don't use [jQuery event alias convenience methods](https://github.com/jquery/jquery/blob/master/src/event/alias.js) (such as `$().focus()`). Instead, use [`$().trigger(eventType, ...)`](https://api.jquery.com/trigger/) or [`$().on(eventType, ...)`](https://api.jquery.com/on/), depending on whether you're firing an event or listening for an event. (For example, `$().trigger('focus')` or `$().on('focus', function (event) { /* handle focus event */ })`) We do this to be compatible with custom builds of jQuery where the event aliases module has been excluded.
|
||||||
|
|
||||||
### Checking coding style
|
### Checking coding style
|
||||||
|
|
||||||
|
4
Gemfile
4
Gemfile
@ -1,8 +1,8 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'jekyll', '~> 3.1.2'
|
gem 'jekyll', '~> 3.3.0'
|
||||||
gem 'jekyll-redirect-from', '~> 0.11.0'
|
gem 'jekyll-redirect-from', '~> 0.11.0'
|
||||||
gem 'jekyll-sitemap', '~> 0.11.0'
|
gem 'jekyll-sitemap', '~> 0.11.0'
|
||||||
gem 'scss_lint', '~> 0.49.0'
|
gem 'scss_lint', '~> 0.50.2'
|
||||||
end
|
end
|
||||||
|
29
Gemfile.lock
29
Gemfile.lock
@ -2,16 +2,18 @@ GEM
|
|||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
addressable (2.4.0)
|
addressable (2.4.0)
|
||||||
colorator (0.1)
|
colorator (1.1.0)
|
||||||
ffi (1.9.13)
|
ffi (1.9.14)
|
||||||
ffi (1.9.13-x64-mingw32)
|
forwardable-extended (2.6.0)
|
||||||
jekyll (3.1.6)
|
jekyll (3.3.0)
|
||||||
colorator (~> 0.1)
|
addressable (~> 2.4)
|
||||||
|
colorator (~> 1.0)
|
||||||
jekyll-sass-converter (~> 1.0)
|
jekyll-sass-converter (~> 1.0)
|
||||||
jekyll-watch (~> 1.1)
|
jekyll-watch (~> 1.1)
|
||||||
kramdown (~> 1.3)
|
kramdown (~> 1.3)
|
||||||
liquid (~> 3.0)
|
liquid (~> 3.0)
|
||||||
mercenary (~> 0.3.3)
|
mercenary (~> 0.3.3)
|
||||||
|
pathutil (~> 0.9)
|
||||||
rouge (~> 1.7)
|
rouge (~> 1.7)
|
||||||
safe_yaml (~> 1.0)
|
safe_yaml (~> 1.0)
|
||||||
jekyll-redirect-from (0.11.0)
|
jekyll-redirect-from (0.11.0)
|
||||||
@ -20,34 +22,35 @@ GEM
|
|||||||
sass (~> 3.4)
|
sass (~> 3.4)
|
||||||
jekyll-sitemap (0.11.0)
|
jekyll-sitemap (0.11.0)
|
||||||
addressable (~> 2.4.0)
|
addressable (~> 2.4.0)
|
||||||
jekyll-watch (1.4.0)
|
jekyll-watch (1.5.0)
|
||||||
listen (~> 3.0, < 3.1)
|
listen (~> 3.0, < 3.1)
|
||||||
kramdown (1.11.1)
|
kramdown (1.12.0)
|
||||||
liquid (3.0.6)
|
liquid (3.0.6)
|
||||||
listen (3.0.8)
|
listen (3.0.8)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
mercenary (0.3.6)
|
mercenary (0.3.6)
|
||||||
rake (11.2.2)
|
pathutil (0.14.0)
|
||||||
|
forwardable-extended (~> 2.6)
|
||||||
|
rake (11.3.0)
|
||||||
rb-fsevent (0.9.7)
|
rb-fsevent (0.9.7)
|
||||||
rb-inotify (0.9.7)
|
rb-inotify (0.9.7)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
rouge (1.11.1)
|
rouge (1.11.1)
|
||||||
safe_yaml (1.0.4)
|
safe_yaml (1.0.4)
|
||||||
sass (3.4.22)
|
sass (3.4.22)
|
||||||
scss_lint (0.49.0)
|
scss_lint (0.50.2)
|
||||||
rake (>= 0.9, < 12)
|
rake (>= 0.9, < 12)
|
||||||
sass (~> 3.4.20)
|
sass (~> 3.4.20)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
x64-mingw32
|
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
jekyll (~> 3.1.2)
|
jekyll (~> 3.3.0)
|
||||||
jekyll-redirect-from (~> 0.11.0)
|
jekyll-redirect-from (~> 0.11.0)
|
||||||
jekyll-sitemap (~> 0.11.0)
|
jekyll-sitemap (~> 0.11.0)
|
||||||
scss_lint (~> 0.49.0)
|
scss_lint (~> 0.50.2)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.12.5
|
1.13.2
|
||||||
|
116
Gruntfile.js
116
Gruntfile.js
@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Bootstrap's Gruntfile
|
* Bootstrap's Gruntfile
|
||||||
* http://getbootstrap.com
|
* https://getbootstrap.com
|
||||||
* Copyright 2013-2016 The Bootstrap Authors
|
* Copyright 2013-2016 The Bootstrap Authors
|
||||||
* Copyright 2013-2016 Twitter, Inc.
|
* Copyright 2013-2016 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
@ -39,7 +39,7 @@ module.exports = function (grunt) {
|
|||||||
' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
|
' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
|
||||||
' */\n',
|
' */\n',
|
||||||
jqueryCheck: 'if (typeof jQuery === \'undefined\') {\n' +
|
jqueryCheck: 'if (typeof jQuery === \'undefined\') {\n' +
|
||||||
' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\')\n' +
|
' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\\'s JavaScript.\')\n' +
|
||||||
'}\n',
|
'}\n',
|
||||||
jqueryVersionCheck: '+function ($) {\n' +
|
jqueryVersionCheck: '+function ($) {\n' +
|
||||||
' var version = $.fn.jquery.split(\' \')[0].split(\'.\')\n' +
|
' var version = $.fn.jquery.split(\' \')[0].split(\'.\')\n' +
|
||||||
@ -58,8 +58,7 @@ module.exports = function (grunt) {
|
|||||||
babel: {
|
babel: {
|
||||||
dev: {
|
dev: {
|
||||||
options: {
|
options: {
|
||||||
sourceMap: true,
|
sourceMap: true
|
||||||
modules: 'ignore'
|
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
'js/dist/util.js' : 'js/src/util.js',
|
'js/dist/util.js' : 'js/src/util.js',
|
||||||
@ -77,7 +76,7 @@ module.exports = function (grunt) {
|
|||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
options: {
|
options: {
|
||||||
modules: 'ignore'
|
extends: '../../js/.babelrc'
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
'<%= concat.bootstrap.dest %>' : '<%= concat.bootstrap.dest %>'
|
'<%= concat.bootstrap.dest %>' : '<%= concat.bootstrap.dest %>'
|
||||||
@ -87,8 +86,8 @@ module.exports = function (grunt) {
|
|||||||
|
|
||||||
stamp: {
|
stamp: {
|
||||||
options: {
|
options: {
|
||||||
banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>\n+function ($) {\n',
|
banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>\n+function () {\n',
|
||||||
footer: '\n}(jQuery);'
|
footer: '\n}();'
|
||||||
},
|
},
|
||||||
bootstrap: {
|
bootstrap: {
|
||||||
files: {
|
files: {
|
||||||
@ -102,8 +101,7 @@ module.exports = function (grunt) {
|
|||||||
// Custom function to remove all export and import statements
|
// Custom function to remove all export and import statements
|
||||||
process: function (src) {
|
process: function (src) {
|
||||||
return src.replace(/^(export|import).*/gm, '');
|
return src.replace(/^(export|import).*/gm, '');
|
||||||
},
|
}
|
||||||
stripBanners: false
|
|
||||||
},
|
},
|
||||||
bootstrap: {
|
bootstrap: {
|
||||||
src: [
|
src: [
|
||||||
@ -123,24 +121,6 @@ module.exports = function (grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
uglify: {
|
|
||||||
options: {
|
|
||||||
compress: {
|
|
||||||
warnings: false
|
|
||||||
},
|
|
||||||
mangle: true,
|
|
||||||
preserveComments: /^!|@preserve|@license|@cc_on/i
|
|
||||||
},
|
|
||||||
core: {
|
|
||||||
src: '<%= concat.bootstrap.dest %>',
|
|
||||||
dest: 'dist/js/<%= pkg.name %>.min.js'
|
|
||||||
},
|
|
||||||
docsJs: {
|
|
||||||
src: configBridge.paths.docsJs,
|
|
||||||
dest: 'docs/assets/js/docs.min.js'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
qunit: {
|
qunit: {
|
||||||
options: {
|
options: {
|
||||||
inject: 'js/tests/unit/phantom.js'
|
inject: 'js/tests/unit/phantom.js'
|
||||||
@ -149,53 +129,6 @@ module.exports = function (grunt) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// CSS build configuration
|
// CSS build configuration
|
||||||
scsslint: {
|
|
||||||
options: {
|
|
||||||
bundleExec: true,
|
|
||||||
config: 'scss/.scss-lint.yml',
|
|
||||||
reporterOutput: null
|
|
||||||
},
|
|
||||||
core: {
|
|
||||||
src: ['scss/*.scss', '!scss/_normalize.scss']
|
|
||||||
},
|
|
||||||
docs: {
|
|
||||||
src: ['docs/assets/scss/*.scss', '!docs/assets/scss/docs.scss']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
cssmin: {
|
|
||||||
options: {
|
|
||||||
// TODO: disable `zeroUnits` optimization once clean-css 3.2 is released
|
|
||||||
// and then simplify the fix for https://github.com/twbs/bootstrap/issues/14837 accordingly
|
|
||||||
compatibility: 'ie9',
|
|
||||||
keepSpecialComments: '*',
|
|
||||||
sourceMap: true,
|
|
||||||
advanced: false
|
|
||||||
},
|
|
||||||
core: {
|
|
||||||
files: [
|
|
||||||
{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'dist/css',
|
|
||||||
src: ['*.css', '!*.min.css'],
|
|
||||||
dest: 'dist/css',
|
|
||||||
ext: '.min.css'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
docs: {
|
|
||||||
files: [
|
|
||||||
{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'docs/assets/css',
|
|
||||||
src: ['*.css', '!*.min.css'],
|
|
||||||
dest: 'docs/assets/css',
|
|
||||||
ext: '.min.css'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
copy: {
|
copy: {
|
||||||
docs: {
|
docs: {
|
||||||
expand: true,
|
expand: true,
|
||||||
@ -279,6 +212,12 @@ module.exports = function (grunt) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
exec: {
|
exec: {
|
||||||
|
'clean-css': {
|
||||||
|
command: 'npm run clean-css'
|
||||||
|
},
|
||||||
|
'clean-css-docs': {
|
||||||
|
command: 'npm run clean-css-docs'
|
||||||
|
},
|
||||||
postcss: {
|
postcss: {
|
||||||
command: 'npm run postcss'
|
command: 'npm run postcss'
|
||||||
},
|
},
|
||||||
@ -288,8 +227,17 @@ module.exports = function (grunt) {
|
|||||||
htmlhint: {
|
htmlhint: {
|
||||||
command: 'npm run htmlhint'
|
command: 'npm run htmlhint'
|
||||||
},
|
},
|
||||||
'upload-preview': {
|
'scss-lint': {
|
||||||
command: './grunt/upload-preview.sh'
|
command: 'npm run scss-lint'
|
||||||
|
},
|
||||||
|
'scss-lint-docs': {
|
||||||
|
command: 'npm run scss-lint-docs'
|
||||||
|
},
|
||||||
|
uglify: {
|
||||||
|
command: 'npm run uglify'
|
||||||
|
},
|
||||||
|
'uglify-docs': {
|
||||||
|
command: 'npm run uglify-docs'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -365,7 +313,7 @@ module.exports = function (grunt) {
|
|||||||
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
|
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
|
||||||
// Skip Sauce if running a different subset of the test suite
|
// Skip Sauce if running a different subset of the test suite
|
||||||
runSubset('sauce-js-unit')) {
|
runSubset('sauce-js-unit')) {
|
||||||
testSubtasks = testSubtasks.concat(['dist', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs', 'exec:upload-preview']);
|
testSubtasks = testSubtasks.concat(['dist', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']);
|
||||||
// Skip Sauce on Travis when [skip sauce] is in the commit message
|
// Skip Sauce on Travis when [skip sauce] is in the commit message
|
||||||
if (isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
|
if (isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
|
||||||
testSubtasks.push('connect');
|
testSubtasks.push('connect');
|
||||||
@ -375,9 +323,9 @@ module.exports = function (grunt) {
|
|||||||
grunt.registerTask('test', testSubtasks);
|
grunt.registerTask('test', testSubtasks);
|
||||||
|
|
||||||
// JS distribution task.
|
// JS distribution task.
|
||||||
grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'uglify:core']);
|
grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'exec:uglify']);
|
||||||
|
|
||||||
grunt.registerTask('test-scss', ['scsslint:core']);
|
grunt.registerTask('test-scss', ['exec:scss-lint']);
|
||||||
|
|
||||||
// CSS distribution task.
|
// CSS distribution task.
|
||||||
// Supported Compilers: sass (Ruby) and libsass.
|
// Supported Compilers: sass (Ruby) and libsass.
|
||||||
@ -385,9 +333,9 @@ module.exports = function (grunt) {
|
|||||||
require('./grunt/bs-sass-compile/' + sassCompilerName + '.js')(grunt);
|
require('./grunt/bs-sass-compile/' + sassCompilerName + '.js')(grunt);
|
||||||
})(process.env.TWBS_SASS || 'libsass');
|
})(process.env.TWBS_SASS || 'libsass');
|
||||||
// grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']);
|
// grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']);
|
||||||
grunt.registerTask('sass-compile', ['sass:core', 'sass:docs']);
|
grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']);
|
||||||
|
|
||||||
grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'cssmin:core', 'cssmin:docs']);
|
grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'exec:clean-css', 'exec:clean-css-docs']);
|
||||||
|
|
||||||
// Full distribution task.
|
// Full distribution task.
|
||||||
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']);
|
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']);
|
||||||
@ -396,9 +344,9 @@ module.exports = function (grunt) {
|
|||||||
grunt.registerTask('default', ['clean:dist', 'test']);
|
grunt.registerTask('default', ['clean:dist', 'test']);
|
||||||
|
|
||||||
// Docs task.
|
// Docs task.
|
||||||
grunt.registerTask('docs-css', ['cssmin:docs', 'exec:postcss-docs']);
|
grunt.registerTask('docs-css', ['exec:clean-css-docs', 'exec:postcss-docs']);
|
||||||
grunt.registerTask('lint-docs-css', ['scsslint:docs']);
|
grunt.registerTask('lint-docs-css', ['exec:scss-lint-docs']);
|
||||||
grunt.registerTask('docs-js', ['uglify:docsJs']);
|
grunt.registerTask('docs-js', ['exec:uglify-docs']);
|
||||||
grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']);
|
grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']);
|
||||||
grunt.registerTask('docs-github', ['jekyll:github']);
|
grunt.registerTask('docs-github', ['jekyll:github']);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Before opening an issue:
|
Before opening an issue:
|
||||||
|
|
||||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||||
- [Validate](http://validator.w3.org/nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
|
- [Validate](https://validator.w3.org/nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
|
||||||
- Prepare a [reduced test case](https://css-tricks.com/reduced-test-cases/) for any bugs
|
- Prepare a [reduced test case](https://css-tricks.com/reduced-test-cases/) for any bugs
|
||||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
||||||
|
|
||||||
|
32
README.md
32
README.md
@ -1,20 +1,20 @@
|
|||||||
# [Bootstrap](http://getbootstrap.com)
|
# [Bootstrap](https://getbootstrap.com)
|
||||||
|
|
||||||
[](https://bootstrap-slack.herokuapp.com)
|
[](https://bootstrap-slack.herokuapp.com)
|
||||||

|

|
||||||
[](https://www.npmjs.com/package/bootstrap)
|
[](https://www.npmjs.com/package/bootstrap)
|
||||||
[](https://rubygems.org/gems/bootstrap)
|
[](https://rubygems.org/gems/bootstrap)
|
||||||
[](https://travis-ci.org/twbs/bootstrap)
|
[](https://travis-ci.org/twbs/bootstrap)
|
||||||
[](https://david-dm.org/twbs/bootstrap#info=devDependencies)
|
[](https://david-dm.org/twbs/bootstrap?type=dev)
|
||||||
[](https://atmospherejs.com/twbs/bootstrap)
|
[](https://atmospherejs.com/twbs/bootstrap)
|
||||||
[](https://packagist.org/packages/twbs/bootstrap)
|
[](https://packagist.org/packages/twbs/bootstrap)
|
||||||
[](https://www.nuget.org/packages/bootstrap/4.0.0-alpha4)
|
[](https://www.nuget.org/packages/bootstrap/4.0.0-alpha5)
|
||||||
|
|
||||||
[](https://saucelabs.com/u/bootstrap)
|
[](https://saucelabs.com/u/bootstrap)
|
||||||
|
|
||||||
Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community.
|
Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community.
|
||||||
|
|
||||||
To get started, check out <http://getbootstrap.com>!
|
To get started, check out <https://getbootstrap.com>!
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
@ -31,15 +31,15 @@ To get started, check out <http://getbootstrap.com>!
|
|||||||
|
|
||||||
Several quick start options are available:
|
Several quick start options are available:
|
||||||
|
|
||||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.4.zip)
|
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.5.zip)
|
||||||
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
|
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
|
||||||
- Install with [npm](https://www.npmjs.com): `npm install bootstrap@4.0.0-alpha.4`
|
- Install with [npm](https://www.npmjs.com): `npm install bootstrap@4.0.0-alpha.5`
|
||||||
- Install with [Meteor](https://www.meteor.com): `meteor add twbs:bootstrap@=4.0.0-alpha.4`
|
- Install with [yarn](https://github.com/yarnpkg/yarn): `yarn add bootstrap@4.0.0-alpha.5`
|
||||||
- Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap`
|
- Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap:4.0.0-alpha.5`
|
||||||
- Install with [Bower](http://bower.io): `bower install bootstrap#v4.0.0-alpha.4`
|
- Install with [Bower](https://bower.io): `bower install bootstrap#v4.0.0-alpha.5`
|
||||||
- Install with [NuGet](https://www.nuget.org): CSS: `Install-Package bootstrap -Pre` Sass: `Install-Package bootstrap.sass -Pre` (`-Pre` is only required until Bootstrap v4 has a stable release).
|
- Install with [NuGet](https://www.nuget.org): CSS: `Install-Package bootstrap -Pre` Sass: `Install-Package bootstrap.sass -Pre` (`-Pre` is only required until Bootstrap v4 has a stable release).
|
||||||
|
|
||||||
Read the [Getting started page](http://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more.
|
Read the [Getting started page](https://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more.
|
||||||
|
|
||||||
### What's included
|
### What's included
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ Have a bug or a feature request? Please first read the [issue guidelines](https:
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at <http://getbootstrap.com>. The docs may also be run locally.
|
Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](https://jekyllrb.com) and publicly hosted on GitHub Pages at <https://getbootstrap.com>. The docs may also be run locally.
|
||||||
|
|
||||||
### Running documentation locally
|
### Running documentation locally
|
||||||
|
|
||||||
@ -76,11 +76,11 @@ Bootstrap's documentation, included in this repo in the root directory, is built
|
|||||||
3. From the root `/bootstrap` directory, run `bundle exec jekyll serve` in the command line.
|
3. From the root `/bootstrap` directory, run `bundle exec jekyll serve` in the command line.
|
||||||
4. Open <http://localhost:9001> in your browser, and voilà.
|
4. Open <http://localhost:9001> in your browser, and voilà.
|
||||||
|
|
||||||
Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com/docs/home/).
|
Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/home/).
|
||||||
|
|
||||||
### Documentation for previous releases
|
### Documentation for previous releases
|
||||||
|
|
||||||
Documentation for v2.3.2 has been made available for the time being at <http://getbootstrap.com/2.3.2/> while folks transition to Bootstrap 3.
|
Documentation for v2.3.2 has been made available for the time being at <https://getbootstrap.com/2.3.2/> while folks transition to Bootstrap 3.
|
||||||
|
|
||||||
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
|
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ Editor preferences are available in the [editor config](https://github.com/twbs/
|
|||||||
Get updates on Bootstrap's development and chat with the project maintainers and community members.
|
Get updates on Bootstrap's development and chat with the project maintainers and community members.
|
||||||
|
|
||||||
- Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
|
- Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
|
||||||
- Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com).
|
- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com).
|
||||||
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com).
|
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com).
|
||||||
- Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
|
- Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
|
||||||
- Implementation help may be found at Stack Overflow (tagged [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4)).
|
- Implementation help may be found at Stack Overflow (tagged [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4)).
|
||||||
@ -113,7 +113,7 @@ Get updates on Bootstrap's development and chat with the project maintainers and
|
|||||||
|
|
||||||
For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.
|
For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.
|
||||||
|
|
||||||
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release.
|
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](https://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release.
|
||||||
|
|
||||||
|
|
||||||
## Creators
|
## Creators
|
||||||
@ -132,4 +132,4 @@ See [the Releases section of our GitHub project](https://github.com/twbs/bootstr
|
|||||||
|
|
||||||
## Copyright and license
|
## Copyright and license
|
||||||
|
|
||||||
Code and documentation copyright 2011-2016 the Bootstrap Authors and Twitter, Inc. Code released under [the MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE).
|
Code and documentation copyright 2011-2016 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE).
|
||||||
|
38
_config.yml
38
_config.yml
@ -14,7 +14,7 @@ destination: _gh_pages
|
|||||||
host: 0.0.0.0
|
host: 0.0.0.0
|
||||||
port: 9001
|
port: 9001
|
||||||
baseurl: ""
|
baseurl: ""
|
||||||
url: http://getbootstrap.com
|
url: https://v4-alpha.getbootstrap.com
|
||||||
encoding: UTF-8
|
encoding: UTF-8
|
||||||
exclude: [assets/scss/]
|
exclude: [assets/scss/]
|
||||||
|
|
||||||
@ -22,26 +22,34 @@ gems:
|
|||||||
- jekyll-redirect-from
|
- jekyll-redirect-from
|
||||||
- jekyll-sitemap
|
- jekyll-sitemap
|
||||||
|
|
||||||
|
# Social
|
||||||
|
title: Bootstrap
|
||||||
|
description: The most popular HTML, CSS, and JS framework in the world.
|
||||||
|
twitter: getbootstrap
|
||||||
|
authors: Mark Otto, Jacob Thornton, and Bootstrap contributors
|
||||||
|
social_logo_path: /assets/brand/bootstrap-social-logo.png
|
||||||
|
social_image_path: /assets/brand/bootstrap-social.png
|
||||||
|
|
||||||
# Custom vars
|
# Custom vars
|
||||||
current_version: 4.0.0-alpha.4
|
current_version: 4.0.0-alpha.5
|
||||||
repo: https://github.com/twbs/bootstrap
|
repo: https://github.com/twbs/bootstrap
|
||||||
slack: https://bootstrap-slack.herokuapp.com
|
slack: https://bootstrap-slack.herokuapp.com
|
||||||
|
|
||||||
download:
|
download:
|
||||||
source: https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.4.zip
|
source: https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.5.zip
|
||||||
dist: https://github.com/twbs/bootstrap/releases/download/v4.0.0-alpha.4/bootstrap-4.0.0-alpha.4-dist.zip
|
dist: https://github.com/twbs/bootstrap/releases/download/v4.0.0-alpha.5/bootstrap-4.0.0-alpha.5-dist.zip
|
||||||
|
|
||||||
blog: http://blog.getbootstrap.com
|
blog: https://blog.getbootstrap.com
|
||||||
expo: http://expo.getbootstrap.com
|
expo: https://expo.getbootstrap.com
|
||||||
themes: http://themes.getbootstrap.com
|
themes: https://themes.getbootstrap.com
|
||||||
|
|
||||||
cdn:
|
cdn:
|
||||||
# See https://www.srihash.org for info on how to generate the hashes
|
# See https://www.srihash.org for info on how to generate the hashes
|
||||||
css: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css
|
css: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css
|
||||||
css_hash: "2hfp1SzUoho7/TsGGGDaFdsuuDL0LX2hnUp6VkX3CUQ2K4K+xjboZdsXyp4oUHZj"
|
css_hash: "sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi"
|
||||||
js: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/js/bootstrap.min.js
|
js: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js
|
||||||
js_hash: "VjEeINv9OSwtWFLAtmc4JCtEJXXBub00gtSnszmspDLCtC0I4z4nqz7rEFbIZLLU"
|
js_hash: "sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK"
|
||||||
jquery: https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js
|
jquery: https://code.jquery.com/jquery-3.1.1.min.js
|
||||||
jquery_hash: "sha384-THPy051/pYDQGanwU6poAc/hOdQxjnOEXzbT+OuUAFqNqFjL+4IGLBgCJC3ZOShY"
|
jquery_hash: "sha384-3ceskX3iaEnIogmQchP8opvBy3Mi7Ce34nWjpBIwVTHfGYWQS9jwHDVRnpKKHJg7"
|
||||||
tether: https://cdnjs.cloudflare.com/ajax/libs/tether/1.2.0/js/tether.min.js
|
tether: https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/js/tether.min.js
|
||||||
tether_hash: "sha384-Plbmg8JY28KFelvJVai01l8WyZzrYWG825m+cZ0eDDS1f7d/js6ikvy1+X+guPIB"
|
tether_hash: "sha384-XTs3FgkjiBgo8qjEjBk0tGmf3wPrWtA6coPfQDfFEY8AnYJwjalXCiosYRBIBZX8"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"framework",
|
"framework",
|
||||||
"web"
|
"web"
|
||||||
],
|
],
|
||||||
"homepage": "http://getbootstrap.com",
|
"homepage": "https://getbootstrap.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"moduleType": "globals",
|
"moduleType": "globals",
|
||||||
"main": [
|
"main": [
|
||||||
@ -30,6 +30,6 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jquery": "1.9.1 - 3",
|
"jquery": "1.9.1 - 3",
|
||||||
"tether": "^1.1.1"
|
"tether": "^1.3.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"framework",
|
"framework",
|
||||||
"web"
|
"web"
|
||||||
],
|
],
|
||||||
"homepage": "http://getbootstrap.com",
|
"homepage": "https://getbootstrap.com",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Mark Otto",
|
"name": "Mark Otto",
|
||||||
|
1337
dist/css/bootstrap-grid.css
vendored
Normal file
1337
dist/css/bootstrap-grid.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
dist/css/bootstrap-grid.css.map
vendored
Normal file
1
dist/css/bootstrap-grid.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/css/bootstrap-grid.min.css
vendored
Normal file
1
dist/css/bootstrap-grid.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/css/bootstrap-grid.min.css.map
vendored
Normal file
1
dist/css/bootstrap-grid.min.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
465
dist/css/bootstrap-reboot.css
vendored
Normal file
465
dist/css/bootstrap-reboot.css
vendored
Normal file
@ -0,0 +1,465 @@
|
|||||||
|
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||||
|
html {
|
||||||
|
font-family: sans-serif;
|
||||||
|
line-height: 1.15;
|
||||||
|
-ms-text-size-adjust: 100%;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
nav,
|
||||||
|
section {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
margin: 0.67em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
figcaption,
|
||||||
|
figure,
|
||||||
|
main {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 1em 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
-webkit-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
height: 0;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
font-family: monospace, monospace;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
background-color: transparent;
|
||||||
|
-webkit-text-decoration-skip: objects;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:active,
|
||||||
|
a:hover {
|
||||||
|
outline-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: none;
|
||||||
|
text-decoration: underline;
|
||||||
|
text-decoration: underline dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
samp {
|
||||||
|
font-family: monospace, monospace;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
dfn {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
mark {
|
||||||
|
background-color: #ff0;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
audio,
|
||||||
|
video {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
audio:not([controls]) {
|
||||||
|
display: none;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg:not(:root) {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
optgroup,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 100%;
|
||||||
|
line-height: 1.15;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
select {
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
html [type="button"],
|
||||||
|
[type="reset"],
|
||||||
|
[type="submit"] {
|
||||||
|
-webkit-appearance: button;
|
||||||
|
}
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
[type="button"]::-moz-focus-inner,
|
||||||
|
[type="reset"]::-moz-focus-inner,
|
||||||
|
[type="submit"]::-moz-focus-inner {
|
||||||
|
border-style: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:-moz-focusring,
|
||||||
|
[type="button"]:-moz-focusring,
|
||||||
|
[type="reset"]:-moz-focusring,
|
||||||
|
[type="submit"]:-moz-focusring {
|
||||||
|
outline: 1px dotted ButtonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
border: 1px solid #c0c0c0;
|
||||||
|
margin: 0 2px;
|
||||||
|
padding: 0.35em 0.625em 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
legend {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: inherit;
|
||||||
|
display: table;
|
||||||
|
max-width: 100%;
|
||||||
|
padding: 0;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
progress {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="checkbox"],
|
||||||
|
[type="radio"] {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="number"]::-webkit-inner-spin-button,
|
||||||
|
[type="number"]::-webkit-outer-spin-button {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="search"] {
|
||||||
|
-webkit-appearance: textfield;
|
||||||
|
outline-offset: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
[type="search"]::-webkit-search-cancel-button,
|
||||||
|
[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-file-upload-button {
|
||||||
|
-webkit-appearance: button;
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
details,
|
||||||
|
menu {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
template {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
-webkit-box-sizing: inherit;
|
||||||
|
box-sizing: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@-ms-viewport {
|
||||||
|
width: device-width;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-size: 16px;
|
||||||
|
-ms-overflow-style: scrollbar;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #292b2c;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
[tabindex="-1"]:focus {
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
abbr[title],
|
||||||
|
abbr[data-original-title] {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
|
address {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
font-style: normal;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol,
|
||||||
|
ul,
|
||||||
|
dl {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol ol,
|
||||||
|
ul ul,
|
||||||
|
ol ul,
|
||||||
|
ul ol {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dt {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #0275d8;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:focus, a:hover {
|
||||||
|
color: #014c8c;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:focus {
|
||||||
|
outline: 5px auto -webkit-focus-ring-color;
|
||||||
|
outline-offset: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:not([href]):not([tabindex]) {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:not([href]):not([tabindex]):focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
[role="button"] {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
a,
|
||||||
|
area,
|
||||||
|
button,
|
||||||
|
[role="button"],
|
||||||
|
input,
|
||||||
|
label,
|
||||||
|
select,
|
||||||
|
summary,
|
||||||
|
textarea {
|
||||||
|
-ms-touch-action: manipulation;
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
caption {
|
||||||
|
padding-top: 0.75rem;
|
||||||
|
padding-bottom: 0.75rem;
|
||||||
|
color: #636c72;
|
||||||
|
text-align: left;
|
||||||
|
caption-side: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:focus {
|
||||||
|
outline: 1px dotted;
|
||||||
|
outline: 5px auto -webkit-focus-ring-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
button,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="radio"]:disabled,
|
||||||
|
input[type="checkbox"]:disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="date"],
|
||||||
|
input[type="time"],
|
||||||
|
input[type="datetime-local"],
|
||||||
|
input[type="month"] {
|
||||||
|
-webkit-appearance: listbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
min-width: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
legend {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0;
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="search"] {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
output {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
/*# sourceMappingURL=bootstrap-reboot.css.map */
|
1
dist/css/bootstrap-reboot.css.map
vendored
Normal file
1
dist/css/bootstrap-reboot.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/css/bootstrap-reboot.min.css
vendored
Normal file
1
dist/css/bootstrap-reboot.min.css
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}@-ms-viewport{width:device-width}html{font-size:16px;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#292b2c;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{cursor:help}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}a{color:#0275d8;text-decoration:none}a:focus,a:hover{color:#014c8c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle}[role=button]{cursor:pointer}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse;background-color:transparent}caption{padding-top:.75rem;padding-bottom:.75rem;color:#636c72;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,select,textarea{line-height:inherit}input[type=checkbox]:disabled,input[type=radio]:disabled{cursor:not-allowed}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit}input[type=search]{-webkit-appearance:none}output{display:inline-block}[hidden]{display:none!important}/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
1
dist/css/bootstrap-reboot.min.css.map
vendored
Normal file
1
dist/css/bootstrap-reboot.min.css.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../../scss/_normalize.scss","bootstrap-reboot.css","../../scss/_reboot.scss","../../scss/_variables.scss","../../scss/mixins/_hover.scss","../../scss/mixins/_tab-focus.scss"],"names":[],"mappings":"4EAYA,KACE,YAAA,WACA,YAAA,KACA,qBAAA,KACA,yBAAA,KAUF,KACE,OAAA,EAOF,QAAA,MAAA,OAAA,OAAA,IAAA,QAME,QAAA,MAQF,GACE,UAAA,IACA,OAAA,MAAA,EAWF,WAAA,OAAA,KAGE,QAAA,MAOF,OACE,OAAA,IAAA,KAQF,GACE,mBAAA,YAAA,WAAA,YACA,OAAA,EACA,SAAA,QAQF,IACE,YAAA,UAAA,UACA,UAAA,IAWF,EACE,iBAAA,YACA,6BAAA,QAQF,SAAA,QAEE,cAAA,EAQF,YACE,cAAA,KACA,gBAAA,UACA,gBAAA,UAAA,OAOF,EAAA,OAEE,YAAA,QAOF,EAAA,OAEE,YAAA,OAQF,KAAA,IAAA,KAGE,YAAA,UAAA,UACA,UAAA,IAOF,IACE,WAAA,OAOF,KACE,iBAAA,KACA,MAAA,KAOF,MACE,UAAA,IAQF,IAAA,IAEE,UAAA,IACA,YAAA,EACA,SAAA,SACA,eAAA,SAGF,IACE,OAAA,OAGF,IACE,IAAA,MAUF,MAAA,MAEE,QAAA,aAOF,sBACE,QAAA,KACA,OAAA,EAOF,IACE,aAAA,KAOF,eACE,SAAA,OAWF,OAAA,MAAA,SAAA,OAAA,SAKE,YAAA,WACA,UAAA,KACA,YAAA,KACA,OAAA,EAQF,OAAA,MAEE,SAAA,QAQF,OAAA,OAEE,eAAA,KASF,aAAA,cAAA,OAAA,mBAIE,mBAAA,OAOF,gCAAA,+BAAA,gCAAA,yBAIE,aAAA,KACA,QAAA,EAOF,6BAAA,4BAAA,6BAAA,sBAIE,QAAA,IAAA,OAAA,WAOF,SACE,OAAA,IAAA,MAAA,OACA,OAAA,EAAA,IACA,QAAA,MAAA,OAAA,MAUF,OACE,mBAAA,WAAA,WAAA,WACA,MAAA,QACA,QAAA,MACA,UAAA,KACA,QAAA,EACA,YAAA,OAQF,SACE,QAAA,aACA,eAAA,SAOF,SACE,SAAA,KCrKF,gBAAA,aD+KE,mBAAA,WAAA,WAAA,WACA,QAAA,EC1KF,yCAAA,yCDmLE,OAAA,KC9KF,cDuLE,mBAAA,UACA,eAAA,KCnLF,4CAAA,yCD4LE,mBAAA,KAQF,6BACE,mBAAA,OACA,KAAA,QAWF,QAAA,KAEE,QAAA,MAOF,QACE,QAAA,UAUF,OACE,QAAA,aAOF,SACE,QAAA,KCnNF,SD8NE,QAAA,KEtbF,KACE,mBAAA,WAAA,WAAA,WAGF,EAAA,QAAA,SAGE,mBAAA,QAAA,WAAA,QAoBA,cAAgB,MAAA,aAQlB,KAEE,UAAA,KAQA,mBAAA,UAEA,4BAAA,YAGF,KAEE,YAAA,cAAA,UAAA,mBAAA,WAAA,OC6K4H,iBD7K5H,MAAA,WACA,UAAA,KACA,YAAA,IACA,YAAA,IAEA,MAAA,QAEA,iBAAA,KD8LF,sBCrLE,QAAA,YAYF,GAAI,GAAI,GAAI,GAAI,GAAI,GAClB,WAAA,EACA,cAAA,MAOF,EACE,WAAA,EACA,cAAA,KAIF,0BAAA,YAGE,OAAA,KAGF,QACE,cAAA,KACA,WAAA,OACA,YAAA,QAGF,GAAA,GAAA,GAGE,WAAA,EACA,cAAA,KAGF,MAAA,MAAA,MAAA,MAIE,cAAA,EAGF,GACE,YAAA,IAGF,GACE,cAAA,MACA,YAAA,EAGF,WACE,OAAA,EAAA,EAAA,KAQF,EACE,MAAA,QACA,gBAAA,KE9IE,QAAA,QFiJA,MAAA,QACA,gBAAA,UANJ,QG1JE,QAAA,IAAA,KAAA,yBACA,eAAA,KH6KF,8BACE,MAAA,QACA,gBAAA,KElKE,oCAAA,oCFqKA,MAAA,QACA,gBAAA,KANJ,oCAUI,QAAA,EASJ,IAEE,WAAA,EAEA,cAAA,KAEA,SAAA,KAQF,OAGE,OAAA,EAAA,EAAA,KAQF,IAGE,eAAA,OD0IF,cC7HE,OAAA,QAcF,cAAA,EAAA,KAAA,OAAA,MAAA,MAAA,OAAA,QAAA,SASE,iBAAA,aAAA,aAAA,aAQF,MAEE,gBAAA,SAEA,iBAAA,YAGF,QACE,YAAA,OACA,eAAA,OACA,MAAA,QACA,WAAA,KACA,aAAA,OAGF,GAEE,WAAA,KAQF,MAEE,QAAA,aACA,cAAA,MAOF,aACE,QAAA,IAAA,OACA,QAAA,IAAA,KAAA,yBAGF,OAAA,MAAA,OAAA,SAME,YAAA,QAGF,8BAAA,2BAMI,OAAA,YAKJ,iBAAA,iBAAA,2BAAA,kBASE,mBAAA,QAGF,SAEE,OAAA,SAGF,SAME,UAAA,EAEA,QAAA,EACA,OAAA,EACA,OAAA,EAGF,OAEE,QAAA,MACA,MAAA,KACA,QAAA,EACA,cAAA,MACA,UAAA,OACA,YAAA,QAGF,mBAKE,mBAAA,KAIF,OACE,QAAA,aD0EF,SClEE,QAAA"}
|
File diff suppressed because it is too large
Load Diff
2
dist/css/bootstrap.css.map
vendored
2
dist/css/bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
5
dist/css/bootstrap.min.css
vendored
5
dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.min.css.map
vendored
2
dist/css/bootstrap.min.css.map
vendored
File diff suppressed because one or more lines are too long
1543
dist/js/bootstrap.js
1543
dist/js/bootstrap.js
File diff suppressed because it is too large
Load Diff
6
dist/js/bootstrap.min.js
vendored
6
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
29
docs/_data/breakpoints.yml
Normal file
29
docs/_data/breakpoints.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
- breakpoint: xs
|
||||||
|
abbr: ""
|
||||||
|
name: Extra small
|
||||||
|
min-width: 0px
|
||||||
|
container: ""
|
||||||
|
|
||||||
|
- breakpoint: sm
|
||||||
|
abbr: -sm
|
||||||
|
name: Small
|
||||||
|
min-width: 576px
|
||||||
|
container: 540px
|
||||||
|
|
||||||
|
- breakpoint: md
|
||||||
|
abbr: -md
|
||||||
|
name: Medium
|
||||||
|
min-width: 768px
|
||||||
|
container: 720px
|
||||||
|
|
||||||
|
- breakpoint: lg
|
||||||
|
abbr: -lg
|
||||||
|
name: Large
|
||||||
|
min-width: 992px
|
||||||
|
container: 960px
|
||||||
|
|
||||||
|
- breakpoint: xl
|
||||||
|
abbr: -xl
|
||||||
|
name: Extra large
|
||||||
|
min-width: 1200px
|
||||||
|
container: 1140px
|
@ -1,16 +1,16 @@
|
|||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Dynamically generated `<label><input type="file"></label>` causes infinite loop of file dialogs.
|
Visual artifacts in scrollable modal dialogs
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
Edge#8282613
|
Edge#9011176
|
||||||
origin: >
|
origin: >
|
||||||
Bootstrap#20335
|
Bootstrap#20755
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Native browser tooltip for `title` shows on first keyboard focus (in addition to custom tooltip component)
|
Native browser tooltip for `title` shows on first keyboard focus (in addition to custom tooltip component)
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Hovered element still remains in `:hover` state after scrolling away.
|
Hovered element still remains in `:hover` state after scrolling away.
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
When hovering over a `<select>` menu item, the cursor for the element underneath the menu is displayed.
|
When hovering over a `<select>` menu item, the cursor for the element underneath the menu is displayed.
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
CSS `border-radius` sometimes causes lines of bleed-through of the `background-color` of the parent element.
|
CSS `border-radius` sometimes causes lines of bleed-through of the `background-color` of the parent element.
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
`background` of `<tr>` is only applied to first child cell instead of all cells in the row
|
`background` of `<tr>` is only applied to first child cell instead of all cells in the row
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
`@-ms-viewport{width: device-width;}` has side-effect of making scrollbars auto-hide
|
`@-ms-viewport{width: device-width;}` has side-effect of making scrollbars auto-hide
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Background color from lower layer bleeds through transparent border in some cases
|
Background color from lower layer bleeds through transparent border in some cases
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Hovering over descendant SVG element fires `mouseleave` event at ancestor
|
Hovering over descendant SVG element fires `mouseleave` event at ancestor
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -88,6 +88,16 @@
|
|||||||
origin: >
|
origin: >
|
||||||
Bootstrap#19670
|
Bootstrap#19670
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Edge
|
||||||
|
summary: >
|
||||||
|
Active `position: fixed;` `<button>` flickers when scrolling
|
||||||
|
upstream_bug: >
|
||||||
|
Edge#8770398
|
||||||
|
origin: >
|
||||||
|
Bootstrap#20507
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Firefox
|
Firefox
|
||||||
@ -152,11 +162,11 @@
|
|||||||
browser: >
|
browser: >
|
||||||
Firefox
|
Firefox
|
||||||
summary: >
|
summary: >
|
||||||
`min-width: 0` has no effect on `<fieldset>`
|
Layout with floated columns breaks when printing
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
Mozilla#504622
|
Mozilla#1315994
|
||||||
origin: >
|
origin: >
|
||||||
Bootstrap#12359
|
Bootstrap#21092
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
@ -224,7 +234,7 @@
|
|||||||
summary: >
|
summary: >
|
||||||
`table-cell` borders not overlapping despite `margin-right: -1px`
|
`table-cell` borders not overlapping despite `margin-right: -1px`
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
Chromium#534750
|
Chromium#568691
|
||||||
origin: >
|
origin: >
|
||||||
Bootstrap#17438, Bootstrap#14237
|
Bootstrap#17438, Bootstrap#14237
|
||||||
|
|
||||||
@ -258,6 +268,16 @@
|
|||||||
origin: >
|
origin: >
|
||||||
Bootstrap#15298
|
Bootstrap#15298
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Chrome (Linux)
|
||||||
|
summary: >
|
||||||
|
`<select>`'s pop-up menu is blank on some systems.
|
||||||
|
upstream_bug: >
|
||||||
|
Chromium#510079
|
||||||
|
origin: >
|
||||||
|
Bootstrap#21120
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Safari
|
Safari
|
||||||
@ -268,6 +288,16 @@
|
|||||||
origin: >
|
origin: >
|
||||||
Bootstrap#17403
|
Bootstrap#17403
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Safari
|
||||||
|
summary: >
|
||||||
|
Link to container with id and tabindex results in container being ignored by VoiceOver (affects skip links)
|
||||||
|
upstream_bug: >
|
||||||
|
WebKit#163658
|
||||||
|
origin: >
|
||||||
|
Bootstrap#20732
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Safari (OS X)
|
Safari (OS X)
|
||||||
@ -300,16 +330,6 @@
|
|||||||
origin: >
|
origin: >
|
||||||
Bootstrap#14868
|
Bootstrap#14868
|
||||||
|
|
||||||
-
|
|
||||||
browser: >
|
|
||||||
Safari (iPad)
|
|
||||||
summary: >
|
|
||||||
`<select>` menu on iPad causes shifting of hit-testing areas
|
|
||||||
upstream_bug: >
|
|
||||||
WebKit#150079, Safari#23082521
|
|
||||||
origin: >
|
|
||||||
Bootstrap#14975
|
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Safari (iOS)
|
Safari (iOS)
|
||||||
@ -430,6 +450,16 @@
|
|||||||
origin: >
|
origin: >
|
||||||
Bootstrap#12832
|
Bootstrap#12832
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Safari (iOS)
|
||||||
|
summary: >
|
||||||
|
Element which is `position:fixed` disappears after opening a `<select>` menu
|
||||||
|
upstream_bug: >
|
||||||
|
WebKit#162362
|
||||||
|
origin: >
|
||||||
|
Bootstrap#20759
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Safari (iPad Pro)
|
Safari (iPad Pro)
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
|
summary: >
|
||||||
|
Focusable elements should fire focus event / receive :focus styling when they receive Narrator/accessibility focus
|
||||||
|
upstream_bug: >
|
||||||
|
A11yUserVoice#16717318
|
||||||
|
origin: >
|
||||||
|
Bootstrap#20732
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Implement the [`:dir()` pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:dir) from Selectors Level 4
|
Implement the [`:dir()` pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:dir) from Selectors Level 4
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -10,7 +20,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Implement [sticky positioning](http://html5please.com/#position:sticky) from CSS Positioned Layout Level 3
|
Implement [sticky positioning](http://html5please.com/#position:sticky) from CSS Positioned Layout Level 3
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -20,7 +30,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Microsoft Edge
|
Edge
|
||||||
summary: >
|
summary: >
|
||||||
Implement the HTML5 [`<dialog>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog)
|
Implement the HTML5 [`<dialog>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog)
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
@ -28,6 +38,26 @@
|
|||||||
origin: >
|
origin: >
|
||||||
Bootstrap#20175
|
Bootstrap#20175
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Edge
|
||||||
|
summary: >
|
||||||
|
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled
|
||||||
|
upstream_bug: >
|
||||||
|
UserVoice#15939898
|
||||||
|
origin: >
|
||||||
|
Bootstrap#20618
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Edge
|
||||||
|
summary: >
|
||||||
|
Implement the [`of <selector-list>` clause](http://caniuse.com/#feat=css-nth-child-of) of the `:nth-child()` pseudo-class
|
||||||
|
upstream_bug: >
|
||||||
|
UserVoice#15944476
|
||||||
|
origin: >
|
||||||
|
Bootstrap#20143
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Firefox
|
Firefox
|
||||||
@ -58,6 +88,26 @@
|
|||||||
origin: >
|
origin: >
|
||||||
Bootstrap#20175
|
Bootstrap#20175
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Firefox
|
||||||
|
summary: >
|
||||||
|
When virtual focus is on a button or link, fire actual focus on the element, too
|
||||||
|
upstream_bug: >
|
||||||
|
Mozilla#1000082
|
||||||
|
origin: >
|
||||||
|
Bootstrap#20732
|
||||||
|
|
||||||
|
-
|
||||||
|
browser: >
|
||||||
|
Chrome
|
||||||
|
summary: >
|
||||||
|
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled
|
||||||
|
upstream_bug: >
|
||||||
|
Chromium#642487
|
||||||
|
origin: >
|
||||||
|
Chromium#437860
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Chrome
|
Chrome
|
||||||
@ -80,13 +130,13 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
Chrome
|
Safari
|
||||||
summary: >
|
summary: >
|
||||||
Implement [sticky positioning](http://html5please.com/#position:sticky) from CSS Positioned Layout Level 3
|
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled
|
||||||
upstream_bug: >
|
upstream_bug: >
|
||||||
Chromium#231752
|
WebKit#161535
|
||||||
origin: >
|
origin: >
|
||||||
Bootstrap#17021
|
Bootstrap#20618
|
||||||
|
|
||||||
-
|
-
|
||||||
browser: >
|
browser: >
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
- title: Browsers & devices
|
- title: Browsers & devices
|
||||||
- title: JavaScript
|
- title: JavaScript
|
||||||
- title: Options
|
- title: Options
|
||||||
- title: Flexbox
|
|
||||||
- title: Build tools
|
- title: Build tools
|
||||||
- title: Best practices
|
- title: Best practices
|
||||||
- title: Accessibility
|
- title: Accessibility
|
||||||
@ -15,7 +14,6 @@
|
|||||||
pages:
|
pages:
|
||||||
- title: Overview
|
- title: Overview
|
||||||
- title: Grid
|
- title: Grid
|
||||||
- title: Flexbox grid
|
|
||||||
- title: Media object
|
- title: Media object
|
||||||
- title: Responsive utilities
|
- title: Responsive utilities
|
||||||
|
|
||||||
@ -31,6 +29,7 @@
|
|||||||
- title: Components
|
- title: Components
|
||||||
pages:
|
pages:
|
||||||
- title: Alerts
|
- title: Alerts
|
||||||
|
- title: Badge
|
||||||
- title: Breadcrumb
|
- title: Breadcrumb
|
||||||
- title: Buttons
|
- title: Buttons
|
||||||
- title: Button group
|
- title: Button group
|
||||||
@ -49,9 +48,24 @@
|
|||||||
- title: Popovers
|
- title: Popovers
|
||||||
- title: Progress
|
- title: Progress
|
||||||
- title: Scrollspy
|
- title: Scrollspy
|
||||||
- title: Tag
|
|
||||||
- title: Tooltips
|
- title: Tooltips
|
||||||
|
|
||||||
- title: Utilities
|
- title: Utilities
|
||||||
|
pages:
|
||||||
|
- title: Borders
|
||||||
|
- title: Clearfix
|
||||||
|
- title: Close icon
|
||||||
|
- title: Colors
|
||||||
|
- title: Flexbox
|
||||||
|
- title: Display property
|
||||||
|
- title: Image replacement
|
||||||
|
- title: Invisible content
|
||||||
|
- title: Responsive helpers
|
||||||
|
- title: Screenreaders
|
||||||
|
- title: Sizing and positioning
|
||||||
|
- title: Spacing
|
||||||
|
- title: Typography
|
||||||
|
- title: Vertical align
|
||||||
|
|
||||||
# - title: Extend
|
# - title: Extend
|
||||||
# pages:
|
# pages:
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
- name: Lyft
|
- name: Lyft
|
||||||
url: https://www.lyft.com
|
url: https://www.lyft.com
|
||||||
expo_url: http://expo.getbootstrap.com/2014/10/29/lyft/
|
expo_url: https://expo.getbootstrap.com/2014/10/29/lyft/
|
||||||
img: lyft
|
img: lyft
|
||||||
|
|
||||||
- name: Vogue
|
- name: Vogue
|
||||||
url: http://www.vogue.com
|
url: http://www.vogue.com
|
||||||
expo_url: http://expo.getbootstrap.com/2014/09/30/vogue/
|
expo_url: https://expo.getbootstrap.com/2014/09/30/vogue/
|
||||||
img: vogue
|
img: vogue
|
||||||
|
|
||||||
- name: Riot Design
|
- name: Riot Design
|
||||||
url: http://riotdesign.eu/en/
|
url: http://riotdesign.eu/en/
|
||||||
expo_url: http://expo.getbootstrap.com/2014/03/13/riot-design/
|
expo_url: https://expo.getbootstrap.com/2014/03/13/riot-design/
|
||||||
img: riot
|
img: riot
|
||||||
|
|
||||||
- name: Newsweek
|
- name: Newsweek
|
||||||
url: http://www.newsweek.com/
|
url: http://www.newsweek.com/
|
||||||
expo_url: http://expo.getbootstrap.com/2014/02/12/newsweek/
|
expo_url: https://expo.getbootstrap.com/2014/02/12/newsweek/
|
||||||
img: newsweek
|
img: newsweek
|
||||||
|
@ -12,3 +12,8 @@
|
|||||||
code: ja
|
code: ja
|
||||||
description: Bootstrap 4 日本語リファレンス
|
description: Bootstrap 4 日本語リファレンス
|
||||||
url: http://bootstrap4.jp/
|
url: http://bootstrap4.jp/
|
||||||
|
|
||||||
|
- name: Brazilian Portuguese
|
||||||
|
code: pt-BR
|
||||||
|
description: Bootstrap 4 Português do Brasil
|
||||||
|
url: https://bootstrapbrasil.github.io/v4/
|
||||||
|
@ -1,23 +1,20 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="description" content="Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">
|
|
||||||
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
|
||||||
|
|
||||||
<title>
|
<title>
|
||||||
{% if page.layout == "home" %}
|
{% if page.title %}
|
||||||
{{ page.title }}
|
{{ page.title }} · {{ site.title }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ page.title }} · Bootstrap
|
{{ site.title }} · {{ site.description }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
|
{% include social.html %}
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
<!-- Bootstrap core CSS -->
|
||||||
{% if site.github %}
|
{% if site.github %}
|
||||||
<link href="{{ site.baseurl }}/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="{{ site.baseurl }}/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
{% if page.title == "Flexbox grid system" %}
|
|
||||||
<link href="{{ site.baseurl }}/assets/css/docs-flexbox.min.css" rel="stylesheet">
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<link href="{{ site.baseurl }}/dist/css/bootstrap.css" rel="stylesheet">
|
<link href="{{ site.baseurl }}/dist/css/bootstrap.css" rel="stylesheet">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -33,7 +30,7 @@
|
|||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||||
ga('create', 'UA-146052-10', 'getbootstrap.com');
|
ga('create', 'UA-146052-10', 'getbootstrap.com');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,34 +1,31 @@
|
|||||||
<nav class="bd-links" id="docsNavbarContent">
|
<nav class="bd-links" id="docsNavbarContent">
|
||||||
|
{% assign page_slug = page.url | split: '/' | last %}
|
||||||
{% for group in site.data.nav %}
|
{% for group in site.data.nav %}
|
||||||
{% assign link = group.pages | first %}
|
{% assign link = group.pages | first %}
|
||||||
{% assign slug = group.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' %}
|
{% assign link_slug = link.title | slugify %}
|
||||||
|
{% assign group_slug = group.title | slugify %}
|
||||||
{% assign active = nil %}
|
{% assign active = nil %}
|
||||||
|
|
||||||
{% if page.url contains slug %}
|
{% if page.group == group_slug %}
|
||||||
{% assign active = 'active' %}
|
{% assign active = 'active' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="bd-toc-item {{ active }}">
|
<div class="bd-toc-item {{ active }}">
|
||||||
{% if slug == "examples" %}
|
<a class="bd-toc-link" href="{{ site.baseurl }}/{{ group_slug }}/{{ link_slug }}{% if link_slug %}/{% endif %}">
|
||||||
<a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/">
|
|
||||||
{% else %}
|
|
||||||
<a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ link.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' }}">
|
|
||||||
{% endif %}
|
|
||||||
{{ group.title }}
|
{{ group.title }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<ul class="nav bd-sidenav">
|
<ul class="nav bd-sidenav">
|
||||||
{% for doc in group.pages %}
|
{% for doc in group.pages %}
|
||||||
{% assign slug = doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' %}
|
{% assign doc_slug = doc.title | slugify %}
|
||||||
{% capture slug %}/{{ slug }}{% endcapture %}
|
|
||||||
{% assign active = nil %}
|
{% assign active = nil %}
|
||||||
|
|
||||||
{% if page.url contains slug %}
|
{% if page.group == group_slug and page_slug == doc_slug %}
|
||||||
{% assign active = 'active bd-sidenav-active' %}
|
{% assign active = 'active bd-sidenav-active' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<li class="{{ active }}">
|
<li class="{{ active }}">
|
||||||
<a href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' }}">
|
<a href="{{ site.baseurl }}/{{ group_slug }}/{{ doc_slug }}/">
|
||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<header class="navbar navbar-light navbar-static-top bd-navbar">
|
<header class="navbar navbar-light navbar-toggleable-md bd-navbar">
|
||||||
<div class="container">
|
<nav class="container w-100">
|
||||||
{% comment %}
|
{% comment %}
|
||||||
<nav class="nav navbar-nav pull-xs-right">
|
<nav class="nav navbar-nav float-right">
|
||||||
<div class="nav-item dropdown">
|
<div class="nav-item dropdown">
|
||||||
<a class="nav-item nav-link dropdown-toggle" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<a class="nav-item nav-link dropdown-toggle" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
v{{ site.current_version }}
|
v{{ site.current_version }}
|
||||||
@ -25,42 +25,41 @@
|
|||||||
</nav>
|
</nav>
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
<nav>
|
<div class="d-flex justify-content-between hidden-lg-up">
|
||||||
<div class="clearfix">
|
<a class="navbar-brand" href="{{ site.baseurl }}/">
|
||||||
<button class="navbar-toggler pull-xs-right hidden-sm-up" type="button" data-toggle="collapse" data-target="#bd-main-nav" aria-controls="bd-main-nav" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
☰
|
|
||||||
</button>
|
|
||||||
<a class="navbar-brand hidden-sm-up" href="{{ site.baseurl }}/">
|
|
||||||
Bootstrap
|
Bootstrap
|
||||||
</a>
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bd-main-nav" aria-controls="bd-main-nav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse navbar-toggleable-xs" id="bd-main-nav">
|
|
||||||
|
<div class="collapse navbar-collapse" id="bd-main-nav">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item {% if page.layout == "home" %}active{% endif %}">
|
||||||
<a class="nav-item nav-link {% if page.layout == "home" %}active{% endif %}" href="{{ site.baseurl }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Bootstrap</a>
|
<a class="nav-link" href="{{ site.baseurl }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Bootstrap</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item {% if page.layout == "docs" %}active{% endif %}">
|
||||||
|
<a class="nav-link" href="{{ site.baseurl }}/getting-started/introduction/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Docs');">Documentation</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item {% if page.title == "Examples" %}active{% endif %}">
|
||||||
|
<a class="nav-link" href="{{ site.baseurl }}/examples/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Examples');">Examples</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-item nav-link {% if page.layout == "docs" %}active{% endif %}" href="{{ site.baseurl }}/getting-started/introduction/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Docs');">Documentation</a>
|
<a class="nav-link" href="{{ site.themes }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');">Themes</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-item nav-link {% if page.title == "Examples" %}active{% endif %}" href="{{ site.baseurl }}/examples/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Examples');">Examples</a>
|
<a class="nav-link" href="{{ site.expo }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Expo');">Expo</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-item nav-link" href="{{ site.themes }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');">Themes</a>
|
<a class="nav-link" href="{{ site.blog }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Blog');">Blog</a>
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-item nav-link" href="{{ site.expo }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Expo');">Expo</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-item nav-link" href="{{ site.blog }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Blog');">Blog</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<form class="bd-search hidden-sm-down pull-md-right">
|
<form class="bd-search">
|
||||||
<input type="text" class="form-control" id="search-input" placeholder="Search..." autocomplete="off">
|
<input type="text" class="form-control" id="search-input" placeholder="Search..." autocomplete="off">
|
||||||
<div class="dropdown-menu bd-search-results" id="search-results"></div>
|
<div class="dropdown-menu bd-search-results" id="search-results"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
|
@ -18,6 +18,11 @@
|
|||||||
<p class="lead">
|
<p class="lead">
|
||||||
Over a dozen reusable components built to provide buttons, dropdowns, input groups, navigation, alerts, and much more.
|
Over a dozen reusable components built to provide buttons, dropdowns, input groups, navigation, alerts, and much more.
|
||||||
</p>
|
</p>
|
||||||
|
{% elsif page.group == "utilities" %}
|
||||||
|
<h1>Utilities</h1>
|
||||||
|
<p class="lead">
|
||||||
|
Bootstrap includes dozens of utilities—classes with a single purpose to reduce the frequency of highly repetitive declarations.
|
||||||
|
</p>
|
||||||
{% elsif page.group == "javascript" %}
|
{% elsif page.group == "javascript" %}
|
||||||
<h1>JavaScript plugins</h1>
|
<h1>JavaScript plugins</h1>
|
||||||
<p class="lead">
|
<p class="lead">
|
||||||
|
31
docs/_includes/social.html
Normal file
31
docs/_includes/social.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<!-- Twitter -->
|
||||||
|
<meta name="twitter:site" content="@{{ site.twitter }}">
|
||||||
|
<meta name="twitter:creator" content="@{{ site.twitter }}">
|
||||||
|
|
||||||
|
{% if page.title %}
|
||||||
|
<meta name="twitter:card" content="summary">
|
||||||
|
<meta name="twitter:title" content="{{ page.title }}">
|
||||||
|
<meta name="twitter:description" content="{{ page.description }}">
|
||||||
|
<meta name="twitter:image" content="{{ site.url }}{{ site.social_logo_path }}">
|
||||||
|
{% else %}
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:title" content="{{ site.title }}">
|
||||||
|
<meta name="twitter:description" content="{{ site.description }}">
|
||||||
|
<meta name="twitter:image" content="{{ site.url }}{{ site.social_image_path }}">
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Facebook -->
|
||||||
|
{% if page.title %}
|
||||||
|
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
|
||||||
|
<meta property="og:title" content="{{ page.title }}">
|
||||||
|
<meta property="og:description" content="{{ page.description }}">
|
||||||
|
{% else %}
|
||||||
|
<meta property="og:url" content="{{ site.url }}">
|
||||||
|
<meta property="og:title" content="{{ site.title }}">
|
||||||
|
<meta property="og:description" content="{{ site.description }}">
|
||||||
|
{% endif %}
|
||||||
|
<meta property="og:image" content="{{ site.url }}{{ site.social_image_path }}">
|
||||||
|
|
||||||
|
<!-- Meta -->
|
||||||
|
<meta name="description" content="{{ site.description }}">
|
||||||
|
<meta name="author" content="{{ site.authors }}">
|
@ -21,10 +21,10 @@
|
|||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-3 bd-sidebar">
|
<div class="col-12 col-md-3 bd-sidebar">
|
||||||
{% include nav-docs.html %}
|
{% include nav-docs.html %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-md-9 bd-content">
|
<div class="col-12 col-md-9 bd-content">
|
||||||
<h1 class="bd-title" id="content">{{ page.title }}</h1>
|
<h1 class="bd-title" id="content">{{ page.title }}</h1>
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="bd-pageheader text-xs-center text-sm-left">
|
<div class="bd-pageheader text-center text-sm-left">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
<p class="lead">
|
<p class="lead">
|
||||||
|
@ -4,6 +4,7 @@ module Jekyll
|
|||||||
upstream_map = {
|
upstream_map = {
|
||||||
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
|
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
|
||||||
"Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"],
|
"Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"],
|
||||||
|
"A11yUserVoice" => ["https://microsoftaccessibility.uservoice.com/forums/307429-microsoft-accessibility-feedback/suggestions/", "Microsoft A11y UserVoice idea"],
|
||||||
"UserVoice" => ["https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/", "Edge UserVoice idea"],
|
"UserVoice" => ["https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/", "Edge UserVoice idea"],
|
||||||
"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"],
|
||||||
|
@ -62,11 +62,21 @@ eos
|
|||||||
code = code.gsub(/data-src="holder.js.+?"/, 'src="..."')
|
code = code.gsub(/data-src="holder.js.+?"/, 'src="..."')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def remove_example_classes(code)
|
||||||
|
# Find `bd-` classes and remove them from the highlighted code. Because of how this regex works, it will also
|
||||||
|
# remove classes that are after the `bd-` class. While this is a bug, I left it because it can be helpful too.
|
||||||
|
# To fix the bug, replace `(?=")` with `(?=("|\ ))`.
|
||||||
|
code = code.gsub(/(?!class=".)\ *?bd-.+?(?=")/, "")
|
||||||
|
# Find empty class attributes after the previous regex and remove those too.
|
||||||
|
code = code.gsub(/\ class=""/, "")
|
||||||
|
end
|
||||||
|
|
||||||
def render_rouge(code)
|
def render_rouge(code)
|
||||||
require 'rouge'
|
require 'rouge'
|
||||||
formatter = Rouge::Formatters::HTML.new(line_numbers: @options[:linenos], wrap: false)
|
formatter = Rouge::Formatters::HTML.new(line_numbers: @options[:linenos], wrap: false)
|
||||||
lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
|
lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
|
||||||
code = remove_holderjs(code)
|
code = remove_holderjs(code)
|
||||||
|
code = remove_example_classes(code)
|
||||||
code = formatter.format(lexer.lex(code))
|
code = formatter.format(lexer.lex(code))
|
||||||
"<div class=\"highlight\"><pre>#{code}</pre></div>"
|
"<div class=\"highlight\"><pre>#{code}</pre></div>"
|
||||||
end
|
end
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Brand guidelines
|
title: Brand guidelines
|
||||||
|
description: Documentation and examples for Bootstrap's logo and brand usage guidelines.
|
||||||
group: about
|
group: about
|
||||||
---
|
---
|
||||||
|
|
||||||
Have a need for Bootstrap's brand resources? Great! We have only a few guidelines we follow, and in turn ask you to follow as well. These guidelines were inspired by MailChimp's [Brand Assets](http://mailchimp.com/about/brand-assets/).
|
Have a need for Bootstrap's brand resources? Great! We have only a few guidelines we follow, and in turn ask you to follow as well. These guidelines were inspired by MailChimp's [Brand Assets](https://mailchimp.com/about/brand-assets/).
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
* Will be replaced with the ToC, excluding the "Contents" header
|
||||||
|
{:toc}
|
||||||
|
|
||||||
## Mark and logo
|
## Mark and logo
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: History
|
title: History
|
||||||
|
description: A brief overview of the history of Bootstrap.
|
||||||
group: about
|
group: about
|
||||||
redirect_from: "/about/"
|
redirect_from: "/about/"
|
||||||
---
|
---
|
||||||
@ -9,4 +10,4 @@ Originally created by a designer and a developer at Twitter, Bootstrap has becom
|
|||||||
|
|
||||||
Bootstrap was created at Twitter in mid-2010 by [@mdo](https://twitter.com/mdo) and [@fat](https://twitter.com/fat). Prior to being an open-sourced framework, Bootstrap was known as _Twitter Blueprint_. A few months into development, Twitter held its [first Hack Week](https://blog.twitter.com/2010/hack-week) and the project exploded as developers of all skill levels jumped in without any external guidance. It served as the style guide for internal tools development at the company for over a year before its public release, and continues to do so today.
|
Bootstrap was created at Twitter in mid-2010 by [@mdo](https://twitter.com/mdo) and [@fat](https://twitter.com/fat). Prior to being an open-sourced framework, Bootstrap was known as _Twitter Blueprint_. A few months into development, Twitter held its [first Hack Week](https://blog.twitter.com/2010/hack-week) and the project exploded as developers of all skill levels jumped in without any external guidance. It served as the style guide for internal tools development at the company for over a year before its public release, and continues to do so today.
|
||||||
|
|
||||||
Originally [released](https://blog.twitter.com/2011/bootstrap-twitter) on [<time datetime="2011-08-19 11:25">Friday, August 19, 2011</time>](https://twitter.com/mdo/statuses/104620039650557952), we've since had over [twenty releases](https://github.com/twbs/bootstrap/releases), including two major rewrites with v2 and v3. With Bootstrap 2, we added responsive functionality to the entire framework as an optional stylesheet. Building on that with Bootstrap 3, we rewrote the library once more to make it responsive by default with a mobile first approach.
|
Originally [released](https://blog.twitter.com/2011/bootstrap-from-twitter) on [<time datetime="2011-08-19 11:25">Friday, August 19, 2011</time>](https://twitter.com/mdo/statuses/104620039650557952), we've since had over [twenty releases](https://github.com/twbs/bootstrap/releases), including two major rewrites with v2 and v3. With Bootstrap 2, we added responsive functionality to the entire framework as an optional stylesheet. Building on that with Bootstrap 3, we rewrote the library once more to make it responsive by default with a mobile first approach.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: License FAQs
|
title: License FAQs
|
||||||
|
description: Commonly asked questions about Bootstrap's open source license.
|
||||||
group: about
|
group: about
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Team
|
title: Team
|
||||||
|
description: An overview of the founding team and core contributors to Bootstrap.
|
||||||
group: about
|
group: about
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Translations
|
title: Translations
|
||||||
|
description: Links to community-translated Bootstrap documentation sites.
|
||||||
group: about
|
group: about
|
||||||
---
|
---
|
||||||
|
|
||||||
|
BIN
docs/assets/brand/bootstrap-social-logo.png
Normal file
BIN
docs/assets/brand/bootstrap-social-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
BIN
docs/assets/brand/bootstrap-social.png
Normal file
BIN
docs/assets/brand/bootstrap-social.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 330 KiB |
1240
docs/assets/css/docs-flexbox.min.css
vendored
1240
docs/assets/css/docs-flexbox.min.css
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
1536
docs/assets/css/docs.min.css
vendored
1536
docs/assets/css/docs.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
20
docs/assets/js/docs.min.js
vendored
20
docs/assets/js/docs.min.js
vendored
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// See the Getting Started docs for more information:
|
// See the Getting Started docs for more information:
|
||||||
// http://getbootstrap.com/getting-started/#support-ie10-width
|
// https://getbootstrap.com/getting-started/#support-ie10-width
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// ++++++++++++++++++++++++++++++++++++++++++
|
// ++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* JavaScript for Bootstrap's docs (http://getbootstrap.com)
|
* JavaScript for Bootstrap's docs (https://getbootstrap.com)
|
||||||
* Copyright 2011-2016 The Bootstrap Authors
|
* Copyright 2011-2016 The Bootstrap Authors
|
||||||
* Copyright 2011-2016 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||||
@ -33,7 +33,7 @@
|
|||||||
$('.bd-example-indeterminate [type="checkbox"]').prop('indeterminate', true)
|
$('.bd-example-indeterminate [type="checkbox"]').prop('indeterminate', true)
|
||||||
|
|
||||||
// Disable empty links in docs examples
|
// Disable empty links in docs examples
|
||||||
$('.bd-example [href="#"]').click(function (e) {
|
$('.bd-content [href="#"]').click(function (e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -73,7 +73,8 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
clipboard.on('error', function (e) {
|
clipboard.on('error', function (e) {
|
||||||
var fallbackMsg = /Mac/i.test(navigator.userAgent) ? 'Press \u2318 to copy' : 'Press Ctrl-C to copy'
|
var modifierKey = /Mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-'
|
||||||
|
var fallbackMsg = 'Press ' + modifierKey + 'C to copy'
|
||||||
|
|
||||||
$(e.trigger)
|
$(e.trigger)
|
||||||
.attr('title', fallbackMsg)
|
.attr('title', fallbackMsg)
|
||||||
|
4
docs/assets/js/vendor/anchor.min.js
vendored
4
docs/assets/js/vendor/anchor.min.js
vendored
File diff suppressed because one or more lines are too long
4
docs/assets/js/vendor/clipboard.min.js
vendored
4
docs/assets/js/vendor/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
6
docs/assets/js/vendor/holder.min.js
vendored
6
docs/assets/js/vendor/holder.min.js
vendored
File diff suppressed because one or more lines are too long
2
docs/assets/js/vendor/jekyll-search.min.js
vendored
2
docs/assets/js/vendor/jekyll-search.min.js
vendored
File diff suppressed because one or more lines are too long
8
docs/assets/js/vendor/jquery.min.js
vendored
8
docs/assets/js/vendor/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
2
docs/assets/js/vendor/tether.min.js
vendored
2
docs/assets/js/vendor/tether.min.js
vendored
File diff suppressed because one or more lines are too long
@ -19,9 +19,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex-items-xs-top,
|
.flex-items-top,
|
||||||
.flex-items-xs-middle,
|
.flex-items-middle,
|
||||||
.flex-items-xs-bottom {
|
.flex-items-bottom {
|
||||||
min-height: 6rem;
|
min-height: 6rem;
|
||||||
background-color: rgba(255,0,0,.1);
|
background-color: rgba(255,0,0,.1);
|
||||||
}
|
}
|
||||||
@ -32,6 +32,11 @@
|
|||||||
background-color: rgba(255,0,0,.1);
|
background-color: rgba(255,0,0,.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bd-highlight {
|
||||||
|
background-color: rgba($bd-purple, .15);
|
||||||
|
border: 1px solid rgba($bd-purple, .15);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Container illustrations
|
// Container illustrations
|
||||||
@ -100,9 +105,13 @@
|
|||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Undo width of container
|
.pos-f-t {
|
||||||
.container {
|
position: relative;
|
||||||
width: auto;
|
margin: -1rem;
|
||||||
|
|
||||||
|
@include media-breakpoint-up(sm) {
|
||||||
|
margin: -1.5rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .form-control {
|
> .form-control {
|
||||||
@ -111,11 +120,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Card examples should be horizontal
|
|
||||||
> .card {
|
|
||||||
max-width: 20rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .nav + .nav,
|
> .nav + .nav,
|
||||||
> .alert + .alert,
|
> .alert + .alert,
|
||||||
> .navbar + .navbar,
|
> .navbar + .navbar,
|
||||||
@ -226,9 +230,9 @@
|
|||||||
|
|
||||||
// Example modals
|
// Example modals
|
||||||
.bd-example-modal {
|
.bd-example-modal {
|
||||||
background-color: #f5f5f5;
|
background-color: #fafafa;
|
||||||
}
|
|
||||||
.bd-example-modal .modal {
|
.modal {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: auto;
|
top: auto;
|
||||||
right: auto;
|
right: auto;
|
||||||
@ -237,11 +241,13 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.bd-example-modal .modal-dialog {
|
|
||||||
|
.modal-dialog {
|
||||||
left: auto;
|
left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Example dropdowns
|
// Example dropdowns
|
||||||
.bd-example > .dropdown > .dropdown-toggle {
|
.bd-example > .dropdown > .dropdown-toggle {
|
||||||
@ -308,7 +314,8 @@
|
|||||||
.bg-info,
|
.bg-info,
|
||||||
.bg-warning,
|
.bg-warning,
|
||||||
.bg-danger,
|
.bg-danger,
|
||||||
.bg-inverse {
|
.bg-inverse,
|
||||||
|
.bg-faded {
|
||||||
&:not(.navbar) {
|
&:not(.navbar) {
|
||||||
padding: .5rem;
|
padding: .5rem;
|
||||||
margin-top: .5rem;
|
margin-top: .5rem;
|
||||||
@ -317,6 +324,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bd-example-border-utils {
|
||||||
|
[class^="border-"] {
|
||||||
|
display: inline-block;
|
||||||
|
width: 6rem;
|
||||||
|
height: 6rem;
|
||||||
|
margin: .25rem;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Code snippets
|
// Code snippets
|
||||||
@ -324,7 +341,7 @@
|
|||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
margin: 1rem (-$grid-gutter-width / 2);
|
margin: 1rem (-$grid-gutter-width-base / 2);
|
||||||
background-color: #f7f7f9;
|
background-color: #f7f7f9;
|
||||||
|
|
||||||
@include media-breakpoint-up(sm) {
|
@include media-breakpoint-up(sm) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
margin-right: -1px;
|
margin-right: -1px;
|
||||||
margin-left: -1px;
|
margin-left: -1px;
|
||||||
}
|
}
|
||||||
.bd-featured-sites .col-xs-6 {
|
.bd-featured-sites .col-6 {
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
}
|
}
|
||||||
.bd-featured-sites .img-fluid {
|
.bd-featured-sites .img-fluid {
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
|
|
||||||
@include media-breakpoint-up(md) {
|
@include media-breakpoint-up(md) {
|
||||||
.col-sm-6:first-child {
|
.col-sm-6:first-child {
|
||||||
padding-right: ($grid-gutter-width * 1.5);
|
padding-right: ($grid-gutter-width-base * 1.5);
|
||||||
};
|
};
|
||||||
.col-sm-6:last-child {
|
.col-sm-6:last-child {
|
||||||
padding-left: ($grid-gutter-width * 1.5);
|
padding-left: ($grid-gutter-width-base * 1.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
.bd-masthead {
|
.bd-masthead {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 3rem ($grid-gutter-width / 2) 2rem;
|
padding: 3rem ($grid-gutter-width-base / 2) 2rem;
|
||||||
color: $bd-purple-light;
|
color: $bd-purple-light;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-image: linear-gradient(135deg, darken($bd-purple, 20%), $bd-purple, lighten(saturate($bd-purple, 5%), 15%));
|
background-image: linear-gradient(135deg, darken($bd-purple, 20%), $bd-purple, lighten(saturate($bd-purple, 5%), 15%));
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
.bd-navbar {
|
.bd-navbar {
|
||||||
padding-right: 0;
|
// padding-right: 0;
|
||||||
padding-left: 0;
|
// padding-left: 0;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
border-bottom: 1px solid rgba(0,0,0,.1);
|
border-bottom: 1px solid rgba(0,0,0,.1);
|
||||||
box-shadow: 0 6px 12px rgba(0,0,0,.05);
|
box-shadow: 0 6px 12px rgba(0,0,0,.05);
|
||||||
@ -30,14 +30,4 @@
|
|||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-down(sm) {
|
|
||||||
.nav-link {
|
|
||||||
float: none;
|
|
||||||
|
|
||||||
+ .nav-link {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// scss-lint:disable ImportantRule
|
// scss-lint:disable ImportantRule
|
||||||
|
|
||||||
.bd-pageheader {
|
.bd-pageheader {
|
||||||
padding: 2rem ($grid-gutter-width / 2);
|
padding: 2rem ($grid-gutter-width-base / 2);
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
color: $bd-purple-light;
|
color: $bd-purple-light;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
.responsive-utilities-test {
|
.responsive-utilities-test {
|
||||||
margin-top: .25rem;
|
margin-top: .25rem;
|
||||||
}
|
}
|
||||||
.responsive-utilities-test .col-xs-6 {
|
.responsive-utilities-test .col-6 {
|
||||||
margin-top: .5rem;
|
margin-top: .5rem;
|
||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@
|
|||||||
}
|
}
|
||||||
.visible-on,
|
.visible-on,
|
||||||
.hidden-on {
|
.hidden-on {
|
||||||
.col-xs-6 {
|
.col-6 {
|
||||||
> .not-visible {
|
> .not-visible {
|
||||||
color: #999;
|
color: #999;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
@ -59,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
.visible-on,
|
.visible-on,
|
||||||
.hidden-on {
|
.hidden-on {
|
||||||
.col-xs-6 {
|
.col-6 {
|
||||||
.visible {
|
.visible {
|
||||||
color: #468847;
|
color: #468847;
|
||||||
background-color: #dff0d8;
|
background-color: #dff0d8;
|
||||||
|
@ -61,3 +61,6 @@
|
|||||||
.css .o,
|
.css .o,
|
||||||
.css .o + .nt,
|
.css .o + .nt,
|
||||||
.css .nt + .nt { color: #999; }
|
.css .nt + .nt { color: #999; }
|
||||||
|
|
||||||
|
.language-bash::before { color: #009; content: "$ "; user-select: none; }
|
||||||
|
.language-powershell::before { color: #009; content: "PM> "; user-select: none; }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Bootstrap Docs (http://getbootstrap.com)
|
* Bootstrap Docs (https://getbootstrap.com)
|
||||||
* Copyright 2011-2016 The Bootstrap Authors
|
* Copyright 2011-2016 The Bootstrap Authors
|
||||||
* Copyright 2011-2016 Twitter, Inc.
|
* Copyright 2011-2016 Twitter, Inc.
|
||||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
// Bootstrap flexbox grid for our docs page
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Variables
|
|
||||||
//
|
|
||||||
|
|
||||||
@import "custom";
|
|
||||||
@import "variables";
|
|
||||||
|
|
||||||
// Override for flexbox mode
|
|
||||||
$enable-flex: true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Grid mixins
|
|
||||||
//
|
|
||||||
|
|
||||||
@import "mixins/clearfix";
|
|
||||||
@import "mixins/breakpoints";
|
|
||||||
@import "mixins/grid-framework";
|
|
||||||
@import "mixins/grid";
|
|
||||||
|
|
||||||
//
|
|
||||||
// Utilities for flex alignment
|
|
||||||
//
|
|
||||||
|
|
||||||
@import "utilities/flex";
|
|
||||||
|
|
||||||
//
|
|
||||||
// Generate the grid class
|
|
||||||
//
|
|
||||||
|
|
||||||
@import "grid";
|
|
@ -8,8 +8,6 @@ Bootstrap currently works around several outstanding browser bugs in major brows
|
|||||||
|
|
||||||
We publicly list browser bugs that are impacting us here, in the hopes of expediting the process of fixing them. For information on Bootstrap's browser compatibility, [see our browser compatibility docs]({{ site.baseurl }}/getting-started/browsers-devices/#supported-browsers).
|
We publicly list browser bugs that are impacting us here, in the hopes of expediting the process of fixing them. For information on Bootstrap's browser compatibility, [see our browser compatibility docs]({{ site.baseurl }}/getting-started/browsers-devices/#supported-browsers).
|
||||||
|
|
||||||
Also see [jQuery's browser bug workarounds](https://docs.google.com/document/d/1LPaPA30bLUB_publLIMF0RlhdnPx_ePXm7oW02iiT6o).
|
|
||||||
|
|
||||||
See also:
|
See also:
|
||||||
|
|
||||||
* [Chromium issue 536263: [meta] Issues affecting Bootstrap](https://code.google.com/p/chromium/issues/detail?id=536263)
|
* [Chromium issue 536263: [meta] Issues affecting Bootstrap](https://code.google.com/p/chromium/issues/detail?id=536263)
|
||||||
@ -32,7 +30,7 @@ See also:
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ bug.browser }}</td>
|
<td>{{ bug.browser }}</td>
|
||||||
<td>{{ bug.summary | markdownify | bugify }}</td>
|
<td>{{ bug.summary | markdownify | bugify }}</td>
|
||||||
<td>{{ bug.upstream_bug | bugify }}</td>
|
<td>{{ bug.upstream_bug | bugify }}</td>
|
||||||
<td>{{ bug.origin | bugify }}</td>
|
<td>{{ bug.origin | bugify }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Alerts
|
title: Alerts
|
||||||
|
description: Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ Alerts can also contain additional HTML elements like headings and paragraphs.
|
|||||||
<div class="alert alert-success" role="alert">
|
<div class="alert alert-success" role="alert">
|
||||||
<h4 class="alert-heading">Well done!</h4>
|
<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>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 margin utilities to keep things nice and tidy.</p>
|
<p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
@ -72,12 +73,12 @@ Using the alert JavaScript plugin, it's possible to dismiss any alert inline. He
|
|||||||
- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript.
|
- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript.
|
||||||
- Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button.
|
- Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button.
|
||||||
- On the dismiss button, add the `data-dismiss="alert"` attribute, which triggers the JavaScript functionality. Be sure to use the `<button>` element with it for proper behavior across all devices.
|
- On the dismiss button, add the `data-dismiss="alert"` attribute, which triggers the JavaScript functionality. Be sure to use the `<button>` element with it for proper behavior across all devices.
|
||||||
- To animate alerts when dismissing them, be sure to add the `.fade` and `.in` classes.
|
- To animate alerts when dismissing them, be sure to add the `.fade` and `.show` classes.
|
||||||
|
|
||||||
You can see this in action with a live demo:
|
You can see this in action with a live demo:
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="alert alert-warning alert-dismissible fade in" role="alert">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
@ -110,7 +111,7 @@ Note that closing an alert will remove it from the DOM.
|
|||||||
| Method | Description |
|
| Method | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `$().alert()` | Makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. (Not necessary when using the data-api's auto-initialization.) |
|
| `$().alert()` | Makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. (Not necessary when using the data-api's auto-initialization.) |
|
||||||
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.in` classes are present on the element, the alert will fade out before it is removed. |
|
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. |
|
||||||
|
|
||||||
{% highlight js %}$(".alert").alert('close'){% endhighlight %}
|
{% highlight js %}$(".alert").alert('close'){% endhighlight %}
|
||||||
|
|
||||||
|
55
docs/components/badge.md
Normal file
55
docs/components/badge.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
layout: docs
|
||||||
|
title: Badges
|
||||||
|
description: Documentation and examples for badges, our small count and labelling component.
|
||||||
|
group: components
|
||||||
|
---
|
||||||
|
|
||||||
|
Small and adaptive tag for adding context to just about any content.
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
* Will be replaced with the ToC, excluding the "Contents" header
|
||||||
|
{:toc}
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
Badges scale to match the size of the immediate parent element by using relative font sizing and `em` units.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<h1>Example heading <span class="badge badge-default">New</span></h1>
|
||||||
|
<h2>Example heading <span class="badge badge-default">New</span></h2>
|
||||||
|
<h3>Example heading <span class="badge badge-default">New</span></h3>
|
||||||
|
<h4>Example heading <span class="badge badge-default">New</span></h4>
|
||||||
|
<h5>Example heading <span class="badge badge-default">New</span></h5>
|
||||||
|
<h6>Example heading <span class="badge badge-default">New</span></h6>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## Contextual variations
|
||||||
|
|
||||||
|
Add any of the below mentioned modifier classes to change the appearance of a badge.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<span class="badge badge-default">Default</span>
|
||||||
|
<span class="badge badge-primary">Primary</span>
|
||||||
|
<span class="badge badge-success">Success</span>
|
||||||
|
<span class="badge badge-info">Info</span>
|
||||||
|
<span class="badge badge-warning">Warning</span>
|
||||||
|
<span class="badge badge-danger">Danger</span>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
||||||
|
{{ callout-include | markdownify }}
|
||||||
|
|
||||||
|
## Pill badges
|
||||||
|
|
||||||
|
Use the `.badge-pill` modifier class to make badges more rounded (with a larger `border-radius` and additional horizontal `padding`). Useful if you miss the badges from v3.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<span class="badge badge-pill badge-default">Default</span>
|
||||||
|
<span class="badge badge-pill badge-primary">Primary</span>
|
||||||
|
<span class="badge badge-pill badge-success">Success</span>
|
||||||
|
<span class="badge badge-pill badge-info">Info</span>
|
||||||
|
<span class="badge badge-pill badge-warning">Warning</span>
|
||||||
|
<span class="badge badge-pill badge-danger">Danger</span>
|
||||||
|
{% endexample %}
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Breadcrumb
|
title: Breadcrumb
|
||||||
|
description: Indicate the current page's location within a navigational hierarchy.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Button group
|
title: Button group
|
||||||
|
description: Group a series of buttons together on a single line with the button group, and super-power them with JavaScript.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -25,17 +26,17 @@ Wrap a series of buttons with `.btn` in `.btn-group`.
|
|||||||
|
|
||||||
## Button toolbar
|
## Button toolbar
|
||||||
|
|
||||||
Combine sets of button groups into button toolbars for more complex components.
|
Combine sets of button groups into button toolbars for more complex components. Use utility classes as needed to space out groups, buttons, and more.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
|
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
|
||||||
<div class="btn-group" role="group" aria-label="First group">
|
<div class="btn-group mr-2" role="group" aria-label="First group">
|
||||||
<button type="button" class="btn btn-secondary">1</button>
|
<button type="button" class="btn btn-secondary">1</button>
|
||||||
<button type="button" class="btn btn-secondary">2</button>
|
<button type="button" class="btn btn-secondary">2</button>
|
||||||
<button type="button" class="btn btn-secondary">3</button>
|
<button type="button" class="btn btn-secondary">3</button>
|
||||||
<button type="button" class="btn btn-secondary">4</button>
|
<button type="button" class="btn btn-secondary">4</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group" role="group" aria-label="Second group">
|
<div class="btn-group mr-2" role="group" aria-label="Second group">
|
||||||
<button type="button" class="btn btn-secondary">5</button>
|
<button type="button" class="btn btn-secondary">5</button>
|
||||||
<button type="button" class="btn btn-secondary">6</button>
|
<button type="button" class="btn btn-secondary">6</button>
|
||||||
<button type="button" class="btn btn-secondary">7</button>
|
<button type="button" class="btn btn-secondary">7</button>
|
||||||
@ -46,6 +47,36 @@ Combine sets of button groups into button toolbars for more complex components.
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
Feel free to mix input groups with button groups in your toolbars. Similar to the example above, you'll likely need some utilities though to space things properly.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="btn-toolbar mb-3" role="toolbar" aria-label="Toolbar with button groups">
|
||||||
|
<div class="btn-group mr-2" role="group" aria-label="First group">
|
||||||
|
<button type="button" class="btn btn-secondary">1</button>
|
||||||
|
<button type="button" class="btn btn-secondary">2</button>
|
||||||
|
<button type="button" class="btn btn-secondary">3</button>
|
||||||
|
<button type="button" class="btn btn-secondary">4</button>
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon" id="btnGroupAddon">@</span>
|
||||||
|
<input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-toolbar justify-content-between" role="toolbar" aria-label="Toolbar with button groups">
|
||||||
|
<div class="btn-group" role="group" aria-label="First group">
|
||||||
|
<button type="button" class="btn btn-secondary">1</button>
|
||||||
|
<button type="button" class="btn btn-secondary">2</button>
|
||||||
|
<button type="button" class="btn btn-secondary">3</button>
|
||||||
|
<button type="button" class="btn btn-secondary">4</button>
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon" id="btnGroupAddon2">@</span>
|
||||||
|
<input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon2">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
## Sizing
|
## Sizing
|
||||||
|
|
||||||
Instead of applying button sizing classes to every button in a group, just add `.btn-group-*` to each `.btn-group`, including each one when nesting multiple groups.
|
Instead of applying button sizing classes to every button in a group, just add `.btn-group-*` to each `.btn-group`, including each one when nesting multiple groups.
|
||||||
@ -101,6 +132,18 @@ Place a `.btn-group` within another `.btn-group` when you want dropdown menus mi
|
|||||||
|
|
||||||
Make a set of buttons appear vertically stacked rather than horizontally. **Split button dropdowns are not supported here.**
|
Make a set of buttons appear vertically stacked rather than horizontally. **Split button dropdowns are not supported here.**
|
||||||
|
|
||||||
|
<div class="bd-example">
|
||||||
|
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
|
||||||
|
<button type="button" class="btn btn-secondary">Button</button>
|
||||||
|
<button type="button" class="btn btn-secondary">Button</button>
|
||||||
|
<button type="button" class="btn btn-secondary">Button</button>
|
||||||
|
<button type="button" class="btn btn-secondary">Button</button>
|
||||||
|
<button type="button" class="btn btn-secondary">Button</button>
|
||||||
|
<button type="button" class="btn btn-secondary">Button</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="bd-example">
|
<div class="bd-example">
|
||||||
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
|
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
|
||||||
<button type="button" class="btn btn-secondary">Button</button>
|
<button type="button" class="btn btn-secondary">Button</button>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Buttons
|
title: Buttons
|
||||||
|
description: Use Bootstrap's custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.
|
||||||
group: components
|
group: components
|
||||||
redirect_from: "/components/"
|
redirect_from: "/components/"
|
||||||
---
|
---
|
||||||
@ -104,10 +105,6 @@ Buttons will appear pressed (with a darker background, darker border, and inset
|
|||||||
|
|
||||||
Make buttons look inactive by adding the `disabled` boolean attribute to any `<button>` element.
|
Make buttons look inactive by adding the `disabled` boolean attribute to any `<button>` element.
|
||||||
|
|
||||||
{% callout info %}
|
|
||||||
**Heads up!** IE9 and below render disabled buttons with gray, shadowed text that we can't override.
|
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<button type="button" class="btn btn-lg btn-primary" disabled>Primary button</button>
|
<button type="button" class="btn btn-lg btn-primary" disabled>Primary button</button>
|
||||||
<button type="button" class="btn btn-secondary btn-lg" disabled>Button</button>
|
<button type="button" class="btn btn-secondary btn-lg" disabled>Button</button>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Cards
|
title: Cards
|
||||||
|
description: Bootstrap Cards provide a flexible and extensible content container with multiple variants and options.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -15,10 +16,12 @@ If you're familiar with Bootstrap 3, cards replace our old panels, wells, and th
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
Cards require a small amount of markup and classes to provide you with as much control as possible. These classes and markup are flexible though and can typically be remixed and extended with ease. For example, if your card has no flush content like images, feel free to put the `.card-block` class on the `.card` element to consolidate your markup.
|
Cards are built with as little markup and styles as possible, but still manage to deliver a ton of control and customization. Built with flexbox, they offer easy alignment and mix well with other Bootstrap components.
|
||||||
|
|
||||||
|
Below is an example of a basic card with mixed content and a fixed width. Cards have no fixed width to start, so they'll naturally fill the full width of it's parent element. This is easily customized with our various [sizing options](#sizing).
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card">
|
<div class="card" style="width: 20rem;">
|
||||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title</h4>
|
<h4 class="card-title">Card title</h4>
|
||||||
@ -30,38 +33,39 @@ Cards require a small amount of markup and classes to provide you with as much c
|
|||||||
|
|
||||||
## Content types
|
## Content types
|
||||||
|
|
||||||
Cards support a wide variety of content, including images, text, list groups, links, and more. Mix and match multiple content types to create the card you need.
|
Cards support a wide variety of content, including images, text, list groups, links, and more. Below are examples of what's supported.
|
||||||
|
|
||||||
|
### Blocks
|
||||||
|
|
||||||
|
The building block of a card is the `.card-block`. Use it whenever you need a padded section within a card.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
This is some text within a card block.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Titles, text, and links
|
||||||
|
|
||||||
|
Card titles are used by adding `.card-title` to a `<h*>` tag. In the same way, links are added and placed next to each other by adding `.card-link` to a `<a>` tag.
|
||||||
|
|
||||||
|
Subtitles are used by adding a `.card-subtitle` to an `<h*>` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-block` item, the card title and subtitle are aligned nicely.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
|
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title</h4>
|
<h4 class="card-title">Card title</h4>
|
||||||
|
<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
|
||||||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
||||||
</div>
|
|
||||||
<ul class="list-group list-group-flush">
|
|
||||||
<li class="list-group-item">Cras justo odio</li>
|
|
||||||
<li class="list-group-item">Dapibus ac facilisis in</li>
|
|
||||||
<li class="list-group-item">Vestibulum at eros</li>
|
|
||||||
</ul>
|
|
||||||
<div class="card-block">
|
|
||||||
<a href="#" class="card-link">Card link</a>
|
<a href="#" class="card-link">Card link</a>
|
||||||
<a href="#" class="card-link">Another link</a>
|
<a href="#" class="card-link">Another link</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
Lists can be added to a card by adding a list group.
|
### Images
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="card">
|
|
||||||
<ul class="list-group list-group-flush">
|
|
||||||
<li class="list-group-item">Cras justo odio</li>
|
|
||||||
<li class="list-group-item">Dapibus ac facilisis in</li>
|
|
||||||
<li class="list-group-item">Vestibulum at eros</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
`.card-img-top` places an image to the top of the card. With `.card-text`, text can be added to the card. Text within `.card-text` can also be styled with the standard HTML tags.
|
`.card-img-top` places an image to the top of the card. With `.card-text`, text can be added to the card. Text within `.card-text` can also be styled with the standard HTML tags.
|
||||||
|
|
||||||
@ -74,96 +78,44 @@ Lists can be added to a card by adding a list group.
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
Card titles are used by adding `.card-title` to a `<h*>` tag. In the same way, links are added and placed next to each other by adding `.card-link` to a `<a>` tag.
|
### List groups
|
||||||
|
|
||||||
{% example html %}
|
Create lists of content in a card with a flush list group.
|
||||||
<div class="card card-block">
|
|
||||||
<h4 class="card-title">Card title</h4>
|
|
||||||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
|
||||||
<a href="#" class="card-link">Card link</a>
|
|
||||||
<a href="#" class="card-link">Another link</a>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
Subtitles are used by adding a `.card-subtitle` to an `<h*>` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-block` item, the card title and subtitle are aligned nicely.
|
|
||||||
|
|
||||||
The multiple content types can be easily combined to create the card you need. See below for an example.
|
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item">Cras justo odio</li>
|
||||||
|
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||||
|
<li class="list-group-item">Vestibulum at eros</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Kitchen sink
|
||||||
|
|
||||||
|
Mix and match multiple content types to create the card you need, or throw everything in there. Shown below are image styles, blocks, text styles, and a list group—all wrapped in a fixed-width card.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card" style="width: 20rem;">
|
||||||
|
<img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title</h4>
|
<h4 class="card-title">Card title</h4>
|
||||||
<h6 class="card-subtitle text-muted">Support card subtitle</h6>
|
|
||||||
</div>
|
|
||||||
<img data-src="holder.js/100px180/?text=Image" alt="Card image">
|
|
||||||
<div class="card-block">
|
|
||||||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
||||||
|
</div>
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item">Cras justo odio</li>
|
||||||
|
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||||
|
<li class="list-group-item">Vestibulum at eros</li>
|
||||||
|
</ul>
|
||||||
|
<div class="card-block">
|
||||||
<a href="#" class="card-link">Card link</a>
|
<a href="#" class="card-link">Card link</a>
|
||||||
<a href="#" class="card-link">Another link</a>
|
<a href="#" class="card-link">Another link</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Sizing
|
### Header and footer
|
||||||
|
|
||||||
Constrain the width of cards via custom CSS, our predefined grid classes, or with custom styles using our grid mixins.
|
|
||||||
|
|
||||||
Using the grid:
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<div class="card card-block">
|
|
||||||
<h3 class="card-title">Special title treatment</h3>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<div class="card card-block">
|
|
||||||
<h3 class="card-title">Special title treatment</h3>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
Using custom widths:
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="card card-block" style="width: 18rem;">
|
|
||||||
<h3 class="card-title">Special title treatment</h3>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Text alignment
|
|
||||||
|
|
||||||
You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes]({{ site.baseurl }}/components/utilities/#text-alignment).
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="card card-block">
|
|
||||||
<h4 class="card-title">Special title treatment</h4>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card card-block text-xs-center">
|
|
||||||
<h4 class="card-title">Special title treatment</h4>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card card-block text-xs-right">
|
|
||||||
<h4 class="card-title">Special title treatment</h4>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Header and footer
|
|
||||||
|
|
||||||
Add an optional header and/or footer within a card.
|
Add an optional header and/or footer within a card.
|
||||||
|
|
||||||
@ -208,7 +160,7 @@ Card headers can be styled by adding `.card-header` to `<h*>` elements.
|
|||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card text-xs-center">
|
<div class="card text-center">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
Featured
|
Featured
|
||||||
</div>
|
</div>
|
||||||
@ -223,62 +175,163 @@ Card headers can be styled by adding `.card-header` to `<h*>` elements.
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Header nav
|
## Sizing
|
||||||
|
|
||||||
Use Bootstrap's nav pills or tabs within a card header. Be sure to always include a `.pull-*-*` utility class for proper alignment.
|
Cards assume no specific `width` to start, so they'll be 100% wide unless otherwise stated. You can change this as needed with custom CSS, grid classes, grid Sass mixins, or utilities.
|
||||||
|
|
||||||
{% example html %}
|
### Using grid markup
|
||||||
<div class="card text-xs-center">
|
|
||||||
<div class="card-header">
|
Using the grid, wrap cards in columns and rows as needed.
|
||||||
<ul class="nav nav-tabs card-header-tabs pull-xs-left">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" href="#">Active</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">Link</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link disabled" href="#">Disabled</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="card-block">
|
|
||||||
<h4 class="card-title">Special title treatment</h4>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="card text-xs-center">
|
|
||||||
<div class="card-header">
|
|
||||||
<ul class="nav nav-pills card-header-pills pull-xs-left">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" href="#">Active</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">Link</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link disabled" href="#">Disabled</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="card-block">
|
|
||||||
<h4 class="card-title">Special title treatment</h4>
|
|
||||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
|
||||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Image caps
|
|
||||||
|
|
||||||
Similar to headers and footers, cards include top and bottom image caps.
|
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
<h3 class="card-title">Special title treatment</h3>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
<h3 class="card-title">Special title treatment</h3>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Using utilities
|
||||||
|
|
||||||
|
Use our handful of [available sizing utilities]({{ site.baseurl }}/utilities/sizing-and-positioning/#width-and-height) to quickly set a card's width.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card w-75">
|
||||||
|
<div class="card-block">
|
||||||
|
<h3 class="card-title">Card title</h3>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Button</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card w-50">
|
||||||
|
<div class="card-block">
|
||||||
|
<h3 class="card-title">Card title</h3>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Button</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Using custom CSS
|
||||||
|
|
||||||
|
Use custom CSS in your stylesheets or as inline styles to set a width.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card" style="width: 20rem;">
|
||||||
|
<div class="card-block">
|
||||||
|
<h3 class="card-title">Special title treatment</h3>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## Text alignment
|
||||||
|
|
||||||
|
You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes]({{ site.baseurl }}/utilities/typography/#text-alignment).
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card" style="width: 20rem;">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Special title treatment</h4>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card text-center" style="width: 20rem;">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Special title treatment</h4>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card text-right" style="width: 20rem;">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Special title treatment</h4>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## Navigation
|
||||||
|
|
||||||
|
Add some navigation to a card's header (or block) with Bootstrap's [nav components]({{ site.baseurl }}/components/navs/).
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card text-center">
|
||||||
|
<div class="card-header">
|
||||||
|
<ul class="nav nav-tabs card-header-tabs">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" href="#">Active</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Special title treatment</h4>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card text-center">
|
||||||
|
<div class="card-header">
|
||||||
|
<ul class="nav nav-pills card-header-pills">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" href="#">Active</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Special title treatment</h4>
|
||||||
|
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## Images
|
||||||
|
|
||||||
|
Cards include a few options for working with images. Choose from appending "image caps" at either end of a card, overlaying images with card content, or simply embedding the image in a card.
|
||||||
|
|
||||||
|
### Image caps
|
||||||
|
|
||||||
|
Similar to headers and footers, cards can include top and bottom "image caps"—images at the top or bottom of a card.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card mb-3">
|
||||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title</h4>
|
<h4 class="card-title">Card title</h4>
|
||||||
@ -296,7 +349,7 @@ Similar to headers and footers, cards include top and bottom image caps.
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Image overlays
|
### Image overlays
|
||||||
|
|
||||||
Turn an image into a card background and overlay your card's text. Depending on the image, you may or may not need `.card-inverse` (see below).
|
Turn an image into a card background and overlay your card's text. Depending on the image, you may or may not need `.card-inverse` (see below).
|
||||||
|
|
||||||
@ -311,9 +364,13 @@ Turn an image into a card background and overlay your card's text. Depending on
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Inverted text
|
## Card styles
|
||||||
|
|
||||||
Cards include a class for quickly toggling **the text color**. By default, cards use dark text and assume a light background. **Add `.card-inverse` for white text** and specify the `background-color` and `border-color` to go with it.
|
Cards include various options for customizing their backgrounds, borders, and color.
|
||||||
|
|
||||||
|
### Inverted text
|
||||||
|
|
||||||
|
By default, cards use dark text and assume a light background. You can reverse that by toggling the `color` of text within, as well as that of the card's subcomponents, with `.card-inverse`. Then, specify a dark `background-color` and `border-color` to go with it.
|
||||||
|
|
||||||
You can also use `.card-inverse` with the [contextual backgrounds variants](#background-variants).
|
You can also use `.card-inverse` with the [contextual backgrounds variants](#background-variants).
|
||||||
|
|
||||||
@ -327,12 +384,12 @@ You can also use `.card-inverse` with the [contextual backgrounds variants](#bac
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Background variants
|
### Background variants
|
||||||
|
|
||||||
Cards include their own variant classes for quickly changing the `background-color` and `border-color` of a card. **Darker colors require the use of `.card-inverse`.**
|
Cards include their own variant classes for quickly changing the `background-color` and `border-color` of a card. **Darker colors require the use of `.card-inverse`.**
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card card-inverse card-primary text-xs-center">
|
<div class="card card-inverse card-primary mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -340,7 +397,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-inverse card-success text-xs-center">
|
<div class="card card-inverse card-success mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -348,7 +405,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-inverse card-info text-xs-center">
|
<div class="card card-inverse card-info mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -356,7 +413,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-inverse card-warning text-xs-center">
|
<div class="card card-inverse card-warning mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -364,7 +421,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-inverse card-danger text-xs-center">
|
<div class="card card-inverse card-danger text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -377,12 +434,12 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||||||
{% 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 }}
|
||||||
|
|
||||||
## Outline variants
|
### Outline cards
|
||||||
|
|
||||||
In need of a colored card, but not the hefty background colors they bring? Replace the default modifier classes with the `.card-outline-*` ones to style just the `border-color` of a card.
|
In need of a colored card, but not the hefty background colors they bring? Replace the default modifier classes with the `.card-outline-*` ones to style just the `border-color` of a card.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card card-outline-primary text-xs-center">
|
<div class="card card-outline-primary mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -390,7 +447,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-outline-secondary text-xs-center">
|
<div class="card card-outline-secondary mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -398,7 +455,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-outline-success text-xs-center">
|
<div class="card card-outline-success mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -406,7 +463,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-outline-info text-xs-center">
|
<div class="card card-outline-info mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -414,7 +471,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-outline-warning text-xs-center">
|
<div class="card card-outline-warning mb-3 text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -422,7 +479,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-outline-danger text-xs-center">
|
<div class="card card-outline-danger text-center">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
@ -432,11 +489,13 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Groups
|
## Card layout
|
||||||
|
|
||||||
Use card groups to render cards as a single, attached element with equal width and height columns. By default, card groups use `display: table;` and `table-layout: fixed;` to achieve their uniform sizing. However, enabling [flexbox mode]({{ site.baseurl }}/getting-started/flexbox) can switch that to use `display: flex;` and provide the same effect.
|
In addition to styling the content within cards, Bootstrap includes a few options for laying out series of cards. For the time being, **these layout options are not yet responsive**.
|
||||||
|
|
||||||
Only applies to small devices and above.
|
### Card groups
|
||||||
|
|
||||||
|
Use card groups to render cards as a single, attached element with equal width and height columns. Card groups use `display: flex;` to achieve their uniform sizing.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card-group">
|
<div class="card-group">
|
||||||
@ -467,16 +526,48 @@ Only applies to small devices and above.
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Decks
|
When using card groups with footers, their content will automatically line up.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card-group">
|
||||||
|
<div class="card">
|
||||||
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Card title</h4>
|
||||||
|
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<small class="text-muted">Last updated 3 mins ago</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Card title</h4>
|
||||||
|
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<small class="text-muted">Last updated 3 mins ago</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Card title</h4>
|
||||||
|
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<small class="text-muted">Last updated 3 mins ago</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Card decks
|
||||||
|
|
||||||
Need a set of equal width and height cards that aren't attached to one another? Use card decks. By default, card decks require two wrapping elements: `.card-deck-wrapper` and a `.card-deck`. We use table styles for the sizing and the gutters on `.card-deck`. The `.card-deck-wrapper` is used to negative margin out the `border-spacing` on the `.card-deck`.
|
Need a set of equal width and height cards that aren't attached to one another? Use card decks. By default, card decks require two wrapping elements: `.card-deck-wrapper` and a `.card-deck`. We use table styles for the sizing and the gutters on `.card-deck`. The `.card-deck-wrapper` is used to negative margin out the `border-spacing` on the `.card-deck`.
|
||||||
|
|
||||||
Only applies to small devices and above.
|
|
||||||
|
|
||||||
**ProTip!** If you enable [flexbox mode]({{ site.baseurl }}/getting-started/flexbox/), you can remove the `.card-deck-wrapper`.
|
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card-deck-wrapper">
|
|
||||||
<div class="card-deck">
|
<div class="card-deck">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
||||||
@ -503,28 +594,62 @@ Only applies to small devices and above.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Just like with card groups, card footers in decks will automatically line up.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="card-deck">
|
||||||
|
<div class="card">
|
||||||
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Card title</h4>
|
||||||
|
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<small class="text-muted">Last updated 3 mins ago</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Card title</h4>
|
||||||
|
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<small class="text-muted">Last updated 3 mins ago</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||||
|
<div class="card-block">
|
||||||
|
<h4 class="card-title">Card title</h4>
|
||||||
|
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<small class="text-muted">Last updated 3 mins ago</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Columns
|
### Card columns
|
||||||
|
|
||||||
Cards can be organized into [Masonry](http://masonry.desandro.com)-like columns with just CSS by wrapping them in `.card-columns`. Cards are ordered from top to bottom and left to right when wrapped in `.card-columns`.
|
Cards can be organized into [Masonry](http://masonry.desandro.com)-like columns with just CSS by wrapping them in `.card-columns`. Cards are built with CSS `column` properties instead of flexbox for easier alignment. Cards are ordered from top to bottom and left to right.
|
||||||
|
|
||||||
Only applies to small devices and above.
|
**Heads up!** Your mileage with card columns may vary. To prevent cards breaking across columns, we must set them to `display: inline-block` as `column-break-inside: avoid` isn't a bulletproof solution yet.
|
||||||
|
|
||||||
**Heads up!** This is **not available in IE9 and below** as they have no support for the [`column-*` CSS properties](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_multi-column_layouts).
|
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="card-columns">
|
<div class="card-columns">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img class="card-img-top" data-src="holder.js/100px160/" alt="Card image cap">
|
<img class="card-img-top img-fluid" data-src="holder.js/100px160/" alt="Card image cap">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-block">
|
<div class="card p-3">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-block card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
<footer>
|
<footer>
|
||||||
<small class="text-muted">
|
<small class="text-muted">
|
||||||
@ -534,14 +659,14 @@ Only applies to small devices and above.
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img class="card-img-top" data-src="holder.js/100px160/" alt="Card image cap">
|
<img class="card-img-top img-fluid" data-src="holder.js/100px160/" alt="Card image cap">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title</h4>
|
<h4 class="card-title">Card title</h4>
|
||||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-block card-inverse card-primary text-xs-center">
|
<div class="card card-inverse card-primary p-3 text-center">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
|
||||||
<footer>
|
<footer>
|
||||||
@ -551,15 +676,17 @@ Only applies to small devices and above.
|
|||||||
</footer>
|
</footer>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-block text-xs-center">
|
<div class="card text-center">
|
||||||
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title</h4>
|
<h4 class="card-title">Card title</h4>
|
||||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
|
||||||
<img class="card-img" data-src="holder.js/100px260/" alt="Card image">
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-block text-xs-right">
|
<div class="card">
|
||||||
|
<img class="card-img img-fluid" data-src="holder.js/100px260/" alt="Card image">
|
||||||
|
</div>
|
||||||
|
<div class="card p-3 text-right">
|
||||||
<blockquote class="card-blockquote">
|
<blockquote class="card-blockquote">
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||||
<footer>
|
<footer>
|
||||||
@ -569,12 +696,14 @@ Only applies to small devices and above.
|
|||||||
</footer>
|
</footer>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
<div class="card card-block">
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
<h4 class="card-title">Card title</h4>
|
<h4 class="card-title">Card title</h4>
|
||||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
Card columns can also be extended and customized with some additional code. Shown below is an extension of the `.card-columns` class using the same CSS we use—CSS columns— to generate a set of responsive tiers for changing the number of columns.
|
Card columns can also be extended and customized with some additional code. Shown below is an extension of the `.card-columns` class using the same CSS we use—CSS columns— to generate a set of responsive tiers for changing the number of columns.
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Carousel
|
title: Carousel
|
||||||
|
description: A slideshow component for cycling through elements—images or slides of text—like a carousel.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
A slideshow component for cycling through elements—images or slides of text—like a carousel. In browsers where the [Page Visibility API](http://www.w3.org/TR/page-visibility/) is supported, the carousel will avoid sliding when the webpage is not visible to the user (such as when the browser tab is inactive, the browser window is minimized, etc.). **Nested carousels are not supported.**
|
The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript. It works with a series of images, text, or custom markup. It also includes support for previous/next controls and indicators.
|
||||||
|
|
||||||
|
In browsers where the [Page Visibility API](https://www.w3.org/TR/page-visibility/) is supported, the carousel will avoid sliding when the webpage is not visible to the user (such as when the browser tab is inactive, the browser window is minimized, etc.).
|
||||||
|
|
||||||
|
Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards.
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
@ -13,30 +18,86 @@ A slideshow component for cycling through elements—images or slides of text—
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
Carousels don't automatically normalize slide dimensions. As such, you may need to use additional utilities or custom styles to appropriately size content. While carousels support previous/next controls and indicators, they're not explicitly required. Add and customize as you see fit.
|
||||||
|
|
||||||
|
Be sure to set a unique id on the `.carousel` for optional controls, especially if you're using multiple carousels on a single page.
|
||||||
|
|
||||||
|
### Slides only
|
||||||
|
|
||||||
|
Here's a carousel with slides only. Note the presence of the `.d-block` and `.img-fluid` on carousel images to prevent browser default image alignment.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
|
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
|
||||||
|
<div class="carousel-inner" role="listbox">
|
||||||
|
<div class="carousel-item active">
|
||||||
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### With controls
|
||||||
|
|
||||||
|
Adding in the previous and next controls:
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
|
||||||
|
<div class="carousel-inner" role="listbox">
|
||||||
|
<div class="carousel-item active">
|
||||||
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
|
||||||
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||||
|
<span class="sr-only">Previous</span>
|
||||||
|
</a>
|
||||||
|
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
|
||||||
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||||
|
<span class="sr-only">Next</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### With indicators
|
||||||
|
|
||||||
|
You can also add the indicators to the carousel, alongside the controls, too.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||||
<ol class="carousel-indicators">
|
<ol class="carousel-indicators">
|
||||||
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
|
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
|
||||||
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
|
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
|
||||||
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
|
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
|
||||||
</ol>
|
</ol>
|
||||||
<div class="carousel-inner" role="listbox">
|
<div class="carousel-inner" role="listbox">
|
||||||
<div class="carousel-item active">
|
<div class="carousel-item active">
|
||||||
<img data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="First slide">
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<img data-src="holder.js/900x500/auto/#666:#444/text:Second slide" alt="Second slide">
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<img data-src="holder.js/900x500/auto/#555:#333/text:Third slide" alt="Third slide">
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
|
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||||
<span class="icon-prev" aria-hidden="true"></span>
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||||
<span class="sr-only">Previous</span>
|
<span class="sr-only">Previous</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
|
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||||
<span class="icon-next" aria-hidden="true"></span>
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||||
<span class="sr-only">Next</span>
|
<span class="sr-only">Next</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -54,45 +115,45 @@ Bootstrap exclusively uses CSS3 for its animations, but Internet Explorer 9 does
|
|||||||
The `.active` class needs to be added to one of the slides. Otherwise, the carousel will not be visible.
|
The `.active` class needs to be added to one of the slides. Otherwise, the carousel will not be visible.
|
||||||
{% endcallout %}
|
{% endcallout %}
|
||||||
|
|
||||||
### Optional captions
|
### With captions
|
||||||
|
|
||||||
Add captions to your slides easily with the `.carousel-caption` element within any `.carousel-item`. Place just about any optional HTML within there and it will be automatically aligned and formatted.
|
Add captions to your slides easily with the `.carousel-caption` element within any `.carousel-item`. They can be easily hidden on smaller viewports, as shown below, with optional [display utilities]({{ site.baseurl }}/utilities/display-property/). We hide them initially with `.d-none` and bring them back on medium-sized devices with `.d-md-block`.
|
||||||
|
|
||||||
<div class="bd-example">
|
<div class="bd-example">
|
||||||
<div id="carousel-example-captions" class="carousel slide" data-ride="carousel">
|
<div id="carouselExampleCaptions" class="carousel slide" data-ride="carousel">
|
||||||
<ol class="carousel-indicators">
|
<ol class="carousel-indicators">
|
||||||
<li data-target="#carousel-example-captions" data-slide-to="0" class="active"></li>
|
<li data-target="#carouselExampleCaptions" data-slide-to="0" class="active"></li>
|
||||||
<li data-target="#carousel-example-captions" data-slide-to="1"></li>
|
<li data-target="#carouselExampleCaptions" data-slide-to="1"></li>
|
||||||
<li data-target="#carousel-example-captions" data-slide-to="2"></li>
|
<li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
|
||||||
</ol>
|
</ol>
|
||||||
<div class="carousel-inner" role="listbox">
|
<div class="carousel-inner" role="listbox">
|
||||||
<div class="carousel-item active">
|
<div class="carousel-item active">
|
||||||
<img data-src="holder.js/900x500/auto/#777:#777" alt="First slide image">
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||||
<div class="carousel-caption">
|
<div class="carousel-caption d-none d-md-block">
|
||||||
<h3>First slide label</h3>
|
<h3>First slide label</h3>
|
||||||
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
|
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<img data-src="holder.js/900x500/auto/#666:#666" alt="Second slide image">
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||||
<div class="carousel-caption">
|
<div class="carousel-caption d-none d-md-block">
|
||||||
<h3>Second slide label</h3>
|
<h3>Second slide label</h3>
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<img data-src="holder.js/900x500/auto/#555:#555" alt="Third slide image">
|
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||||
<div class="carousel-caption">
|
<div class="carousel-caption d-none d-md-block">
|
||||||
<h3>Third slide label</h3>
|
<h3>Third slide label</h3>
|
||||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
|
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="left carousel-control" href="#carousel-example-captions" role="button" data-slide="prev">
|
<a class="carousel-control carousel-control-left" href="#carouselExampleCaptions" role="button" data-slide="prev">
|
||||||
<span class="icon-prev" aria-hidden="true"></span>
|
<span class="icon-prev" aria-hidden="true"></span>
|
||||||
<span class="sr-only">Previous</span>
|
<span class="sr-only">Previous</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="right carousel-control" href="#carousel-example-captions" role="button" data-slide="next">
|
<a class="carousel-control carousel-control-right" href="#carouselExampleCaptions" role="button" data-slide="next">
|
||||||
<span class="icon-next" aria-hidden="true"></span>
|
<span class="icon-next" aria-hidden="true"></span>
|
||||||
<span class="sr-only">Next</span>
|
<span class="sr-only">Next</span>
|
||||||
</a>
|
</a>
|
||||||
@ -102,25 +163,15 @@ Add captions to your slides easily with the `.carousel-caption` element within a
|
|||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<img src="..." alt="...">
|
<img src="..." alt="...">
|
||||||
<div class="carousel-caption">
|
<div class="carousel-caption d-none d-md-block">
|
||||||
<h3>...</h3>
|
<h3>...</h3>
|
||||||
<p>...</p>
|
<p>...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
{% callout danger %}
|
|
||||||
#### Accessibility issue
|
|
||||||
|
|
||||||
The carousel component is generally not compliant with accessibility standards. If you need to be compliant, please consider other options for presenting your content.
|
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Multiple carousels
|
|
||||||
|
|
||||||
Carousels require the use of an `id` on the outermost container (the `.carousel`) for carousel controls to function properly. When adding multiple carousels, or when changing a carousel's `id`, be sure to update the relevant controls.
|
|
||||||
|
|
||||||
### Via data attributes
|
### Via data attributes
|
||||||
|
|
||||||
Use data attributes to easily control the position of the carousel. `data-slide` accepts the keywords `prev` or `next`, which alters the slide position relative to its current position. Alternatively, use `data-slide-to` to pass a raw slide index to the carousel `data-slide-to="2"`, which shifts the slide position to a particular index beginning with `0`.
|
Use data attributes to easily control the position of the carousel. `data-slide` accepts the keywords `prev` or `next`, which alters the slide position relative to its current position. Alternatively, use `data-slide-to` to pass a raw slide index to the carousel `data-slide-to="2"`, which shifts the slide position to a particular index beginning with `0`.
|
||||||
@ -156,24 +207,30 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>5000</td>
|
<td>5000</td>
|
||||||
<td>The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.</td>
|
<td>The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>keyboard</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>true</td>
|
||||||
|
<td>Whether the carousel should react to keyboard events.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>pause</td>
|
<td>pause</td>
|
||||||
<td>string | null</td>
|
<td>string | null</td>
|
||||||
<td>"hover"</td>
|
<td>"hover"</td>
|
||||||
<td>If set to <code>"hover"</code>, pauses the cycling of the carousel on <code>mouseenter</code> and resumes the cycling of the carousel on <code>mouseleave</code>. If set to <code>null</code>, hovering over the carousel won't pause it.</td>
|
<td>If set to <code>"hover"</code>, pauses the cycling of the carousel on <code>mouseenter</code> and resumes the cycling of the carousel on <code>mouseleave</code>. If set to <code>null</code>, hovering over the carousel won't pause it.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>ride</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>false</td>
|
||||||
|
<td>Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>wrap</td>
|
<td>wrap</td>
|
||||||
<td>boolean</td>
|
<td>boolean</td>
|
||||||
<td>true</td>
|
<td>true</td>
|
||||||
<td>Whether the carousel should cycle continuously or have hard stops.</td>
|
<td>Whether the carousel should cycle continuously or have hard stops.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>keyboard</td>
|
|
||||||
<td>boolean</td>
|
|
||||||
<td>true</td>
|
|
||||||
<td>Whether the carousel should react to keyboard events.</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Collapse
|
title: Collapse
|
||||||
|
description: Toggle the visibility of content across your project with a few classes and our JavaScript plugins.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ Click the buttons below to show and hide another element via class changes:
|
|||||||
|
|
||||||
- `.collapse` hides content
|
- `.collapse` hides content
|
||||||
- `.collapsing` is applied during transitions
|
- `.collapsing` is applied during transitions
|
||||||
- `.collapse.in` shows content
|
- `.collapse.show` shows content
|
||||||
|
|
||||||
You can use a link with the `href` attribute, or a button with the `data-target` attribute. In both cases, the `data-toggle="collapse"` is required.
|
You can use a link with the `href` attribute, or a button with the `data-target` attribute. In both cases, the `data-toggle="collapse"` is required.
|
||||||
|
|
||||||
@ -43,43 +44,50 @@ Extend the default collapse behavior to create an accordion.
|
|||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div id="accordion" role="tablist" aria-multiselectable="true">
|
<div id="accordion" role="tablist" aria-multiselectable="true">
|
||||||
<div class="panel panel-default">
|
<div class="card">
|
||||||
<div class="panel-heading" role="tab" id="headingOne">
|
<div class="card-header" role="tab" id="headingOne">
|
||||||
<h4 class="panel-title">
|
<h5 class="mb-0">
|
||||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
|
||||||
Collapsible Group Item #1
|
Collapsible Group Item #1
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
|
|
||||||
|
<div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
|
||||||
|
<div class="card-block">
|
||||||
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
|
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default">
|
</div>
|
||||||
<div class="panel-heading" role="tab" id="headingTwo">
|
<div class="card">
|
||||||
<h4 class="panel-title">
|
<div class="card-header" role="tab" id="headingTwo">
|
||||||
|
<h5 class="mb-0">
|
||||||
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
|
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
|
||||||
Collapsible Group Item #2
|
Collapsible Group Item #2
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
|
<div id="collapseTwo" class="collapse" role="tabpanel" aria-labelledby="headingTwo">
|
||||||
|
<div class="card-block">
|
||||||
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
|
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default">
|
</div>
|
||||||
<div class="panel-heading" role="tab" id="headingThree">
|
<div class="card">
|
||||||
<h4 class="panel-title">
|
<div class="card-header" role="tab" id="headingThree">
|
||||||
|
<h5 class="mb-0">
|
||||||
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
|
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
|
||||||
Collapsible Group Item #3
|
Collapsible Group Item #3
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
|
<div id="collapseThree" class="collapse" role="tabpanel" aria-labelledby="headingThree">
|
||||||
|
<div class="card-block">
|
||||||
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
|
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Accessibility
|
## Accessibility
|
||||||
@ -93,14 +101,14 @@ Additionally, if your control element is targeting a single collapsible element
|
|||||||
The collapse plugin utilizes a few classes to handle the heavy lifting:
|
The collapse plugin utilizes a few classes to handle the heavy lifting:
|
||||||
|
|
||||||
- `.collapse` hides the content
|
- `.collapse` hides the content
|
||||||
- `.collapse.in` shows the content
|
- `.collapse.show` shows the content
|
||||||
- `.collapsing` is added when the transition starts, and removed when it finishes
|
- `.collapsing` is added when the transition starts, and removed when it finishes
|
||||||
|
|
||||||
These classes can be found in `_animation.scss`.
|
These classes can be found in `_transitions.scss`.
|
||||||
|
|
||||||
### Via data attributes
|
### Via data attributes
|
||||||
|
|
||||||
Just add `data-toggle="collapse"` and a `data-target` to the element to automatically assign control of a collapsible element. The `data-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you'd like it to default open, add the additional class `in`.
|
Just add `data-toggle="collapse"` and a `data-target` to the element to automatically assign control of a collapsible element. The `data-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you'd like it to default open, add the additional class `show`.
|
||||||
|
|
||||||
To add accordion-like group management to a collapsible control, add the data attribute `data-parent="#selector"`. Refer to the demo to see this in action.
|
To add accordion-like group management to a collapsible control, add the data attribute `data-parent="#selector"`. Refer to the demo to see this in action.
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Dropdowns
|
title: Dropdowns
|
||||||
|
description: Toggle contextual overlays for displaying lists of links and more with the Bootstrap dropdown plugin.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ Wrap the dropdown's toggle (your button or link) and the dropdown menu within `.
|
|||||||
Any single `.btn` can be turned into a dropdown toggle with some markup changes. Here's how you can put them to work with either `<button>` elements:
|
Any single `.btn` can be turned into a dropdown toggle with some markup changes. Here's how you can put them to work with either `<button>` elements:
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="dropdown open">
|
<div class="dropdown show">
|
||||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
Dropdown button
|
Dropdown button
|
||||||
</button>
|
</button>
|
||||||
@ -35,8 +36,8 @@ Any single `.btn` can be turned into a dropdown toggle with some markup changes.
|
|||||||
And with `<a>` elements:
|
And with `<a>` elements:
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="dropdown open">
|
<div class="dropdown show">
|
||||||
<a class="btn btn-secondary dropdown-toggle" href="http://example.com" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<a class="btn btn-secondary dropdown-toggle" href="https://example.com" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
Dropdown link
|
Dropdown link
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ The best part is you can do this with any button variant, too:
|
|||||||
|
|
||||||
<div class="bd-example">
|
<div class="bd-example">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Default</button>
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Primary</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item" href="#">Action</a>
|
<a class="dropdown-item" href="#">Action</a>
|
||||||
<a class="dropdown-item" href="#">Another action</a>
|
<a class="dropdown-item" href="#">Another action</a>
|
||||||
@ -62,7 +63,7 @@ The best part is you can do this with any button variant, too:
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- /btn-group -->
|
</div><!-- /btn-group -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Primary</button>
|
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Secondary</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item" href="#">Action</a>
|
<a class="dropdown-item" href="#">Action</a>
|
||||||
<a class="dropdown-item" href="#">Another action</a>
|
<a class="dropdown-item" href="#">Another action</a>
|
||||||
@ -137,8 +138,8 @@ We use this extra class to reduce the horizontal `padding` on either side of the
|
|||||||
|
|
||||||
<div class="bd-example">
|
<div class="bd-example">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-secondary">Default</button>
|
<button type="button" class="btn btn-primary">Primary</button>
|
||||||
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<span class="sr-only">Toggle Dropdown</span>
|
<span class="sr-only">Toggle Dropdown</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
@ -150,8 +151,8 @@ We use this extra class to reduce the horizontal `padding` on either side of the
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- /btn-group -->
|
</div><!-- /btn-group -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary">Primary</button>
|
<button type="button" class="btn btn-secondary">Secondary</button>
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<span class="sr-only">Toggle Dropdown</span>
|
<span class="sr-only">Toggle Dropdown</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
@ -406,7 +407,7 @@ Trigger dropdown menus above elements by adding `.dropup` to the parent element.
|
|||||||
Historically dropdown menu contents *had* to be links, but that's no longer the case with v4. Now you can optionally use `<button>` elements in your dropdowns instead of just `<a>`s.
|
Historically dropdown menu contents *had* to be links, but that's no longer the case with v4. Now you can optionally use `<button>` elements in your dropdowns instead of just `<a>`s.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="dropdown open">
|
<div class="dropdown show">
|
||||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
Dropdown
|
Dropdown
|
||||||
</button>
|
</button>
|
||||||
@ -479,7 +480,7 @@ Add `.disabled` to items in the dropdown to **style them as disabled**.
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.open` class on the parent list item.
|
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent list item.
|
||||||
|
|
||||||
On mobile devices, opening a dropdown adds a `.dropdown-backdrop` as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. **This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile.**
|
On mobile devices, opening a dropdown adds a `.dropdown-backdrop` as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. **This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile.**
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Forms
|
title: Forms
|
||||||
|
description: Examples and usage guidelines for from controls, form layouts, and custom forms.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -151,8 +152,7 @@ Below is a complete list of the specific form controls supported by Bootstrap an
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
{% markdown %}
|
{% markdown %}
|
||||||
`.form-check`<br>
|
`.form-check`
|
||||||
`.form-check-inline`
|
|
||||||
{% endmarkdown %}
|
{% endmarkdown %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
@ -171,80 +171,80 @@ Here are examples of `.form-control` applied to each textual HTML5 `<input>` `ty
|
|||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-text-input" class="col-xs-2 col-form-label">Text</label>
|
<label for="example-text-input" class="col-2 col-form-label">Text</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="text" value="Artisanal kale" id="example-text-input">
|
<input class="form-control" type="text" value="Artisanal kale" id="example-text-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-search-input" class="col-xs-2 col-form-label">Search</label>
|
<label for="example-search-input" class="col-2 col-form-label">Search</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="search" value="How do I shoot web" id="example-search-input">
|
<input class="form-control" type="search" value="How do I shoot web" id="example-search-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-email-input" class="col-xs-2 col-form-label">Email</label>
|
<label for="example-email-input" class="col-2 col-form-label">Email</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="email" value="bootstrap@example.com" id="example-email-input">
|
<input class="form-control" type="email" value="bootstrap@example.com" id="example-email-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-url-input" class="col-xs-2 col-form-label">URL</label>
|
<label for="example-url-input" class="col-2 col-form-label">URL</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="url" value="http://getbootstrap.com" id="example-url-input">
|
<input class="form-control" type="url" value="https://getbootstrap.com" id="example-url-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-tel-input" class="col-xs-2 col-form-label">Telephone</label>
|
<label for="example-tel-input" class="col-2 col-form-label">Telephone</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="tel" value="1-(555)-555-5555" id="example-tel-input">
|
<input class="form-control" type="tel" value="1-(555)-555-5555" id="example-tel-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-password-input" class="col-xs-2 col-form-label">Password</label>
|
<label for="example-password-input" class="col-2 col-form-label">Password</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="password" value="hunter2" id="example-password-input">
|
<input class="form-control" type="password" value="hunter2" id="example-password-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-number-input" class="col-xs-2 col-form-label">Number</label>
|
<label for="example-number-input" class="col-2 col-form-label">Number</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="number" value="42" id="example-number-input">
|
<input class="form-control" type="number" value="42" id="example-number-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-datetime-local-input" class="col-xs-2 col-form-label">Date and time</label>
|
<label for="example-datetime-local-input" class="col-2 col-form-label">Date and time</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="datetime-local" value="2011-08-19T13:45:00" id="example-datetime-local-input">
|
<input class="form-control" type="datetime-local" value="2011-08-19T13:45:00" id="example-datetime-local-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-date-input" class="col-xs-2 col-form-label">Date</label>
|
<label for="example-date-input" class="col-2 col-form-label">Date</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="date" value="2011-08-19" id="example-date-input">
|
<input class="form-control" type="date" value="2011-08-19" id="example-date-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-month-input" class="col-xs-2 col-form-label">Month</label>
|
<label for="example-month-input" class="col-2 col-form-label">Month</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="month" value="2011-08" id="example-month-input">
|
<input class="form-control" type="month" value="2011-08" id="example-month-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-week-input" class="col-xs-2 col-form-label">Week</label>
|
<label for="example-week-input" class="col-2 col-form-label">Week</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="week" value="2011-W33" id="example-week-input">
|
<input class="form-control" type="week" value="2011-W33" id="example-week-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-time-input" class="col-xs-2 col-form-label">Time</label>
|
<label for="example-time-input" class="col-2 col-form-label">Time</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="time" value="13:45:00" id="example-time-input">
|
<input class="form-control" type="time" value="13:45:00" id="example-time-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="example-color-input" class="col-xs-2 col-form-label">Color</label>
|
<label for="example-color-input" class="col-2 col-form-label">Color</label>
|
||||||
<div class="col-xs-10">
|
<div class="col-10">
|
||||||
<input class="form-control" type="color" value="#563d7c" id="example-color-input">
|
<input class="form-control" type="color" value="#563d7c" id="example-color-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -273,62 +273,54 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o
|
|||||||
|
|
||||||
### Inline forms
|
### Inline forms
|
||||||
|
|
||||||
Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms behave differently:
|
Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms vary slightly from their default states.
|
||||||
|
|
||||||
- Controls are `display: inline-block` to provide alignment control via `vertical-align` and `margin`.
|
- Controls are `display: flex`, collapsing any HTML white space and allowing you to provide alignment control with [spacing]({{ site.baseurl }}/utilities/spacing/) and [flexbox]({{ site.baseurl }}/utilities/flexbox/) utilities.
|
||||||
- Controls receive `width: auto` to override the Bootstrap default `width: 100%`.
|
- Controls and input groups receive `width: auto` to override the Bootstrap default `width: 100%`.
|
||||||
- Controls **only appear inline in viewports that are at least 768px wide** to account for narrow viewports on mobile devices.
|
- Controls **only appear inline in viewports that are at least 576px wide** to account for narrow viewports on mobile devices.
|
||||||
|
|
||||||
Because of this, you may need to manually address the width and alignment of individual form controls. Lastly, as shown below, you should always include a `<label>` with each form control.
|
You may need to manually address the width and alignment of individual form controls with [spacing utilities]({{ site.baseurl }}/utilities/spacing/) (as shown below). Lastly, be sure to always include a `<label>` with each form control, even if you need to hide it from non-screenreader visitors with `.sr-only`.
|
||||||
|
|
||||||
#### Visible labels
|
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
<div class="form-group">
|
<label class="sr-only" for="inlineFormInput">Name</label>
|
||||||
<label for="exampleInputName2">Name</label>
|
<input type="text" class="form-control mb-2 mr-sm-2 mb-sm-0" id="inlineFormInput" placeholder="Jane Doe">
|
||||||
<input type="text" class="form-control" id="exampleInputName2" placeholder="Jane Doe">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail2">Email</label>
|
|
||||||
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="btn btn-primary">Send invitation</button>
|
|
||||||
</form>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
#### Hidden labels
|
<label class="sr-only" for="inlineFormInputGroup">Username</label>
|
||||||
|
<div class="input-group mb-2 mr-sm-2 mb-sm-0">
|
||||||
|
<div class="input-group-addon">@</div>
|
||||||
|
<input type="text" class="form-control" id="inlineFormInputGroup" placeholder="Username">
|
||||||
|
</div>
|
||||||
|
|
||||||
{% example html %}
|
<div class="form-check mb-2 mr-sm-2 mb-sm-0">
|
||||||
<form class="form-inline">
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="sr-only" for="exampleInputEmail3">Email address</label>
|
|
||||||
<input type="email" class="form-control" id="exampleInputEmail3" placeholder="Enter email">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="sr-only" for="exampleInputPassword3">Password</label>
|
|
||||||
<input type="password" class="form-control" id="exampleInputPassword3" placeholder="Password">
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<label class="form-check-label">
|
<label class="form-check-label">
|
||||||
<input class="form-check-input" type="checkbox"> Remember me
|
<input class="form-check-input" type="checkbox"> Remember me
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">Sign in</button>
|
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
Custom form controls and selects are also supported.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
<div class="form-group">
|
<label class="mr-sm-2" for="inlineFormCustomSelect">Preference</label>
|
||||||
<label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label>
|
<select class="custom-select mb-2 mr-sm-2 mb-sm-0" id="inlineFormCustomSelect">
|
||||||
<div class="input-group">
|
<option selected>Choose...</option>
|
||||||
<div class="input-group-addon">$</div>
|
<option value="1">One</option>
|
||||||
<input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount">
|
<option value="2">Two</option>
|
||||||
<div class="input-group-addon">.00</div>
|
<option value="3">Three</option>
|
||||||
</div>
|
</select>
|
||||||
</div>
|
|
||||||
<button type="submit" class="btn btn-primary">Transfer cash</button>
|
<label class="custom-control custom-checkbox mb-2 mr-sm-2 mb-sm-0">
|
||||||
|
<input type="checkbox" class="custom-control-input">
|
||||||
|
<span class="custom-control-indicator"></span>
|
||||||
|
<span class="custom-control-description">Remember my preference</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
@ -339,7 +331,7 @@ Assistive technologies such as screen readers will have trouble with your forms
|
|||||||
|
|
||||||
### Using the Grid
|
### Using the Grid
|
||||||
|
|
||||||
For more structured form layouts that are also responsive, you can utilize Bootstrap's [predefined grid classes](/layout/grid/#predefined-classes) or [mixins](/layout/grid/#sass-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.
|
For more structured form layouts that are also responsive, you can utilize Bootstrap's [predefined grid classes]({{ site.baseurl }}/layout/grid/#predefined-classes) or [mixins]({{ site.baseurl }}/layout/grid/#sass-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 `.col-form-label` to your `<label>`s as well so they're vertically centered with their associated form controls. For `<legend>` elements, you can use `.col-form-legend` to make them appear similar to regular `<label>` elements.
|
Be sure to add `.col-form-label` to your `<label>`s as well so they're vertically centered with their associated form controls. For `<legend>` elements, you can use `.col-form-legend` to make them appear similar to regular `<label>` elements.
|
||||||
|
|
||||||
@ -470,30 +462,42 @@ By default, any number of checkboxes and radios that are immediate sibling will
|
|||||||
|
|
||||||
### Inline
|
### Inline
|
||||||
|
|
||||||
Groups of checkboxes or radios that appear on the same horizontal row are similar to their stacked counterparts, but require different HTML and a single class. To switch from stacked to inline, drop the surrounding `<div>`, add `.form-check-inline` to the `<label>`, and keep the `.form-check-input` on the `<input>`.
|
Group checkboxes or radios on the same horizontal row by adding `.form-check-inline` to any `.form-check`.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<label class="form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
|
<label class="form-check-label">
|
||||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1"> 1
|
<input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1"> 1
|
||||||
</label>
|
</label>
|
||||||
<label class="form-check-inline">
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<label class="form-check-label">
|
||||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2"> 2
|
<input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2"> 2
|
||||||
</label>
|
</label>
|
||||||
<label class="form-check-inline">
|
</div>
|
||||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3"> 3
|
<div class="form-check form-check-inline disabled">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3" disabled> 3
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<label class="form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
|
<label class="form-check-label">
|
||||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1
|
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1
|
||||||
</label>
|
</label>
|
||||||
<label class="form-check-inline">
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<label class="form-check-label">
|
||||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 2
|
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 2
|
||||||
</label>
|
</label>
|
||||||
<label class="form-check-inline">
|
</div>
|
||||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3"> 3
|
<div class="form-check form-check-inline disabled">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3" disabled> 3
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
### Without labels
|
### Without labels
|
||||||
@ -515,7 +519,7 @@ Should you have no text within the `<label>`, the input is positioned as you'd e
|
|||||||
|
|
||||||
## Static controls
|
## Static controls
|
||||||
|
|
||||||
When you need to place plain text next to a form label within a form, use the `.form-control-static` class on a `<p>`.
|
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.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<form>
|
<form>
|
||||||
@ -540,7 +544,7 @@ When you need to place plain text next to a form label within a form, use the `.
|
|||||||
<label class="sr-only">Email</label>
|
<label class="sr-only">Email</label>
|
||||||
<p class="form-control-static">email@example.com</p>
|
<p class="form-control-static">email@example.com</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group mx-sm-3">
|
||||||
<label for="inputPassword2" class="sr-only">Password</label>
|
<label for="inputPassword2" class="sr-only">Password</label>
|
||||||
<input type="password" class="form-control" id="inputPassword2" placeholder="Password">
|
<input type="password" class="form-control" id="inputPassword2" placeholder="Password">
|
||||||
</div>
|
</div>
|
||||||
@ -584,7 +588,7 @@ Add the `disabled` attribute to a `<fieldset>` to disable all the controls withi
|
|||||||
{% callout warning %}
|
{% callout warning %}
|
||||||
#### Caveat about link functionality of `<a>`
|
#### Caveat about link functionality of `<a>`
|
||||||
|
|
||||||
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-state) (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.
|
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]({{ site.baseurl }}/components/buttons/#disabled-state) (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 %}
|
{% endcallout %}
|
||||||
|
|
||||||
{% callout danger %}
|
{% callout danger %}
|
||||||
@ -629,14 +633,14 @@ Wrap inputs in grid columns, or any custom parent element, to easily enforce des
|
|||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-2">
|
<div class="col-2">
|
||||||
<input type="text" class="form-control" placeholder=".col-xs-2">
|
<input type="text" class="form-control" placeholder=".col-2">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3">
|
<div class="col-3">
|
||||||
<input type="text" class="form-control" placeholder=".col-xs-3">
|
<input type="text" class="form-control" placeholder=".col-3">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-4">
|
||||||
<input type="text" class="form-control" placeholder=".col-xs-4">
|
<input type="text" class="form-control" placeholder=".col-4">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
@ -671,7 +675,7 @@ Inline text can use any typical inline HTML element (be it a `<small>`, `<span>`
|
|||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputPassword4">Password</label>
|
<label for="inputPassword4">Password</label>
|
||||||
<input type="password" id="inputPassword4" class="form-control" aria-describedby="passwordHelpInline">
|
<input type="password" id="inputPassword4" class="form-control mx-sm-3" aria-describedby="passwordHelpInline">
|
||||||
<small id="passwordHelpInline" class="text-muted">
|
<small id="passwordHelpInline" class="text-muted">
|
||||||
Must be 8-20 characters long.
|
Must be 8-20 characters long.
|
||||||
</small>
|
</small>
|
||||||
@ -681,7 +685,11 @@ Inline text can use any typical inline HTML element (be it a `<small>`, `<span>`
|
|||||||
|
|
||||||
## Validation
|
## Validation
|
||||||
|
|
||||||
Bootstrap includes validation styles for danger, warning, and success states on form controls. Here's a rundown of how they work:
|
Bootstrap includes validation styles for danger, warning, and success states on most form controls.
|
||||||
|
|
||||||
|
### How it works
|
||||||
|
|
||||||
|
Here's a rundown of how they work:
|
||||||
|
|
||||||
- To use, add `.has-warning`, `.has-danger`, or `.has-success` to the parent element. Any `.col-form-label`, `.form-control`, or custom form element will receive the validation styles.
|
- To use, add `.has-warning`, `.has-danger`, or `.has-success` to the parent element. Any `.col-form-label`, `.form-control`, or custom form element will receive the validation styles.
|
||||||
- Contextual validation text, in addition to your usual form field help text, can be added with the use of `.form-control-feedback`. This text will adapt to the parent `.has-*` class. By default it only includes a bit of `margin` for spacing and a modified `color` for each state.
|
- Contextual validation text, in addition to your usual form field help text, can be added with the use of `.form-control-feedback`. This text will adapt to the parent `.has-*` class. By default it only includes a bit of `margin` for spacing and a modified `color` for each state.
|
||||||
@ -689,45 +697,84 @@ Bootstrap includes validation styles for danger, warning, and success states on
|
|||||||
- You may use your own base64 PNGs or SVGs by updating the Sass variables and recompiling.
|
- You may use your own base64 PNGs or SVGs by updating the Sass variables and recompiling.
|
||||||
- Icons can also be disabled entirely by setting the variables to `none` or commenting out the source Sass.
|
- Icons can also be disabled entirely by setting the variables to `none` or commenting out the source Sass.
|
||||||
|
|
||||||
|
### Defining states
|
||||||
|
|
||||||
Generally speaking, you'll want to use a particular state for specific types of feedback:
|
Generally speaking, you'll want to use a particular state for specific types of feedback:
|
||||||
|
|
||||||
- **Danger** is great for when there's a blocking or required field. A user *must* fill in this field properly to submit the form.
|
- **Danger** is great for when there's a blocking or required field. A user *must* fill in this field properly to submit the form.
|
||||||
- **Warning** works well for input values that are in progress, like password strength, or soft validation before a user attempts to submit a form.
|
- **Warning** works well for input values that are in progress, like password strength, or soft validation before a user attempts to submit a form.
|
||||||
- And lastly, **success** is ideal for situations when you have per-field validation throughout a form and want to encourage a user through the rest of the fields.
|
- And lastly, **success** is ideal for situations when you have per-field validation throughout a form and want to encourage a user through the rest of the fields.
|
||||||
|
|
||||||
Here are some examples of the aforementioned classes in action.
|
|
||||||
|
|
||||||
{% comment %}
|
{% comment %}
|
||||||
{% callout warning %}
|
{% callout warning %}
|
||||||
#### Conveying validation state to assistive technologies and colorblind users
|
#### 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.
|
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.
|
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]({{ site.baseurl }}/components/#glyphicons) (with appropriate alternative text using the `.sr-only` class - see the [Glyphicon examples]({{ site.baseurl }}/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 %}
|
{% endcallout %}
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
Here are some examples of the aforementioned classes in action. First up is your standard left-aligned fields with labels, help text, and validation messaging.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="form-group has-success">
|
<div class="form-group has-success">
|
||||||
<label class="col-form-label" for="inputSuccess1">Input with success</label>
|
<label class="form-control-label" for="inputSuccess1">Input with success</label>
|
||||||
<input type="text" class="form-control form-control-success" id="inputSuccess1">
|
<input type="text" class="form-control form-control-success" id="inputSuccess1">
|
||||||
<div class="form-control-feedback">Success! You've done it.</div>
|
<div class="form-control-feedback">Success! You've done it.</div>
|
||||||
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-warning">
|
<div class="form-group has-warning">
|
||||||
<label class="col-form-label" for="inputWarning1">Input with warning</label>
|
<label class="form-control-label" for="inputWarning1">Input with warning</label>
|
||||||
<input type="text" class="form-control form-control-warning" id="inputWarning1">
|
<input type="text" class="form-control form-control-warning" id="inputWarning1">
|
||||||
<div class="form-control-feedback">Shucks, check the formatting of that and try again.</div>
|
<div class="form-control-feedback">Shucks, check the formatting of that and try again.</div>
|
||||||
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-danger">
|
<div class="form-group has-danger">
|
||||||
<label class="col-form-label" for="inputDanger1">Input with danger</label>
|
<label class="form-control-label" for="inputDanger1">Input with danger</label>
|
||||||
<input type="text" class="form-control form-control-danger" id="inputDanger1">
|
<input type="text" class="form-control form-control-danger" id="inputDanger1">
|
||||||
<div class="form-control-feedback">Sorry, that username's taken. Try another?</div>
|
<div class="form-control-feedback">Sorry, that username's taken. Try another?</div>
|
||||||
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
Those same states can also be used with horizontal forms.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="container">
|
||||||
|
<form>
|
||||||
|
<div class="form-group row has-success">
|
||||||
|
<label for="inputHorizontalSuccess" class="col-sm-2 col-form-label">Email</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="email" class="form-control form-control-success" id="inputHorizontalSuccess" placeholder="name@example.com">
|
||||||
|
<div class="form-control-feedback">Success! You've done it.</div>
|
||||||
|
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row has-warning">
|
||||||
|
<label for="inputHorizontalWarning" class="col-sm-2 col-form-label">Email</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="email" class="form-control form-control-warning" id="inputHorizontalWarning" placeholder="name@example.com">
|
||||||
|
<div class="form-control-feedback">Shucks, check the formatting of that and try again.</div>
|
||||||
|
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row has-danger">
|
||||||
|
<label for="inputHorizontalDnger" class="col-sm-2 col-form-label">Email</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="email" class="form-control form-control-danger" id="inputHorizontalDnger" placeholder="name@example.com">
|
||||||
|
<div class="form-control-feedback">Sorry, that username's taken. Try another?</div>
|
||||||
|
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Checkboxes and radios are also supported.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="form-check has-success">
|
<div class="form-check has-success">
|
||||||
<label class="form-check-label">
|
<label class="form-check-label">
|
||||||
@ -845,7 +892,7 @@ Add other states to your custom forms with our validation classes.
|
|||||||
<span class="custom-control-description">Check this custom checkbox</span>
|
<span class="custom-control-description">Check this custom checkbox</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-danger m-b-0">
|
<div class="form-group has-danger mb-0">
|
||||||
<label class="custom-control custom-checkbox">
|
<label class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" class="custom-control-input">
|
<input type="checkbox" class="custom-control-input">
|
||||||
<span class="custom-control-indicator"></span>
|
<span class="custom-control-indicator"></span>
|
||||||
@ -886,8 +933,6 @@ Custom `<select>` menus need only a custom class, `.custom-select` to trigger th
|
|||||||
</select>
|
</select>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
Custom selects degrade nicely in IE9, receiving only a handful of overrides to remove the custom `background-image`. **Multiple selects (e.g., `<select multiple>`) are not currently supported.**
|
|
||||||
|
|
||||||
### File browser
|
### File browser
|
||||||
|
|
||||||
The file input is the most gnarly of the bunch and require additional JavaScript if you'd like to hook them up with functional *Choose file...* and selected file name text.
|
The file input is the most gnarly of the bunch and require additional JavaScript if you'd like to hook them up with functional *Choose file...* and selected file name text.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Input group
|
title: Input group
|
||||||
|
description: Extend form controls with the input group.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -114,7 +115,7 @@ Multiple add-ons are supported and can be mixed with checkbox and radio input ve
|
|||||||
|
|
||||||
## Button addons
|
## Button addons
|
||||||
|
|
||||||
Buttons in input groups are a bit different and require one extra level of nesting. Instead of `.input-group-addon`, you'll need to use `.input-group-btn` to wrap the buttons. This is required due to default browser styles that cannot be overridden.
|
Buttons in input groups must wrapped in a `.input-group-btn` for proper alignment and sizing. This is required due to default browser styles that cannot be overridden.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Jumbotron
|
title: Jumbotron
|
||||||
|
description: Lightweight, flexible component for showcasing hero unit style content.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ A lightweight, flexible component that can optionally extend the entire viewport
|
|||||||
<div class="jumbotron">
|
<div class="jumbotron">
|
||||||
<h1 class="display-3">Hello, world!</h1>
|
<h1 class="display-3">Hello, world!</h1>
|
||||||
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
|
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
|
||||||
<hr class="m-y-2">
|
<hr class="my-4">
|
||||||
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
|
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
|
||||||
<p class="lead">
|
<p class="lead">
|
||||||
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
|
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: List group
|
title: List group
|
||||||
|
description: Learn about Bootstrap's list group component for rendering series of related content.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.
|
List groups are a flexible and powerful component for displaying a series of content. List group items can be modified and extended to support just about any content within. They can also be used as navigation with the right modifier class.
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ List groups are a flexible and powerful component for displaying not only simple
|
|||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
## Basic example
|
## Basic example
|
||||||
The most basic list group is simply an unordered list with list items, and the proper classes. Build upon it with the options that follow, or your own CSS as needed.
|
The most basic list group is an unordered list with list items and the proper classes. Build upon it with the options that follow, or with your own CSS as needed.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
@ -24,46 +25,37 @@ The most basic list group is simply an unordered list with list items, and the p
|
|||||||
</ul>
|
</ul>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Tags
|
## Active items
|
||||||
|
|
||||||
Add tags to any list group item to show unread counts, activity, etc.
|
Add `.active` to a `.list-group-item` to indicate the current active selection.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item active">Cras justo odio</li>
|
||||||
<span class="tag tag-default tag-pill pull-xs-right">14</span>
|
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||||
Cras justo odio
|
<li class="list-group-item">Morbi leo risus</li>
|
||||||
</li>
|
<li class="list-group-item">Porta ac consectetur ac</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">Vestibulum at eros</li>
|
||||||
<span class="tag tag-default tag-pill pull-xs-right">2</span>
|
|
||||||
Dapibus ac facilisis in
|
|
||||||
</li>
|
|
||||||
<li class="list-group-item">
|
|
||||||
<span class="tag tag-default tag-pill pull-xs-right">1</span>
|
|
||||||
Morbi leo risus
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Disabled items
|
## Disabled items
|
||||||
|
|
||||||
Add `.disabled` to a `.list-group-item` to gray it out to appear disabled.
|
Add `.disabled` to a `.list-group-item` to make it _appear_ disabled. Note that some elements with `.disabled` will also require custom JavaScript to fully disable their click events (e.g., links).
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="list-group">
|
<ul class="list-group">
|
||||||
<a href="#" class="list-group-item disabled">
|
<li class="list-group-item disabled">Cras justo odio</li>
|
||||||
Cras justo odio
|
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||||
</a>
|
<li class="list-group-item">Morbi leo risus</li>
|
||||||
<a href="#" class="list-group-item">Dapibus ac facilisis in</a>
|
<li class="list-group-item">Porta ac consectetur ac</li>
|
||||||
<a href="#" class="list-group-item">Morbi leo risus</a>
|
<li class="list-group-item">Vestibulum at eros</li>
|
||||||
<a href="#" class="list-group-item">Porta ac consectetur ac</a>
|
</ul>
|
||||||
<a href="#" class="list-group-item">Vestibulum at eros</a>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Anchors and buttons
|
## Links and buttons
|
||||||
|
|
||||||
Use anchors or buttons to create actionable list group items with hover, disabled, and active states by adding `.list-group-item-action`. This separate class contains a few overrides to add compatibility for `<a>`s and `<button>`s, as well as the hover and focus states.
|
Use `<a>`s or `<button>`s to create _actionable_ list group items with hover, disabled, and active states by adding `.list-group-item-action`. We separate these pseudo-classes to ensure list groups made of non-interactive elements (like `<li>`s or `<div>`s) don't provide a click or tap affordance.
|
||||||
|
|
||||||
Be sure to **not use the standard `.btn` classes here**.
|
Be sure to **not use the standard `.btn` classes here**.
|
||||||
|
|
||||||
@ -79,6 +71,8 @@ Be sure to **not use the standard `.btn` classes here**.
|
|||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
With `<button>`s, you can also make use of the `disabled` attribute instead of the `.disabled` class. Sadly, `<a>`s don't support the disabled attribute.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
<button type="button" class="list-group-item list-group-item-action active">
|
<button type="button" class="list-group-item list-group-item-action active">
|
||||||
@ -87,16 +81,29 @@ Be sure to **not use the standard `.btn` classes here**.
|
|||||||
<button type="button" class="list-group-item list-group-item-action">Dapibus ac facilisis in</button>
|
<button type="button" class="list-group-item list-group-item-action">Dapibus ac facilisis in</button>
|
||||||
<button type="button" class="list-group-item list-group-item-action">Morbi leo risus</button>
|
<button type="button" class="list-group-item list-group-item-action">Morbi leo risus</button>
|
||||||
<button type="button" class="list-group-item list-group-item-action">Porta ac consectetur ac</button>
|
<button type="button" class="list-group-item list-group-item-action">Porta ac consectetur ac</button>
|
||||||
<button type="button" class="list-group-item list-group-item-action disabled">Vestibulum at eros</button>
|
<button type="button" class="list-group-item list-group-item-action" disabled>Vestibulum at eros</button>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Contextual classes
|
## Contextual classes
|
||||||
|
|
||||||
Use contextual classes to style list items, default or linked. Also includes `.active` state.
|
Use contextual classes to style list items with a stateful background and color.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||||
|
<li class="list-group-item list-group-item-success">Dapibus ac facilisis in</li>
|
||||||
|
<li class="list-group-item list-group-item-info">Cras sit amet nibh libero</li>
|
||||||
|
<li class="list-group-item list-group-item-warning">Porta ac consectetur ac</li>
|
||||||
|
<li class="list-group-item list-group-item-danger">Vestibulum at eros</li>
|
||||||
|
</ul>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Contextual classes also work with `.list-group-item-action`. Note the addition of the hover styles here not present in the previous example. Also supported is the `.active` state; apply it to indicate an active selection on a contextual list group item.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
|
<a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
|
||||||
<a href="#" class="list-group-item list-group-item-action list-group-item-success">Dapibus ac facilisis in</a>
|
<a href="#" class="list-group-item list-group-item-action list-group-item-success">Dapibus ac facilisis in</a>
|
||||||
<a href="#" class="list-group-item list-group-item-action list-group-item-info">Cras sit amet nibh libero</a>
|
<a href="#" class="list-group-item list-group-item-action list-group-item-info">Cras sit amet nibh libero</a>
|
||||||
<a href="#" class="list-group-item list-group-item-action list-group-item-warning">Porta ac consectetur ac</a>
|
<a href="#" class="list-group-item list-group-item-action list-group-item-warning">Porta ac consectetur ac</a>
|
||||||
@ -107,6 +114,27 @@ Use contextual classes to style list items, default or linked. Also includes `.a
|
|||||||
{% 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 }}
|
||||||
|
|
||||||
|
## With badges
|
||||||
|
|
||||||
|
Add badges to any list group item to show unread counts, activity, and more with the help of some utilities. Note the [`justify-content-between` utility class]({{ site.baseurl }}/layout/grid/#horizontal-alignment) and the badge's placement.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item justify-content-between">
|
||||||
|
Cras justo odio
|
||||||
|
<span class="badge badge-default badge-pill">14</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item justify-content-between">
|
||||||
|
Dapibus ac facilisis in
|
||||||
|
<span class="badge badge-default badge-pill">2</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item justify-content-between">
|
||||||
|
Morbi leo risus
|
||||||
|
<span class="badge badge-default badge-pill">1</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
## Custom content
|
## Custom content
|
||||||
|
|
||||||
Add nearly any HTML within, even for linked list groups like the one below.
|
Add nearly any HTML within, even for linked list groups like the one below.
|
||||||
@ -114,16 +142,16 @@ Add nearly any HTML within, even for linked list groups like the one below.
|
|||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
<a href="#" class="list-group-item list-group-item-action active">
|
<a href="#" class="list-group-item list-group-item-action active">
|
||||||
<h5 class="list-group-item-heading">List group item heading</h5>
|
<h5 class="mt-0 mb-1">List group item heading</h5>
|
||||||
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
|
<small>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</small>
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="list-group-item list-group-item-action">
|
<a href="#" class="list-group-item list-group-item-action">
|
||||||
<h5 class="list-group-item-heading">List group item heading</h5>
|
<h5 class="mt-0 mb-1">List group item heading</h5>
|
||||||
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
|
<small>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</small>
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="list-group-item list-group-item-action">
|
<a href="#" class="list-group-item list-group-item-action">
|
||||||
<h5 class="list-group-item-heading">List group item heading</h5>
|
<h5 class="mt-0 mb-1">List group item heading</h5>
|
||||||
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
|
<small>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</small>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
@ -1,17 +1,32 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Modal
|
title: Modal
|
||||||
|
description: Learn how to use Bootstrap's modals to add dialog prompts to your site.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.
|
Modals are streamlined, but flexible dialog prompts powered by JavaScript. They support a number of use cases from user notification to completely custom content and feature a handful of helpful subcomponents, sizes, and more.
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
* Will be replaced with the ToC, excluding the "Contents" header
|
* Will be replaced with the ToC, excluding the "Contents" header
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
**Due to how HTML5 defines its semantics, [the `autofocus` HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autofocus) has no effect in Bootstrap modals.** To achieve the same effect, use some custom JavaScript:
|
## How it works
|
||||||
|
|
||||||
|
Before getting started with Bootstrap's modal component, be sure to read the following as our menu options have recently changed.
|
||||||
|
|
||||||
|
- Modals are built with HTML, CSS, and JavaScript. They're positioned over everything else in the document and remove scroll from the `<body>` so that modal content scrolls instead.
|
||||||
|
- Clicking on the modal "backdrop" will automatically close the modal.
|
||||||
|
- Bootstrap only supports one modal window at a time. Nested modals aren't supported as we believe them to be poor user experiences.
|
||||||
|
- Modal's use `position: fixed`, which can sometimes be a bit particular about it's rendering. Whenever possible, place your modal HTML in a top-level position to avoid potential interference from other elements. You'll likely run into issues when nesting a `.modal` within another fixed element.
|
||||||
|
- One again, due to `position: fixed`, there are some caveats with using modals on mobile devices. [See our browser support docs]({{ site.baseurl }}/getting-started/browsers-devices/#modals-and-dropdowns-on-mobile) for details.
|
||||||
|
- Lastly, the `autofocus` HTML attribute has no affect in modals. Here's how you can achieve the same effect with custom JavaScript.
|
||||||
|
|
||||||
|
Keep reading for demos and usage guidelines.
|
||||||
|
|
||||||
|
|
||||||
|
- Due to how HTML5 defines its semantics, [the `autofocus` HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autofocus) has no effect in Bootstrap modals. To achieve the same effect, use some custom JavaScript:
|
||||||
|
|
||||||
{% highlight js %}
|
{% highlight js %}
|
||||||
$('#myModal').on('shown.bs.modal', function () {
|
$('#myModal').on('shown.bs.modal', function () {
|
||||||
@ -19,48 +34,32 @@ $('#myModal').on('shown.bs.modal', function () {
|
|||||||
})
|
})
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
{% callout warning %}
|
## Examples
|
||||||
#### Multiple open modals not supported
|
|
||||||
|
|
||||||
Be sure not to open a modal while another is still visible. Showing more than one modal at a time requires custom code.
|
### Modal components
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
{% callout warning %}
|
Below is a _static_ modal example (meaning its `position` and `display` have been overridden). Included are the modal header, modal body (required for `padding`), and modal footer (optional). We ask that you include modal headers with dismiss actions whenever possible, or provide another explicit dismiss action.
|
||||||
#### Modal markup placement
|
|
||||||
|
|
||||||
Always try to place a modal's HTML code in a top-level position in your document to avoid other components affecting the modal's appearance and/or functionality.
|
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
{% callout warning %}
|
|
||||||
#### Mobile device caveats
|
|
||||||
|
|
||||||
There are some caveats regarding using modals on mobile devices. [See our browser support docs]({{ site.baseurl }}/getting-started/browsers-devices/#modals-and-dropdowns-on-mobile) for details.
|
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
### Static example
|
|
||||||
|
|
||||||
A rendered modal with header, body, and set of actions in the footer.
|
|
||||||
|
|
||||||
<div class="bd-example bd-example-modal">
|
<div class="bd-example bd-example-modal">
|
||||||
<div class="modal">
|
<div class="modal">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Modal title</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Modal title</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>One fine body…</p>
|
<p>Modal body text goes here.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-primary">Save changes</button>
|
<button type="button" class="btn btn-primary">Save changes</button>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div>
|
||||||
</div><!-- /.modal-dialog -->
|
</div>
|
||||||
</div><!-- /.modal -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
@ -68,90 +67,68 @@ A rendered modal with header, body, and set of actions in the footer.
|
|||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Modal title</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Modal title</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>One fine body…</p>
|
<p>Modal body text goes here.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
||||||
<button type="button" class="btn btn-primary">Save changes</button>
|
<button type="button" class="btn btn-primary">Save changes</button>
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
|
||||||
</div><!-- /.modal-dialog -->
|
|
||||||
</div><!-- /.modal -->
|
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
### Live demo
|
### Live demo
|
||||||
|
|
||||||
Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.
|
Toggle a working modal demo by clicking the button below. It will slide down and fade in from the top of the page.
|
||||||
|
|
||||||
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<div id="exampleModalLive" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLiveLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLiveLabel">Modal title</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<h4>Text in a modal</h4>
|
<p>Woohoo, you're reading this text in a modal!</p>
|
||||||
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
|
|
||||||
|
|
||||||
<h4>Popover in a modal</h4>
|
|
||||||
<p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">button</a> should trigger a popover on click.</p>
|
|
||||||
|
|
||||||
<h4>Tooltips in a modal</h4>
|
|
||||||
<p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> should have tooltips on hover.</p>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h4>Overflowing text to show scroll behavior</h4>
|
|
||||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
|
||||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
|
||||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
|
||||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
|
||||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
|
||||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
|
||||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
|
||||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
|
||||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-primary">Save changes</button>
|
<button type="button" class="btn btn-primary">Save changes</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div>
|
||||||
</div><!-- /.modal-dialog -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bd-example" style="padding-bottom: 24px;">
|
<div class="bd-example">
|
||||||
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLive">
|
||||||
Launch demo modal
|
Launch demo modal
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<!-- Button trigger modal -->
|
<!-- Button trigger modal -->
|
||||||
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
|
||||||
Launch demo modal
|
Launch demo modal
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
...
|
...
|
||||||
@ -165,19 +142,283 @@ Toggle a modal via JavaScript by clicking the button below. It will slide down a
|
|||||||
</div>
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
{% callout warning %}
|
### Scrolling long content
|
||||||
#### Make modals accessible
|
|
||||||
|
|
||||||
Be sure to add `role="dialog"` and `aria-labelledby="..."`, referencing the modal title, to `.modal`, and `role="document"` to the `.modal-dialog` itself.
|
When modals become too long for the user's viewport or device, they scroll independent of the page itself. Try the demo below to see what we mean.
|
||||||
|
|
||||||
Additionally, you may give a description of your modal dialog with `aria-describedby` on `.modal`.
|
<div id="exampleModalLong" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
|
||||||
{% endcallout %}
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||||
|
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||||
|
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||||
|
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||||
|
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||||
|
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||||
|
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||||
|
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||||
|
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||||
|
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||||
|
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||||
|
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||||
|
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||||
|
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||||
|
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||||
|
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||||
|
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||||
|
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
<button type="button" class="btn btn-primary">Save changes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% callout info %}
|
<div class="bd-example">
|
||||||
#### Embedding YouTube videos
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong">
|
||||||
|
Launch demo modal
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% highlight html %}
|
||||||
|
<!-- Button trigger modal -->
|
||||||
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong">
|
||||||
|
Launch demo modal
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
<button type="button" class="btn btn-primary">Save changes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
### Tooltips and popovers
|
||||||
|
|
||||||
|
[Tooltips]({{ site.baseurl }}/components/tooltips/) and [popovers]({{ site.baseurl }}/components/popovers/) can be placed within modals as needed. When modals are closed, any tooltips and popovers within are also automatically dismissed.
|
||||||
|
|
||||||
|
<div id="exampleModalPopovers" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalPopoversLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalPopoversLabel">Modal title</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<h5>Popover in a modal</h5>
|
||||||
|
<p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="Popover title" data-content="Popover body content is set in this attribute.">button</a> triggers a popover on click.</p>
|
||||||
|
<hr>
|
||||||
|
<h5>Tooltips in a modal</h5>
|
||||||
|
<p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> have tooltips on hover.</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
<button type="button" class="btn btn-primary">Save changes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bd-example">
|
||||||
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalPopovers">
|
||||||
|
Launch demo modal
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% highlight html %}
|
||||||
|
<div class="modal-body">
|
||||||
|
<h5>Popover in a modal</h5>
|
||||||
|
<p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="Popover title" data-content="Popover body content is set in this attribute.">button</a> triggers a popover on click.</p>
|
||||||
|
<hr>
|
||||||
|
<h5>Tooltips in a modal</h5>
|
||||||
|
<p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> have tooltips on hover.</p>
|
||||||
|
</div>
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
### Using the grid
|
||||||
|
|
||||||
|
Utilize the Bootstrap grid system within a modal by nesting `.container-fluid` within the `.modal-body`. Then, use the normal grid system classes as you would anywhere else.
|
||||||
|
|
||||||
|
<div id="gridSystemModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="gridModalLabel">Grids in modals</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="container-fluid bd-example-row">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">.col-md-4</div>
|
||||||
|
<div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
|
||||||
|
<div class="col-md-2 col-md-offset-4">.col-md-2 .col-md-offset-4</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-9">
|
||||||
|
Level 1: .col-sm-9
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8 col-sm-6">
|
||||||
|
Level 2: .col-8 .col-sm-6
|
||||||
|
</div>
|
||||||
|
<div class="col-4 col-sm-6">
|
||||||
|
Level 2: .col-4 .col-sm-6
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
<button type="button" class="btn btn-primary">Save changes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bd-example">
|
||||||
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#gridSystemModal">
|
||||||
|
Launch demo modal
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% highlight html %}
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">.col-md-4</div>
|
||||||
|
<div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
|
||||||
|
<div class="col-md-2 col-md-offset-4">.col-md-2 .col-md-offset-4</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-9">
|
||||||
|
Level 1: .col-sm-9
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8 col-sm-6">
|
||||||
|
Level 2: .col-8 .col-sm-6
|
||||||
|
</div>
|
||||||
|
<div class="col-4 col-sm-6">
|
||||||
|
Level 2: .col-4 .col-sm-6
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
### Varying modal content
|
||||||
|
|
||||||
|
Have a bunch of buttons that all trigger the same modal with slightly different contents? Use `event.relatedTarget` and [HTML `data-*` attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) (possibly [via jQuery](https://api.jquery.com/data/)) to vary the contents of the modal depending on which button was clicked.
|
||||||
|
|
||||||
|
Below is a live demo followed by example HTML and JavaScript. For more information, [read the modal events docs](#events) for details on `relatedTarget`.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Open modal for @mdo</button>
|
||||||
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat">Open modal for @fat</button>
|
||||||
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap">Open modal for @getbootstrap</button>
|
||||||
|
|
||||||
|
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLabel">New message</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="recipient-name" class="form-control-label">Recipient:</label>
|
||||||
|
<input type="text" class="form-control" id="recipient-name">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="message-text" class="form-control-label">Message:</label>
|
||||||
|
<textarea class="form-control" id="message-text"></textarea>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
<button type="button" class="btn btn-primary">Send message</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
{% highlight js %}
|
||||||
|
$('#exampleModal').on('show.bs.modal', function (event) {
|
||||||
|
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||||
|
var recipient = button.data('whatever') // Extract info from data-* attributes
|
||||||
|
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
|
||||||
|
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
|
||||||
|
var modal = $(this)
|
||||||
|
modal.find('.modal-title').text('New message to ' + recipient)
|
||||||
|
modal.find('.modal-body input').val(recipient)
|
||||||
|
})
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
### Remove animation
|
||||||
|
|
||||||
|
For modals that simply appear rather than fade in to view, remove the `.fade` class from your modal markup.
|
||||||
|
|
||||||
|
{% highlight html %}
|
||||||
|
<div class="modal" tabindex="-1" role="dialog" aria-labelledby="..." aria-hidden="true">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
### Dynamic heights
|
||||||
|
|
||||||
|
If the height of a modal changes while it is open, you should call `$('#myModal').data('bs.modal').handleUpdate()` to readjust the modal's position in case a scrollbar appears.
|
||||||
|
|
||||||
|
### Accessibility
|
||||||
|
|
||||||
|
Be sure to add `role="dialog"` and `aria-labelledby="..."`, referencing the modal title, to `.modal`, and `role="document"` to the `.modal-dialog` itself. Additionally, you may give a description of your modal dialog with `aria-describedby` on `.modal`.
|
||||||
|
|
||||||
|
### Embedding YouTube videos
|
||||||
|
|
||||||
Embedding YouTube videos in modals requires additional JavaScript not in Bootstrap to automatically stop playback and more. [See this helpful Stack Overflow post](https://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal) for more information.
|
Embedding YouTube videos in modals requires additional JavaScript not in Bootstrap to automatically stop playback and more. [See this helpful Stack Overflow post](https://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal) for more information.
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
## Optional sizes
|
## Optional sizes
|
||||||
|
|
||||||
@ -217,10 +458,10 @@ Modals have two optional sizes, available via modifier classes to be placed on a
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="myLargeModalLabel">Large modal</h4>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="myLargeModalLabel">Large modal</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
...
|
...
|
||||||
@ -232,139 +473,18 @@ Modals have two optional sizes, available via modifier classes to be placed on a
|
|||||||
<div class="modal fade bd-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
<div class="modal fade bd-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-sm">
|
<div class="modal-dialog modal-sm">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<h4 class="modal-title" id="mySmallModalLabel">Small modal</h4>
|
<h4 class="modal-title" id="mySmallModalLabel">Small modal</h4>
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
...
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Remove animation
|
|
||||||
|
|
||||||
For modals that simply appear rather than fade in to view, remove the `.fade` class from your modal markup.
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<div class="modal" tabindex="-1" role="dialog" aria-labelledby="..." aria-hidden="true">
|
|
||||||
...
|
|
||||||
</div>
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
## Using the grid system
|
|
||||||
|
|
||||||
To take advantage of the Bootstrap grid system within a modal, just nest `.container-fluid` within the `.modal-body` and then use the normal grid system classes within this container.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div id="gridSystemModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
||||||
<h4 class="modal-title" id="gridModalLabel">Modal title</h4>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="container-fluid bd-example-row">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4">.col-md-4</div>
|
|
||||||
<div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
|
|
||||||
<div class="col-md-2 col-md-offset-4">.col-md-2 .col-md-offset-4</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-9">
|
|
||||||
Level 1: .col-sm-9
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-8 col-sm-6">
|
|
||||||
Level 2: .col-xs-8 .col-sm-6
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-4 col-sm-6">
|
|
||||||
Level 2: .col-xs-4 .col-sm-6
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
||||||
<button type="button" class="btn btn-primary">Save changes</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="bd-example bd-example-padded-bottom">
|
|
||||||
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#gridSystemModal">
|
|
||||||
Launch demo modal
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Varying modal content based on trigger button
|
|
||||||
|
|
||||||
Have a bunch of buttons that all trigger the same modal, just with slightly different contents? Use `event.relatedTarget` and [HTML `data-*` attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) (possibly [via jQuery](https://api.jquery.com/data/)) to vary the contents of the modal depending on which button was clicked. See the Modal Events docs for details on `relatedTarget`.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="bd-example">
|
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Open modal for @mdo</button>
|
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat">Open modal for @fat</button>
|
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap">Open modal for @getbootstrap</button>
|
|
||||||
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form>
|
...
|
||||||
<div class="form-group">
|
|
||||||
<label for="recipient-name" class="form-control-label">Recipient:</label>
|
|
||||||
<input type="text" class="form-control" id="recipient-name">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="message-text" class="form-control-label">Message:</label>
|
|
||||||
<textarea class="form-control" id="message-text"></textarea>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
||||||
<button type="button" class="btn btn-primary">Send message</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
{% highlight js %}
|
|
||||||
$('#exampleModal').on('show.bs.modal', function (event) {
|
|
||||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
|
||||||
var recipient = button.data('whatever') // Extract info from data-* attributes
|
|
||||||
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
|
|
||||||
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
|
|
||||||
var modal = $(this)
|
|
||||||
modal.find('.modal-title').text('New message to ' + recipient)
|
|
||||||
modal.find('.modal-body input').val(recipient)
|
|
||||||
})
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
## Modals with dynamic heights
|
|
||||||
|
|
||||||
If the height of a modal changes while it is open, you should call `$('#myModal').data('bs.modal').handleUpdate()` to readjust the modal's position in case a scrollbar appears.
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -411,6 +531,12 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>true</td>
|
<td>true</td>
|
||||||
<td>Closes the modal when escape key is pressed</td>
|
<td>Closes the modal when escape key is pressed</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>focus</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>true</td>
|
||||||
|
<td>Puts the focus on the modal when initialized.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>show</td>
|
<td>show</td>
|
||||||
<td>boolean</td>
|
<td>boolean</td>
|
||||||
|
@ -1,56 +1,67 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Navbar
|
title: Navbar
|
||||||
|
description: Documentation and examples for Bootstrap's powerful, responsive navigation header.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
The navbar is a simple wrapper for positioning branding, navigation, and other elements into a concise navigation header. It's easily extensible and, with the help of our collapse plugin, it can easily integrate offscreen content.
|
The navbar is a wrapper that positions branding, navigation, and other elements in a concise header. It's easily extensible and, thanks to our Collapse plugin, can easily integrate responsive behaviors.
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
* Will be replaced with the ToC, excluding the "Contents" header
|
* Will be replaced with the ToC, excluding the "Contents" header
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
## Basics
|
## How it works
|
||||||
|
|
||||||
Here's what you need to know before getting started with the navbar:
|
Here's what you need to know before getting started with the navbar:
|
||||||
|
|
||||||
- Navbars require a wrapping `.navbar` and a [color scheme](#color-schemes).
|
- Navbars require a wrapping `.navbar` and [color scheme](#color-schemes) classes.
|
||||||
- Navbars and their contents are fluid by default. Use [optional containers](#containers) to limit their horizontal width.
|
- Navbars and their contents are fluid by default. Use [optional containers](#containers) to limit their horizontal width.
|
||||||
- Use `.pull-*-left` and `.pull-*-right` to quickly align sub-components.
|
- Navbars and their contents are built with flexbox, providing easy alignment options via utility classes.
|
||||||
|
- Navbars are responsive by default, but you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin.
|
||||||
- Ensure accessibility by using a `<nav>` element or, if using a more generic element such as a `<div>`, add a `role="navigation"` to every navbar to explicitly identify it as a landmark region for users of assistive technologies.
|
- Ensure accessibility by using a `<nav>` element or, if using a more generic element such as a `<div>`, add a `role="navigation"` to every navbar to explicitly identify it as a landmark region for users of assistive technologies.
|
||||||
|
|
||||||
|
Read on for an example and list of supported sub-components.
|
||||||
|
|
||||||
## Supported content
|
## Supported content
|
||||||
|
|
||||||
Navbars come with built-in support for a handful of sub-components. Mix and match from the following as you need:
|
Navbars come with built-in support for a handful of sub-components. Choose from the following as needed:
|
||||||
|
|
||||||
- `.navbar-brand` for your company, product, or project name
|
- `.navbar-brand` for your company, product, or project name
|
||||||
- `.navbar-nav` for a full-height and lightweight navigation (including support for dropdowns)
|
- `.navbar-nav` for a full-height and lightweight navigation (including support for dropdowns)
|
||||||
- `.navbar-toggler` for use with our collapse plugin and other [navigation toggling](#collapsing-content) behaviors.
|
- `.navbar-toggler` for use with our collapse plugin and other [navigation toggling](#collapsible-content) behaviors.
|
||||||
|
- Inline forms with `.float-` utilities for form controls and components.
|
||||||
|
- `.navbar-text` for adding vertically centered strings of text.
|
||||||
|
- `.form-inline` for form controls and more.
|
||||||
|
- `.collapse.navbar-collapse` for grouping and hiding navbar contents by a parent breakpoint.
|
||||||
|
|
||||||
Here's an example of all the sub-components included in a default, light navbar:
|
Here's an example of all the sub-components included in a responsive light-themed navbar.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light navbar-toggleable-md bg-faded">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
<a class="navbar-brand" href="#">Navbar</a>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Features</a>
|
<a class="nav-link" href="#">Link</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Pricing</a>
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">About</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form class="form-inline pull-xs-right">
|
<form class="form-inline my-2 my-lg-0">
|
||||||
<input class="form-control" type="text" placeholder="Search">
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
<button class="btn btn-outline-success" type="submit">Search</button>
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
@ -59,22 +70,51 @@ Here's an example of all the sub-components included in a default, light navbar:
|
|||||||
The `.navbar-brand` can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles.
|
The `.navbar-brand` can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
|
<!-- As a link -->
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light bg-faded">
|
||||||
<a class="navbar-brand" href="#">Navbar</a>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<!-- As a heading -->
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light bg-faded">
|
||||||
<h1 class="navbar-brand m-b-0">Navbar</h1>
|
<h1 class="navbar-brand mb-0">Navbar</h1>
|
||||||
</nav>
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Adding images to the `.navbar-brand` will likely always require custom styles or utilities to properly size. Here are some examples to demonstrate.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<!-- Just an image -->
|
||||||
|
<nav class="navbar navbar-light bg-faded">
|
||||||
|
<a class="navbar-brand" href="#">
|
||||||
|
<img src="{{ site.baseurl }}/assets/brand/bootstrap-solid.svg" width="30" height="30" alt="">
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<!-- Image and text -->
|
||||||
|
<nav class="navbar navbar-light bg-faded">
|
||||||
|
<a class="navbar-brand" href="#">
|
||||||
|
<img src="{{ site.baseurl }}/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="">
|
||||||
|
Bootstrap
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
### Nav
|
### Nav
|
||||||
|
|
||||||
Navbar navigation is similar to our regular nav options—use the `.nav` base class with a modifier to achieve a particular look. In this case you'll want `.nav.navbar-nav`.
|
Navbar navigation links build on our `.nav` options with their own modifier class and require the use of [toggler classes](#toggler) for proper responsive styling. **Navigation in navbars will also grow to occupy as much horizontal space as possible** to keep your navbar contents securely aligned.
|
||||||
|
|
||||||
|
Active states—with `.active`—to indicate the current page can be applied directly to `.nav-link`s or their immediate parent `.nav-item`s.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light navbar-toggleable-md bg-faded">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
@ -86,35 +126,166 @@ Navbar navigation is similar to our regular nav options—use the `.nav` base cl
|
|||||||
<a class="nav-link" href="#">Pricing</a>
|
<a class="nav-link" href="#">Pricing</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">About</a>
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
And because we use classes for our navs, you can avoid the list-based approach entirely if you like.
|
And because we use classes for our navs, you can avoid the list-based approach entirely if you like.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light navbar-toggleable-md bg-faded">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||||
<div class="nav navbar-nav">
|
<div class="nav navbar-nav">
|
||||||
<a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
<a class="nav-item nav-link" href="#">Features</a>
|
<a class="nav-item nav-link" href="#">Features</a>
|
||||||
<a class="nav-item nav-link" href="#">Pricing</a>
|
<a class="nav-item nav-link" href="#">Pricing</a>
|
||||||
<a class="nav-item nav-link" href="#">About</a>
|
<a class="nav-item nav-link disabled" href="#">Disabled</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
You may also utilize dropdowns in your navbar nav. Dropdown menus require a wrapping element for positioning, so be sure to use separate and nested elements for `.nav-item` and `.nav-link` as shown below.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light navbar-toggleable-md bg-faded">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li class="nav-item active">
|
||||||
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Features</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Pricing</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
Dropdown link
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
<a class="dropdown-item" href="#">Action</a>
|
||||||
|
<a class="dropdown-item" href="#">Another action</a>
|
||||||
|
<a class="dropdown-item" href="#">Something else here</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Forms
|
||||||
|
|
||||||
|
Place various form controls and components within a navbar with `.form-inline`.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light bg-faded">
|
||||||
|
<form class="form-inline">
|
||||||
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Align the contents of your inline forms with utilities as needed.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light bg-faded justify-content-between">
|
||||||
|
<a class="navbar-brand">Navbar</a>
|
||||||
|
<form class="form-inline">
|
||||||
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Input groups work, too:
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light bg-faded">
|
||||||
|
<form class="form-inline">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon" id="basic-addon1">@</span>
|
||||||
|
<input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Various buttons are supported as part of these navbar forms, too. This is also a great reminder that vertical alignment utilities can be used to align different sized elements.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light bg-faded">
|
||||||
|
<form class="form-inline">
|
||||||
|
<button class="btn btn-outline-success" type="button">Main button</button>
|
||||||
|
<button class="btn btn-sm align-middle btn-outline-secondary" type="button">Smaller button</button>
|
||||||
|
</form>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Text
|
||||||
|
|
||||||
|
Navbars may contain bits of text with the help of `.navbar-text`. This class adjusts vertical alignment and horizontal spacing for strings of text.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light bg-faded">
|
||||||
|
<span class="navbar-text">
|
||||||
|
Navbar text with an inline element
|
||||||
|
</span>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
Mix and match with other components and utilities as needed.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light navbar-toggleable-md bg-faded">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="#">Navbar w/ text</a>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarText">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li class="nav-item active">
|
||||||
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Features</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Pricing</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<span class="navbar-text">
|
||||||
|
Navbar text with an inline element
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
## Color schemes
|
## Color schemes
|
||||||
|
|
||||||
Theming the navbar has never been easier thanks to the combination of a simple link color modifier class and `background-color` utilities. Put another way, you specify light or dark and apply a background color.
|
Theming the navbar has never been easier thanks to the combination of theming classes and `background-color` utilities. Choose from `.navbar-light` for use with light background colors, or `.navbar-inverse` for dark background colors. Then, customize with `.bg-*` utilities.
|
||||||
|
|
||||||
Here are some examples to show what we mean.
|
|
||||||
|
|
||||||
<div class="bd-example">
|
<div class="bd-example">
|
||||||
<nav class="navbar navbar-dark bg-inverse">
|
<nav class="navbar navbar-inverse navbar-toggleable-md bg-inverse">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
<a class="navbar-brand" href="#">Navbar</a>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarColor01">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
@ -129,13 +300,20 @@ Here are some examples to show what we mean.
|
|||||||
<a class="nav-link" href="#">About</a>
|
<a class="nav-link" href="#">About</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form class="form-inline pull-xs-right">
|
<form class="form-inline">
|
||||||
<input class="form-control" type="text" placeholder="Search">
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
<button class="btn btn-outline-info" type="submit">Search</button>
|
<button class="btn btn-outline-info my-2 my-sm-0" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<nav class="navbar navbar-dark bg-primary">
|
|
||||||
|
<nav class="navbar navbar-inverse navbar-toggleable-md bg-primary">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
<a class="navbar-brand" href="#">Navbar</a>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarColor02">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
@ -150,13 +328,20 @@ Here are some examples to show what we mean.
|
|||||||
<a class="nav-link" href="#">About</a>
|
<a class="nav-link" href="#">About</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form class="form-inline pull-xs-right">
|
<form class="form-inline">
|
||||||
<input class="form-control" type="text" placeholder="Search">
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
<button class="btn btn-outline-secondary" type="submit">Search</button>
|
<button class="btn btn-outline-secondary my-2 my-sm-0" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<nav class="navbar navbar-light" style="background-color: #e3f2fd;">
|
|
||||||
|
<nav class="navbar navbar-light navbar-toggleable-md" style="background-color: #e3f2fd;">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
<a class="navbar-brand" href="#">Navbar</a>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarColor03">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
@ -171,19 +356,20 @@ Here are some examples to show what we mean.
|
|||||||
<a class="nav-link" href="#">About</a>
|
<a class="nav-link" href="#">About</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form class="form-inline pull-xs-right">
|
<form class="form-inline">
|
||||||
<input class="form-control" type="text" placeholder="Search">
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
<button class="btn btn-outline-primary" type="submit">Search</button>
|
<button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<nav class="navbar navbar-dark bg-inverse">
|
<nav class="navbar navbar-inverse bg-inverse">
|
||||||
<!-- Navbar content -->
|
<!-- Navbar content -->
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<nav class="navbar navbar-dark bg-primary">
|
<nav class="navbar navbar-inverse bg-primary">
|
||||||
<!-- Navbar content -->
|
<!-- Navbar content -->
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
@ -198,14 +384,16 @@ Although it's not required, you can wrap a navbar in a `.container` to center it
|
|||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light bg-faded navbar-toggleable-md">
|
||||||
<a class="navbar-brand" href="#">Navbar</a>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
When the container is within your navbar, its horizontal padding is removed at breakpoints lower than your specified `.navbar-toggleable-*` class. This ensures we're not doubling up on padding unnecessarily on lower viewports when your navbar is collapsed.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light bg-faded navbar-toggleable-md">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="#">Navbar</a>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
</div>
|
</div>
|
||||||
@ -217,7 +405,7 @@ Although it's not required, you can wrap a navbar in a `.container` to center it
|
|||||||
Navbars can be statically placed (their default behavior), static without rounded corners, or fixed to the top or bottom of the viewport.
|
Navbars can be statically placed (their default behavior), static without rounded corners, or fixed to the top or bottom of the viewport.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="navbar navbar-full navbar-light bg-faded">
|
<nav class="navbar navbar-light bg-faded">
|
||||||
<a class="navbar-brand" href="#">Full width</a>
|
<a class="navbar-brand" href="#">Full width</a>
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
@ -234,48 +422,87 @@ Navbars can be statically placed (their default behavior), static without rounde
|
|||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
## Responsive behaviors
|
||||||
|
|
||||||
## Collapsible content
|
Navbars can utilize `.navbar-toggler`, `.navbar-collapse`, and `.navbar-toggleable-*` classes to change when their content collapses behind a button. In combination with other utilities, you can easily choose when to show or hide particular elements.
|
||||||
|
|
||||||
Our collapse plugin allows you to use a `<button>` or `<a>` to toggle hidden content.
|
### Toggler
|
||||||
|
|
||||||
|
Navbar togglers can be left or right aligned with `.navbar-toggler-left` or `.navbar-toggler-right` modifiers. These are absolutely positioned within the navbar to avoid interference with the collapsed state. You can also use your own styles to position togglers. Below are examples of different toggle styles.
|
||||||
|
|
||||||
|
With no `.navbar-brand` shown in lowest breakpoint:
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="navbar navbar-light bg-faded">
|
<nav class="navbar navbar-light navbar-toggleable-md bg-faded">
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar" aria-controls="exCollapsingNavbar" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
☰
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="collapse" id="exCollapsingNavbar">
|
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
|
||||||
<div class="bg-inverse p-a-1">
|
<a class="navbar-brand" href="#">Hidden brand</a>
|
||||||
<h4>Collapsed content</h4>
|
<ul class="nav navbar-nav mt-2 mt-lg-0">
|
||||||
<span class="text-muted">Toggleable via the navbar brand.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
For more complex navbar patterns, like those used in Bootstrap v3, use the `.navbar-toggleable-*` classes in conjunction with the `.navbar-toggler`. These classes override our responsive utilities to show navigation only when content is meant to be shown.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<nav class="navbar navbar-light bg-faded">
|
|
||||||
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2" aria-controls="exCollapsingNavbar2" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
☰
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar2">
|
|
||||||
<a class="navbar-brand" href="#">Responsive navbar</a>
|
|
||||||
<ul class="nav navbar-nav">
|
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Features</a>
|
<a class="nav-link" href="#">Link</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Pricing</a>
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">About</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<form class="form-inline my-2 my-lg-0">
|
||||||
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
With a brand name shown on the left and toggler on the right:
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="navbar navbar-light navbar-toggleable-md bg-faded">
|
||||||
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
|
||||||
|
<ul class="nav navbar-nav mt-2 mt-md-0">
|
||||||
|
<li class="nav-item active">
|
||||||
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<form class="form-inline my-2 my-lg-0">
|
||||||
|
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||||
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### External content
|
||||||
|
|
||||||
|
Sometimes you want to use the collapse plugin to trigger hidden content elsewhere on the page. Because our plugin works on the `id` and `data-target` matching, that's easily done!
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<div class="pos-f-t">
|
||||||
|
<div class="collapse" id="navbarToggleExternalContent">
|
||||||
|
<div class="bg-inverse p-4">
|
||||||
|
<h4 class="text-white">Collapsed content</h4>
|
||||||
|
<span class="text-muted">Toggleable via the navbar brand.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<nav class="navbar navbar-inverse bg-inverse">
|
||||||
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
{% endexample %}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Navs
|
title: Navs
|
||||||
|
description: Documentation and examples for how to use Bootstrap's included navigation components.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -11,13 +12,9 @@ Navigation available in Bootstrap share general markup and styles, from the base
|
|||||||
* Will be replaced with the ToC, excluding the "Contents" header
|
* Will be replaced with the ToC, excluding the "Contents" header
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
## Regarding accessibility
|
|
||||||
|
|
||||||
If you are using navs to provide a navigation bar, be sure to add a `role="navigation"` to the most logical parent container of the `<ul>`, or wrap a `<nav>` element around the whole navigation. Do not add the role to the `<ul>` itself, as this would prevent it from being announced as an actual list by assistive technologies.
|
|
||||||
|
|
||||||
## Base nav
|
## Base nav
|
||||||
|
|
||||||
Roll your own navigation style by extending the base `.nav` component. All Bootstrap's nav components are built on top of this by specifying additional styles. Includes styles for the disabled state, but **not the active state**.
|
The base `.nav` component is built with flexbox and provide a strong foundation for building all types of navigation components. It includes some style overrides (for working with lists), some link padding for larger hit areas, and basic disabled styling. No active states are included in the base nav.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
@ -36,7 +33,7 @@ Roll your own navigation style by extending the base `.nav` component. All Boots
|
|||||||
</ul>
|
</ul>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, or roll your own with say a `<nav>` element. The change in nav item display below **is intentional** as `<li>`s have a different default `display` than regular `<a>` elements.
|
Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, or roll your own with say a `<nav>` element. Because the `.nav` uses `display: flex`, the nav links behave the same as nav items would, but without the extra markup.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
@ -47,23 +44,18 @@ Classes are used throughout, so your markup can be super flexible. Use `<ul>`s l
|
|||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Inline
|
## Available styles
|
||||||
|
|
||||||
Space out nav links in a horizontal band with `.nav-inline`. Longer series of links will wrap to a new line.
|
Change the style of `.nav`s component with modifiers and utilities. Mix and match as needed, or build your own.
|
||||||
|
|
||||||
|
### Horizontal alignment
|
||||||
|
|
||||||
|
Change the horizontal alignment of your nav with [flexbox utilities]({{ site.baseurl }}/layout/grid/#horizontal-alignment). By default, navs are left-aligned, but you can easily change them to center or right aligned.
|
||||||
|
|
||||||
|
Centered with `.justify-content-center`:
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="nav nav-inline">
|
<ul class="nav justify-content-center">
|
||||||
<a class="nav-link active" href="#">Active</a>
|
|
||||||
<a class="nav-link" href="#">Link</a>
|
|
||||||
<a class="nav-link" href="#">Link</a>
|
|
||||||
<a class="nav-link disabled" href="#">Disabled</a>
|
|
||||||
</nav>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
The same works for a navigation built with lists.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<ul class="nav nav-inline">
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" href="#">Active</a>
|
<a class="nav-link active" href="#">Active</a>
|
||||||
</li>
|
</li>
|
||||||
@ -79,7 +71,58 @@ The same works for a navigation built with lists.
|
|||||||
</ul>
|
</ul>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Tabs
|
Right-aligned with `.justify-content-end`:
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<ul class="nav justify-content-end">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" href="#">Active</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Vertical
|
||||||
|
|
||||||
|
Stack your navigation by changing the flex item direction with the `.flex-column` utility. Need to stack them on some viewports but not others? Use the responsive versions (e.g., `.flex-sm-column`).
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<ul class="nav flex-column">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" href="#">Active</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
As always, vertical navigation is possible without `<ul>`s, too.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="nav flex-column">
|
||||||
|
<a class="nav-link active" href="#">Active</a>
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
<a class="nav-link" href="#">Link</a>
|
||||||
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
### Tabs
|
||||||
|
|
||||||
Takes the basic nav from above and adds the `.nav-tabs` class to generate a tabbed interface. Use them to create tabbable regions with our [tab JavaScript plugin](#javascript-behavior).
|
Takes the basic nav from above and adds the `.nav-tabs` class to generate a tabbed interface. Use them to create tabbable regions with our [tab JavaScript plugin](#javascript-behavior).
|
||||||
|
|
||||||
@ -100,7 +143,7 @@ Takes the basic nav from above and adds the `.nav-tabs` class to generate a tabb
|
|||||||
</ul>
|
</ul>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## Pills
|
### Pills
|
||||||
|
|
||||||
Take that same HTML, but use `.nav-pills` instead:
|
Take that same HTML, but use `.nav-pills` instead:
|
||||||
|
|
||||||
@ -121,17 +164,17 @@ Take that same HTML, but use `.nav-pills` instead:
|
|||||||
</ul>
|
</ul>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
### Stacked pills
|
### Fill and justify
|
||||||
|
|
||||||
Add `.nav-stacked` to the `.nav.nav-pills` to stack them vertically. Each `.nav-link` becomes block-level, allowing for larger hit areas via mouse or tap.
|
Force your `.nav`'s contents to extend the full available width one of two modifier classes. To proportionately fill all available space with your `.nav-item`s, use `.nav-fill`. Notice that all horizontal space is occupied, but not every nav item has the same width.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<ul class="nav nav-pills nav-stacked">
|
<ul class="nav nav-pills nav-fill">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" href="#">Active</a>
|
<a class="nav-link active" href="#">Active</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Link</a>
|
<a class="nav-link" href="#">Longer nav link</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Link</a>
|
<a class="nav-link" href="#">Link</a>
|
||||||
@ -142,17 +185,42 @@ Add `.nav-stacked` to the `.nav.nav-pills` to stack them vertically. Each `.nav-
|
|||||||
</ul>
|
</ul>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
As always, stacked pills are possible without `<ul>`s.
|
For equal-width elements, use `.nav-justified`. All horizontal space will be occupied by nav links, but unlike the `.nav-fill` above, every nav item will be the same width.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav class="nav nav-pills nav-stacked">
|
<ul class="nav nav-pills nav-justified">
|
||||||
|
<li class="nav-item">
|
||||||
<a class="nav-link active" href="#">Active</a>
|
<a class="nav-link active" href="#">Active</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Longer nav link</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#">Link</a>
|
<a class="nav-link" href="#">Link</a>
|
||||||
<a class="nav-link" href="#">Link</a>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
<a class="nav-link disabled" href="#">Disabled</a>
|
<a class="nav-link disabled" href="#">Disabled</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## Working with flex utilities
|
||||||
|
|
||||||
|
If you need responsive nav variations, consider using a series of [flex utilities](). While more verbose, these utilities offer greater customization across responsive breakpoints. In the example below, our nav will be stacked on the lowest breakpoint, then adapt to a horizontal layout that fills the available width starting from the small breakpoint.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav class="nav nav-pills flex-column flex-sm-row">
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link active" href="#">Active</a>
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#">Disabled</a>
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
## Regarding accessibility
|
||||||
|
|
||||||
|
If you're using navs to provide a navigation bar, be sure to add a `role="navigation"` to the most logical parent container of the `<ul>`, or wrap a `<nav>` element around the whole navigation. Do not add the role to the `<ul>` itself, as this would prevent it from being announced as an actual list by assistive technologies.
|
||||||
|
|
||||||
## Using dropdowns
|
## Using dropdowns
|
||||||
|
|
||||||
Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin]({{ site.baseurl }}/components/dropdowns/#usage).
|
Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin]({{ site.baseurl }}/components/dropdowns/#usage).
|
||||||
@ -232,7 +300,7 @@ Use the tab JavaScript plugin—include it individually or through the compiled
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content" id="myTabContent">
|
<div class="tab-content" id="myTabContent">
|
||||||
<div role="tabpanel" class="tab-pane fade in active" id="home" aria-labelledBy="home-tab">
|
<div role="tabpanel" class="tab-pane fade show active" id="home" aria-labelledBy="home-tab">
|
||||||
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
|
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledBy="profile-tab">
|
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledBy="profile-tab">
|
||||||
@ -301,11 +369,11 @@ $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed)
|
|||||||
|
|
||||||
### Fade effect
|
### Fade effect
|
||||||
|
|
||||||
To make tabs fade in, add `.fade` to each `.tab-pane`. The first tab pane must also have `.in` to make the initial content visible.
|
To make tabs fade in, add `.fade` to each `.tab-pane`. The first tab pane must also have `.show` to make the initial content visible.
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane fade in active" id="home" role="tabpanel">...</div>
|
<div class="tab-pane fade show active" id="home" role="tabpanel">...</div>
|
||||||
<div class="tab-pane fade" id="profile" role="tabpanel">...</div>
|
<div class="tab-pane fade" id="profile" role="tabpanel">...</div>
|
||||||
<div class="tab-pane fade" id="messages" role="tabpanel">...</div>
|
<div class="tab-pane fade" id="messages" role="tabpanel">...</div>
|
||||||
<div class="tab-pane fade" id="settings" role="tabpanel">...</div>
|
<div class="tab-pane fade" id="settings" role="tabpanel">...</div>
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Pagination
|
title: Pagination
|
||||||
|
description: Documentation and examples for showing pagination links.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
Provide pagination links for your site or app with the multi-page pagination component.
|
Pagination links indicate a series of related content exists across multiple pages. Typically these are used where a multi-page approach to long lists of content improves general performance, such as in search results or inboxes.
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
@ -13,10 +14,28 @@ Provide pagination links for your site or app with the multi-page pagination com
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
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.
|
We use a large block of connected links for our pagination, making links hard to miss and easily scalable—all while providing large hit areas. Pagination is built with list HTML elements so screen readers can announce the number of available links. Use a wrapping `<nav>` element to identify it as a navigation section to screen readers and other assistive technologies.
|
||||||
|
|
||||||
|
In addition, as pages likely have more than one such navigation section, it's advisable to provide a descriptive `aria-label` for the `<nav>` to reflect 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"`.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav aria-label="Page navigation">
|
<nav aria-label="Page navigation example">
|
||||||
|
<ul class="pagination">
|
||||||
|
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">Next</a></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## Working with icons
|
||||||
|
|
||||||
|
Looking to use an icon or symbol in place of text for some pagination links? Be sure to provide proper screen reader support with `aria` attributes and the `.sr-only` utility.
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav aria-label="Page navigation example">
|
||||||
<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">
|
||||||
@ -27,8 +46,6 @@ Simple pagination inspired by Rdio, great for apps and search results. The large
|
|||||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">4</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">5</a></li>
|
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="#" aria-label="Next">
|
<a class="page-link" href="#" aria-label="Next">
|
||||||
<span aria-hidden="true">»</span>
|
<span aria-hidden="true">»</span>
|
||||||
@ -39,43 +56,25 @@ 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.
|
Pagination links are customizable for different circumstances. Use `.disabled` for links that appear un-clickable and `.active` to indicate the current page.
|
||||||
|
|
||||||
{% callout warning %}
|
While the `.disabled` class uses `pointer-events: none` to _try_ to disable the link functionality of `<a>`s, that CSS property is not yet standardized and doesn't account for keyboard navigation. As such, you should always add `tabindex="-1"` on disabled links and use custom JavaScript to fully disable their functionality.
|
||||||
#### Link functionality caveat
|
|
||||||
|
|
||||||
The `.disabled` class uses `pointer-events: none` to try to disable the link functionality of `<a>`s, but that CSS property is not yet standardized. 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, add a `tabindex="-1"` attribute on these links (to prevent them from receiving keyboard focus) and use custom JavaScript to disable their functionality.
|
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<nav aria-label="...">
|
<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">Previous</a>
|
||||||
<span aria-hidden="true">«</span>
|
|
||||||
<span class="sr-only">Previous</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
<li class="page-item active">
|
<li class="page-item active">
|
||||||
<a class="page-link" href="#">1 <span class="sr-only">(current)</span></a>
|
<a class="page-link" href="#">2 <span class="sr-only">(current)</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">4</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">5</a></li>
|
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="#" aria-label="Next">
|
<a class="page-link" href="#">Next</a>
|
||||||
<span aria-hidden="true">»</span>
|
|
||||||
<span class="sr-only">Next</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
@ -87,17 +86,23 @@ You can optionally swap out active or disabled anchors for `<span>`, or omit the
|
|||||||
<nav aria-label="...">
|
<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">Previous</span>
|
||||||
<span aria-hidden="true">«</span>
|
</li>
|
||||||
<span class="sr-only">Previous</span>
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
|
<li class="page-item active">
|
||||||
|
<span class="page-link">
|
||||||
|
2
|
||||||
|
<span class="sr-only">(current)</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="page-item active"><span class="page-link">1 <span class="sr-only">(current)</span></span></li>
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
|
<li class="page-item">
|
||||||
|
<a class="page-link" href="#">Next</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
|
|
||||||
## Sizing
|
## Sizing
|
||||||
|
|
||||||
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.
|
||||||
@ -105,20 +110,14 @@ Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for
|
|||||||
{% example html %}
|
{% example html %}
|
||||||
<nav aria-label="...">
|
<nav aria-label="...">
|
||||||
<ul class="pagination pagination-lg">
|
<ul class="pagination pagination-lg">
|
||||||
<li class="page-item">
|
<li class="page-item disabled">
|
||||||
<a class="page-link" href="#" aria-label="Previous">
|
<a class="page-link" href="#" tabindex="-1">Previous</a>
|
||||||
<span aria-hidden="true">«</span>
|
|
||||||
<span class="sr-only">Previous</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="#" aria-label="Next">
|
<a class="page-link" href="#">Next</a>
|
||||||
<span aria-hidden="true">»</span>
|
|
||||||
<span class="sr-only">Next</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
@ -127,20 +126,50 @@ Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for
|
|||||||
{% example html %}
|
{% example html %}
|
||||||
<nav aria-label="...">
|
<nav aria-label="...">
|
||||||
<ul class="pagination pagination-sm">
|
<ul class="pagination pagination-sm">
|
||||||
<li class="page-item">
|
<li class="page-item disabled">
|
||||||
<a class="page-link" href="#" aria-label="Previous">
|
<a class="page-link" href="#" tabindex="-1">Previous</a>
|
||||||
<span aria-hidden="true">«</span>
|
|
||||||
<span class="sr-only">Previous</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="#" aria-label="Next">
|
<a class="page-link" href="#">Next</a>
|
||||||
<span aria-hidden="true">»</span>
|
</li>
|
||||||
<span class="sr-only">Next</span>
|
</ul>
|
||||||
</a>
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
## Alignment
|
||||||
|
|
||||||
|
Change the alignment of pagination components with [flexbox utilities]({{ site.baseurl }}/utilities/flexbox).
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav aria-label="Page navigation example">
|
||||||
|
<ul class="pagination justify-content-center">
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<a class="page-link" href="#" tabindex="-1">Previous</a>
|
||||||
|
</li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
|
<li class="page-item">
|
||||||
|
<a class="page-link" href="#">Next</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{% endexample %}
|
||||||
|
|
||||||
|
{% example html %}
|
||||||
|
<nav aria-label="Page navigation example">
|
||||||
|
<ul class="pagination justify-content-end">
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<a class="page-link" href="#" tabindex="-1">Previous</a>
|
||||||
|
</li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
||||||
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||||
|
<li class="page-item">
|
||||||
|
<a class="page-link" href="#">Next</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Popovers
|
title: Popovers
|
||||||
|
description: Documentation and examples for adding Bootstrap popovers to your site.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -16,8 +17,8 @@ Add small overlay content, like those found in iOS, to any element for housing s
|
|||||||
Things to know when using the popover plugin:
|
Things to know when using the popover plugin:
|
||||||
|
|
||||||
|
|
||||||
- Popovers rely on the 3rd party library [Tether](http://github.hubspot.com/tether/) for positioning. You must include [tether.min.js](https://github.com/HubSpot/tether/blob/master/dist/js/tether.min.js) before bootstrap.js in order for popovers to work!
|
- Popovers rely on the 3rd party library [Tether](http://tether.io/) for positioning. You must include [tether.min.js](https://github.com/HubSpot/tether/blob/master/dist/js/tether.min.js) before bootstrap.js in order for popovers to work!
|
||||||
- Popovers require the [tooltip plugin]({{ site.baseurl }}/components/tooltips) as a dependency.
|
- Popovers require the [tooltip plugin]({{ site.baseurl }}/components/tooltips/) as a dependency.
|
||||||
- Popovers are opt-in for performance reasons, so **you must initialize them yourself**.
|
- Popovers are opt-in for performance reasons, so **you must initialize them yourself**.
|
||||||
- Zero-length `title` and `content` values will never show a popover.
|
- Zero-length `title` and `content` values will never show a popover.
|
||||||
- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).
|
- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).
|
||||||
@ -55,7 +56,6 @@ Four options are available: top, right, bottom, and left aligned.
|
|||||||
|
|
||||||
<div class="bd-example bd-example-popover-static">
|
<div class="bd-example bd-example-popover-static">
|
||||||
<div class="popover popover-top">
|
<div class="popover popover-top">
|
||||||
<div class="popover-arrow"></div>
|
|
||||||
<h3 class="popover-title">Popover top</h3>
|
<h3 class="popover-title">Popover top</h3>
|
||||||
<div class="popover-content">
|
<div class="popover-content">
|
||||||
<p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
|
<p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
|
||||||
@ -63,7 +63,6 @@ Four options are available: top, right, bottom, and left aligned.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="popover popover-right">
|
<div class="popover popover-right">
|
||||||
<div class="popover-arrow"></div>
|
|
||||||
<h3 class="popover-title">Popover right</h3>
|
<h3 class="popover-title">Popover right</h3>
|
||||||
<div class="popover-content">
|
<div class="popover-content">
|
||||||
<p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
|
<p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
|
||||||
@ -71,7 +70,6 @@ Four options are available: top, right, bottom, and left aligned.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="popover popover-bottom">
|
<div class="popover popover-bottom">
|
||||||
<div class="popover-arrow"></div>
|
|
||||||
<h3 class="popover-title">Popover bottom</h3>
|
<h3 class="popover-title">Popover bottom</h3>
|
||||||
|
|
||||||
<div class="popover-content">
|
<div class="popover-content">
|
||||||
@ -80,7 +78,6 @@ Four options are available: top, right, bottom, and left aligned.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="popover popover-left">
|
<div class="popover popover-left">
|
||||||
<div class="popover-arrow"></div>
|
|
||||||
<h3 class="popover-title">Popover left</h3>
|
<h3 class="popover-title">Popover left</h3>
|
||||||
<div class="popover-content">
|
<div class="popover-content">
|
||||||
<p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
|
<p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
|
||||||
@ -141,7 +138,7 @@ Use the `focus` trigger to dismiss popovers on the next click that the user make
|
|||||||
{% callout danger %}
|
{% callout danger %}
|
||||||
#### Specific markup required for dismiss-on-next-click
|
#### Specific markup required for dismiss-on-next-click
|
||||||
|
|
||||||
For proper cross-browser and cross-platform behavior, you must use the `<a>` tag, _not_ the `<button>` tag, and you also must include a [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#tabindex) attribute.
|
For proper cross-browser and cross-platform behavior, you must use the `<a>` tag, _not_ the `<button>` tag, and you also must include a [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) attribute.
|
||||||
{% endcallout %}
|
{% endcallout %}
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
@ -221,7 +218,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>string | function</td>
|
<td>string | function</td>
|
||||||
<td>'right'</td>
|
<td>'right'</td>
|
||||||
<td>
|
<td>
|
||||||
<p>How to position the popover - top | bottom | left | right | auto.<br>When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.</p>
|
<p>How to position the popover - top | bottom | left | right.</p>
|
||||||
<p>When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The <code>this</code> context is set to the popover instance.</p>
|
<p>When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The <code>this</code> context is set to the popover instance.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -229,7 +226,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>selector</td>
|
<td>selector</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>false</td>
|
<td>false</td>
|
||||||
<td>If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsbin.com/zopod/1/edit">an informative example</a>.</td>
|
<td>If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="https://jsbin.com/zopod/1/edit">an informative example</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>template</td>
|
<td>template</td>
|
||||||
@ -262,13 +259,13 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>constraints</td>
|
<td>constraints</td>
|
||||||
<td>Array</td>
|
<td>Array</td>
|
||||||
<td>'hover focus'</td>
|
<td>'hover focus'</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>
|
<td>An array of constraints - passed through to Tether. For more information refer to Tether's <a href="http://tether.io/#constraints">constraint docs</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>offset</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://tether.io/#offset">offset docs</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Progress
|
title: Progress
|
||||||
|
description: Documentation and examples for using Bootstrap progress bars.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -13,39 +14,26 @@ Stylize [the HTML5 `<progress>` element](https://developer.mozilla.org/en-US/doc
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
To caption a progress bar, simply add a `<div>` with your caption text, [align the text using a utility class]({{ site.baseurl }}/components/utilities/#text-alignment), and associate the caption with the `<progress>` element using the `aria-describedby` attribute.
|
To caption a progress bar, simply add a `<div>` with your caption text, [align the text using a utility class]({{ site.baseurl }}/utilities/typography/#text-alignment), and associate the caption with the `<progress>` element using the `aria-describedby` attribute.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
|
|
||||||
<div class="text-xs-center" id="example-caption-1">Reticulating splines… 0%</div>
|
<div class="text-center" id="example-caption-1">Reticulating splines… 0%</div>
|
||||||
<progress class="progress" value="0" max="100" aria-describedby="example-caption-1"></progress>
|
<progress class="progress" value="0" max="100" aria-describedby="example-caption-1"></progress>
|
||||||
|
|
||||||
<div class="text-xs-center" id="example-caption-2">Reticulating splines… 25%</div>
|
<div class="text-center" id="example-caption-2">Reticulating splines… 25%</div>
|
||||||
<progress class="progress" value="25" max="100" aria-describedby="example-caption-2"></progress>
|
<progress class="progress" value="25" max="100" aria-describedby="example-caption-2"></progress>
|
||||||
|
|
||||||
<div class="text-xs-center" id="example-caption-3">Reticulating splines… 50%</div>
|
<div class="text-center" id="example-caption-3">Reticulating splines… 50%</div>
|
||||||
<progress class="progress" value="50" max="100" aria-describedby="example-caption-3"></progress>
|
<progress class="progress" value="50" max="100" aria-describedby="example-caption-3"></progress>
|
||||||
|
|
||||||
<div class="text-xs-center" id="example-caption-4">Reticulating splines… 75%</div>
|
<div class="text-center" id="example-caption-4">Reticulating splines… 75%</div>
|
||||||
<progress class="progress" value="75" max="100" aria-describedby="example-caption-4"></progress>
|
<progress class="progress" value="75" max="100" aria-describedby="example-caption-4"></progress>
|
||||||
|
|
||||||
<div class="text-xs-center" id="example-caption-5">Reticulating splines… 100%</div>
|
<div class="text-center" id="example-caption-5">Reticulating splines… 100%</div>
|
||||||
<progress class="progress" value="100" max="100" aria-describedby="example-caption-5"></progress>
|
<progress class="progress" value="100" max="100" aria-describedby="example-caption-5"></progress>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
## IE9 support
|
|
||||||
|
|
||||||
Internet Explorer 9 doesn't support the HTML5 `<progress>` element, but we can work around that.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="text-xs-center" id="example-caption-6">Reticulating splines… 25%</div>
|
|
||||||
<progress class="progress" value="25" max="100" aria-describedby="example-caption-6">
|
|
||||||
<div class="progress">
|
|
||||||
<span class="progress-bar" style="width: 25%;"></span>
|
|
||||||
</div>
|
|
||||||
</progress>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Contextual alternatives
|
## Contextual alternatives
|
||||||
|
|
||||||
Progress bars use some of the same button and alert classes for consistent styles.
|
Progress bars use some of the same button and alert classes for consistent styles.
|
||||||
@ -73,7 +61,7 @@ Uses a gradient to create a striped effect.
|
|||||||
|
|
||||||
The striped gradient can also be animated. Add `.progress-animated` to `.progress` to animate the stripes right to left via CSS3 animations.
|
The striped gradient can also be animated. Add `.progress-animated` to `.progress` to animate the stripes right to left via CSS3 animations.
|
||||||
|
|
||||||
**Animated progress bars do not work in IE9 and Opera 12** – as they don't support CSS3 animations – **nor in IE10+ and Microsoft Edge** – as they currently don't support CSS3 animations on the [`::-ms-fill` pseudo-element](https://msdn.microsoft.com/en-us/library/windows/apps/hh465757.aspx).
|
**Animated progress bars don't work in Opera 12**—as they don't support CSS3 animations. They also **don't work in IE10+ and Microsoft Edge** as those browsers currently don't support CSS3 animations on the [`::-ms-fill` pseudo-element](https://msdn.microsoft.com/en-us/library/windows/apps/hh465757.aspx).
|
||||||
|
|
||||||
<div class="bd-example">
|
<div class="bd-example">
|
||||||
<progress class="progress progress-striped" value="25" max="100"></progress>
|
<progress class="progress progress-striped" value="25" max="100"></progress>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Scrollspy
|
title: Scrollspy
|
||||||
|
description: Documentation and examples for the scrollspy plugin with Bootstrap's navigation components.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -14,8 +15,8 @@ group: components
|
|||||||
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.
|
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">
|
<div class="bd-example">
|
||||||
<nav id="navbar-example2" class="navbar navbar-default">
|
<nav id="navbar-example2" class="navbar navbar-light bg-faded">
|
||||||
<h3 class="navbar-brand">Project Name</h3>
|
<a class="navbar-brand" href="#">Navbar</a>
|
||||||
<ul class="nav nav-pills">
|
<ul class="nav nav-pills">
|
||||||
<li class="nav-item"><a class="nav-link" href="#fat">@fat</a></li>
|
<li class="nav-item"><a class="nav-link" href="#fat">@fat</a></li>
|
||||||
<li class="nav-item"><a class="nav-link" href="#mdo">@mdo</a></li>
|
<li class="nav-item"><a class="nav-link" href="#mdo">@mdo</a></li>
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
layout: docs
|
|
||||||
title: Tags
|
|
||||||
group: components
|
|
||||||
---
|
|
||||||
|
|
||||||
Small and adaptive tag for adding context to just about any content.
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
Tags scale to match the size of the immediate parent element by using relative font sizing and `em` units.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<h1>Example heading <span class="tag tag-default">New</span></h1>
|
|
||||||
<h2>Example heading <span class="tag tag-default">New</span></h2>
|
|
||||||
<h3>Example heading <span class="tag tag-default">New</span></h3>
|
|
||||||
<h4>Example heading <span class="tag tag-default">New</span></h4>
|
|
||||||
<h5>Example heading <span class="tag tag-default">New</span></h5>
|
|
||||||
<h6>Example heading <span class="tag tag-default">New</span></h6>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Contextual variations
|
|
||||||
|
|
||||||
Add any of the below mentioned modifier classes to change the appearance of a tag.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<span class="tag tag-default">Default</span>
|
|
||||||
<span class="tag tag-primary">Primary</span>
|
|
||||||
<span class="tag tag-success">Success</span>
|
|
||||||
<span class="tag tag-info">Info</span>
|
|
||||||
<span class="tag tag-warning">Warning</span>
|
|
||||||
<span class="tag tag-danger">Danger</span>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
|
||||||
{{ callout-include | markdownify }}
|
|
||||||
|
|
||||||
## Pill tags
|
|
||||||
|
|
||||||
Use the `.tag-pill` modifier class to make tags more rounded (with a larger `border-radius` and additional horizontal `padding`). Useful if you miss the badges from v3.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<span class="tag tag-pill tag-default">Default</span>
|
|
||||||
<span class="tag tag-pill tag-primary">Primary</span>
|
|
||||||
<span class="tag tag-pill tag-success">Success</span>
|
|
||||||
<span class="tag tag-pill tag-info">Info</span>
|
|
||||||
<span class="tag tag-pill tag-warning">Warning</span>
|
|
||||||
<span class="tag tag-pill tag-danger">Danger</span>
|
|
||||||
{% endexample %}
|
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Tooltips
|
title: Tooltips
|
||||||
|
description: Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript.
|
||||||
group: components
|
group: components
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ Inspired by the excellent Tipsy jQuery plugin written by Jason Frame. Tooltips a
|
|||||||
|
|
||||||
Things to know when using the tooltip plugin:
|
Things to know when using the tooltip plugin:
|
||||||
|
|
||||||
- Tooltips rely on the 3rd party library [Tether](http://github.hubspot.com/tether/) for positioning. You must include [tether.min.js](https://github.com/HubSpot/tether/blob/master/dist/js/tether.min.js) before bootstrap.js in order for tooltips to work!
|
- Tooltips rely on the 3rd party library [Tether](http://tether.io/) for positioning. You must include [tether.min.js](https://github.com/HubSpot/tether/blob/master/dist/js/tether.min.js) before bootstrap.js in order for tooltips to work!
|
||||||
- Tooltips are opt-in for performance reasons, so **you must initialize them yourself**.
|
- Tooltips are opt-in for performance reasons, so **you must initialize them yourself**.
|
||||||
- Tooltips with zero-length titles are never displayed.
|
- Tooltips with zero-length titles are never displayed.
|
||||||
- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).
|
- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).
|
||||||
@ -50,25 +51,21 @@ Four options are available: top, right, bottom, and left aligned.
|
|||||||
|
|
||||||
<div class="bd-example bd-example-tooltip-static">
|
<div class="bd-example bd-example-tooltip-static">
|
||||||
<div class="tooltip tooltip-top" role="tooltip">
|
<div class="tooltip tooltip-top" role="tooltip">
|
||||||
<div class="tooltip-arrow"></div>
|
|
||||||
<div class="tooltip-inner">
|
<div class="tooltip-inner">
|
||||||
Tooltip on the top
|
Tooltip on the top
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tooltip tooltip-right" role="tooltip">
|
<div class="tooltip tooltip-right" role="tooltip">
|
||||||
<div class="tooltip-arrow"></div>
|
|
||||||
<div class="tooltip-inner">
|
<div class="tooltip-inner">
|
||||||
Tooltip on the right
|
Tooltip on the right
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tooltip tooltip-bottom" role="tooltip">
|
<div class="tooltip tooltip-bottom" role="tooltip">
|
||||||
<div class="tooltip-arrow"></div>
|
|
||||||
<div class="tooltip-inner">
|
<div class="tooltip-inner">
|
||||||
Tooltip on the bottom
|
Tooltip on the bottom
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tooltip tooltip-left" role="tooltip">
|
<div class="tooltip tooltip-left" role="tooltip">
|
||||||
<div class="tooltip-arrow"></div>
|
|
||||||
<div class="tooltip-inner">
|
<div class="tooltip-inner">
|
||||||
Tooltip on the left
|
Tooltip on the left
|
||||||
</div>
|
</div>
|
||||||
@ -85,6 +82,7 @@ Hover over the buttons below to see their tooltips.
|
|||||||
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="right" title="Tooltip on right">Tooltip on right</button>
|
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="right" title="Tooltip on right">Tooltip on right</button>
|
||||||
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">Tooltip on bottom</button>
|
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">Tooltip on bottom</button>
|
||||||
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="left" title="Tooltip on left">Tooltip on left</button>
|
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="left" title="Tooltip on left">Tooltip on left</button>
|
||||||
|
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">Tooltip with HTML</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -103,6 +101,14 @@ Hover over the buttons below to see their tooltips.
|
|||||||
</button>
|
</button>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
And with custom HTML added:
|
||||||
|
|
||||||
|
{% highlight html %}
|
||||||
|
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
|
||||||
|
Tooltip with HTML
|
||||||
|
</button>
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The tooltip plugin generates content and markup on demand, and by default places tooltips after their trigger element.
|
The tooltip plugin generates content and markup on demand, and by default places tooltips after their trigger element.
|
||||||
@ -159,7 +165,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>container</td>
|
<td>container</td>
|
||||||
<td>string | false</td>
|
<td>string | element | false</td>
|
||||||
<td>false</td>
|
<td>false</td>
|
||||||
<td>
|
<td>
|
||||||
<p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.</p>
|
<p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.</p>
|
||||||
@ -179,14 +185,18 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>html</td>
|
<td>html</td>
|
||||||
<td>boolean</td>
|
<td>boolean</td>
|
||||||
<td>false</td>
|
<td>false</td>
|
||||||
<td>Insert HTML into the tooltip. If false, jQuery's <code>text</code> method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.</td>
|
<td>
|
||||||
|
<p>Allow HTML in the tooltip.</p>
|
||||||
|
<p>If true, HTML tags in the tooltip's <code>title</code> will be rendered in the tooltip. If false, jQuery's <code>text</code> method will be used to insert content into the DOM.</p>
|
||||||
|
<p>Use text if you're worried about XSS attacks.</p>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>placement</td>
|
<td>placement</td>
|
||||||
<td>string | function</td>
|
<td>string | function</td>
|
||||||
<td>'top'</td>
|
<td>'top'</td>
|
||||||
<td>
|
<td>
|
||||||
<p>How to position the tooltip - top | bottom | left | right | auto.<br>When "auto" is specified, it will dynamically reorient the tooltip. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.</p>
|
<p>How to position the tooltip - top | bottom | left | right.</p>
|
||||||
<p>When a function is used to determine the placement, it is called with the tooltip DOM node as its first argument and the triggering element DOM node as its second. The <code>this</code> context is set to the tooltip instance.</p>
|
<p>When a function is used to determine the placement, it is called with the tooltip DOM node as its first argument and the triggering element DOM node as its second. The <code>this</code> context is set to the tooltip instance.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -194,7 +204,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>selector</td>
|
<td>selector</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>false</td>
|
<td>false</td>
|
||||||
<td>If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="http://jsbin.com/zopod/1/edit">an informative example</a>.</td>
|
<td>If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See <a href="https://github.com/twbs/bootstrap/issues/4215">this</a> and <a href="https://jsbin.com/zopod/1/edit">an informative example</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>template</td>
|
<td>template</td>
|
||||||
@ -226,13 +236,13 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||||||
<td>constraints</td>
|
<td>constraints</td>
|
||||||
<td>Array</td>
|
<td>Array</td>
|
||||||
<td>[]</td>
|
<td>[]</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>
|
<td>An array of constraints - passed through to Tether. For more information refer to Tether's <a href="http://tether.io/#constraints">constraint docs</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>offset</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://tether.io/#constraints">offset docs</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,367 +0,0 @@
|
|||||||
---
|
|
||||||
layout: docs
|
|
||||||
title: Utility classes
|
|
||||||
group: components
|
|
||||||
---
|
|
||||||
|
|
||||||
Bootstrap includes dozens of utilities—classes with a single purpose. They're designed to reduce the frequency of highly repetitive declarations in your CSS while allowing for quick and easy development.
|
|
||||||
|
|
||||||
## Contents
|
|
||||||
|
|
||||||
* Will be replaced with the ToC, excluding the "Contents" header
|
|
||||||
{:toc}
|
|
||||||
|
|
||||||
## Spacing
|
|
||||||
|
|
||||||
Assign `margin` or `padding` to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. All classes are multiples on the global default value, `1rem`.
|
|
||||||
|
|
||||||
The classes are named using the format: `{property}-{sides}-{size}`
|
|
||||||
|
|
||||||
Where *property* is one of:
|
|
||||||
|
|
||||||
* `m` - for classes that set `margin`
|
|
||||||
* `p` - for classes that set `padding`
|
|
||||||
|
|
||||||
Where *sides* is one of:
|
|
||||||
|
|
||||||
* `t` - for classes that set `margin-top` or `padding-top`
|
|
||||||
* `b` - for classes that set `margin-bottom` or `padding-bottom`
|
|
||||||
* `l` - for classes that set `margin-left` or `padding-left`
|
|
||||||
* `r` - for classes that set `margin-right` or `padding-right`
|
|
||||||
* `x` - for classes that set both `*-left` and `*-right`
|
|
||||||
* `y` - for classes that set both `*-top` and `*-bottom`
|
|
||||||
* `a` - for classes that set a `margin` or `padding` on all 4 sides of the element
|
|
||||||
|
|
||||||
Where *size* is one of:
|
|
||||||
|
|
||||||
* `0` - for classes that eliminate the `margin` or `padding` by setting it to `0`
|
|
||||||
* `1` - (by default) for classes that set the `margin` or `padding` to `$spacer-x` or `$spacer-y`
|
|
||||||
* `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 %}
|
|
||||||
.m-t-0 {
|
|
||||||
margin-top: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.m-l-1 {
|
|
||||||
margin-left: $spacer-x !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-x-2 {
|
|
||||||
padding-left: ($spacer-x * 1.5) !important;
|
|
||||||
padding-right: ($spacer-x * 1.5) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-a-3 {
|
|
||||||
padding: ($spacer-y * 3) ($spacer-x * 3) !important;
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
### Horizontal centering
|
|
||||||
Additionally, Bootstrap also includes an `.m-x-auto` class for horizontally centering fixed-width block level content by setting the horizontal margins to `auto`.
|
|
||||||
|
|
||||||
<div class="bd-example">
|
|
||||||
<div class="m-x-auto" style="width: 200px; background-color: rgba(86,61,124,.15);">
|
|
||||||
Centered element
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<div class="m-x-auto" style="width: 200px;">
|
|
||||||
Centered element
|
|
||||||
</div>
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
## Text alignment
|
|
||||||
|
|
||||||
Easily realign text to components with text alignment classes.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<p class="text-justify">Justified text.</p>
|
|
||||||
<p class="text-nowrap">No wrap text.</p>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
For left, right, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<p class="text-xs-left">Left aligned text on all viewport sizes.</p>
|
|
||||||
<p class="text-xs-center">Center aligned text on all viewport sizes.</p>
|
|
||||||
<p class="text-xs-right">Right aligned text on all viewport sizes.</p>
|
|
||||||
|
|
||||||
<p class="text-sm-left">Left aligned text on viewports sized SM (small) or wider.</p>
|
|
||||||
<p class="text-md-left">Left aligned text on viewports sized MD (medium) or wider.</p>
|
|
||||||
<p class="text-lg-left">Left aligned text on viewports sized LG (large) or wider.</p>
|
|
||||||
<p class="text-xl-left">Left aligned text on viewports sized XL (extra-large) or wider.</p>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Text transform
|
|
||||||
|
|
||||||
Transform text in components with text capitalization classes.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<p class="text-lowercase">Lowercased text.</p>
|
|
||||||
<p class="text-uppercase">Uppercased text.</p>
|
|
||||||
<p class="text-capitalize">CapiTaliZed text.</p>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
Note how `text-capitalize` only changes the first letter of each word, leaving the case of any other letters unaffected.
|
|
||||||
|
|
||||||
## Font weight and italics
|
|
||||||
|
|
||||||
Quickly change the weight (boldness) of text or italicize text.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<p class="font-weight-bold">Bold text.</p>
|
|
||||||
<p class="font-weight-normal">Normal weight text.</p>
|
|
||||||
<p class="font-italic">Italic text.</p>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Contextual colors and backgrounds
|
|
||||||
|
|
||||||
Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<p class="text-muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
|
|
||||||
<p class="text-primary">Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
|
|
||||||
<p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
|
|
||||||
<p class="text-info">Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
|
|
||||||
<p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
|
|
||||||
<p class="text-danger">Donec ullamcorper nulla non metus auctor fringilla.</p>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
Contextual text classes also work well on anchors with the provided hover and focus states.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<a href="#" class="text-muted">Muted link</a>
|
|
||||||
<a href="#" class="text-primary">Primary link</a>
|
|
||||||
<a href="#" class="text-success">Success link</a>
|
|
||||||
<a href="#" class="text-info">Info link</a>
|
|
||||||
<a href="#" class="text-warning">Warning link</a>
|
|
||||||
<a href="#" class="text-danger">Danger link</a>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="bg-primary">Nullam id dolor id nibh ultricies vehicula ut id elit.</div>
|
|
||||||
<div class="bg-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</div>
|
|
||||||
<div class="bg-info">Maecenas sed diam eget risus varius blandit sit amet non magna.</div>
|
|
||||||
<div class="bg-warning">Etiam porta sem malesuada magna mollis euismod.</div>
|
|
||||||
<div class="bg-danger">Donec ullamcorper nulla non metus auctor fringilla.</div>
|
|
||||||
<div class="bg-inverse">Cras mattis consectetur purus sit amet fermentum.</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
{% callout info %}
|
|
||||||
#### Dealing with specificity
|
|
||||||
|
|
||||||
Sometimes contextual classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a `<div>` with the class.
|
|
||||||
{% endcallout %}
|
|
||||||
|
|
||||||
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
|
||||||
{{ 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
|
|
||||||
|
|
||||||
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`.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<button type="button" class="close" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
## Responsive floats
|
|
||||||
|
|
||||||
These utility classes float an element to the left or right, or disable floating, based on the current viewport size using the [CSS `float` property](https://developer.mozilla.org/en-US/docs/Web/CSS/float). `!important` is included to avoid specificity issues. These use the same viewport width breakpoints as the grid system.
|
|
||||||
|
|
||||||
Two similar non-responsive Sass mixins (`pull-left` and `pull-right`) are also available.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="pull-xs-left">Float left on all viewport sizes</div><br>
|
|
||||||
<div class="pull-xs-right">Float right on all viewport sizes</div><br>
|
|
||||||
<div class="pull-xs-none">Don't float on all viewport sizes</div><br>
|
|
||||||
|
|
||||||
<div class="pull-sm-left">Float left on viewports sized SM (small) or wider</div><br>
|
|
||||||
<div class="pull-md-left">Float left on viewports sized MD (medium) or wider</div><br>
|
|
||||||
<div class="pull-lg-left">Float left on viewports sized LG (large) or wider</div><br>
|
|
||||||
<div class="pull-xl-left">Float left on viewports sized XL (extra-large) or wider</div><br>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
{% highlight scss %}
|
|
||||||
// Related simple non-responsive mixins
|
|
||||||
.element {
|
|
||||||
@include pull-left;
|
|
||||||
}
|
|
||||||
.another-element {
|
|
||||||
@include pull-right;
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
## Clearfix
|
|
||||||
|
|
||||||
Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes [the micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/) as popularized by Nicolas Gallagher. Can also be used as a mixin.
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<div class="clearfix">...</div>
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
{% highlight scss %}
|
|
||||||
// Mixin itself
|
|
||||||
.clearfix() {
|
|
||||||
&:before,
|
|
||||||
&:after {
|
|
||||||
content: " ";
|
|
||||||
display: table;
|
|
||||||
}
|
|
||||||
&:after {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Usage as a mixin
|
|
||||||
.element {
|
|
||||||
@include clearfix;
|
|
||||||
}
|
|
||||||
{% 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.
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<div class="invisible">...</div>
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
{% highlight scss %}
|
|
||||||
// Class
|
|
||||||
.invisible {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Usage as a mixin
|
|
||||||
.element {
|
|
||||||
@include invisible;
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
## Screen readers and keyboard users
|
|
||||||
|
|
||||||
Hide an element to all devices **except screen readers** with `.sr-only`. Combine `.sr-only` with `.sr-only-focusable` to show the element again when it's focused (e.g. by a keyboard-only user). Can also be used as mixins.
|
|
||||||
|
|
||||||
{% comment %}
|
|
||||||
Necessary for following [accessibility best practices](../getting-started/#accessibility).
|
|
||||||
{% endcomment %}
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
{% highlight scss %}
|
|
||||||
// Usage as a mixin
|
|
||||||
.skip-navigation {
|
|
||||||
@include sr-only;
|
|
||||||
@include sr-only-focusable;
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
## Image replacement
|
|
||||||
|
|
||||||
Utilize the `.text-hide` class or mixin to help replace an element's text content with a background image.
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<h1 class="text-hide">Custom heading</h1>
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
{% highlight scss %}
|
|
||||||
// Usage as a mixin
|
|
||||||
.heading {
|
|
||||||
@include text-hide;
|
|
||||||
}
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
## Responsive embeds
|
|
||||||
|
|
||||||
Allow browsers to determine video or slideshow dimensions based on the width of their containing block by creating an intrinsic ratio that will properly scale on any device.
|
|
||||||
|
|
||||||
Rules are directly applied to `<iframe>`, `<embed>`, `<video>`, and `<object>` elements; optionally use an explicit descendant class `.embed-responsive-item` when you want to match the styling for other attributes.
|
|
||||||
|
|
||||||
**Pro-Tip!** You don't need to include `frameborder="0"` in your `<iframe>`s as we override that for you.
|
|
||||||
|
|
||||||
{% example html %}
|
|
||||||
<div class="embed-responsive embed-responsive-16by9">
|
|
||||||
<iframe class="embed-responsive-item" src="//www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
|
|
||||||
</div>
|
|
||||||
{% endexample %}
|
|
||||||
|
|
||||||
Aspect ratios can be customized with modifier classes.
|
|
||||||
|
|
||||||
{% highlight html %}
|
|
||||||
<!-- 21:9 aspect ratio -->
|
|
||||||
<div class="embed-responsive embed-responsive-21by9">
|
|
||||||
<iframe class="embed-responsive-item" src="..."></iframe>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 16:9 aspect ratio -->
|
|
||||||
<div class="embed-responsive embed-responsive-16by9">
|
|
||||||
<iframe class="embed-responsive-item" src="..."></iframe>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 4:3 aspect ratio -->
|
|
||||||
<div class="embed-responsive embed-responsive-4by3">
|
|
||||||
<iframe class="embed-responsive-item" src="..."></iframe>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 1:1 aspect ratio -->
|
|
||||||
<div class="embed-responsive embed-responsive-1by1">
|
|
||||||
<iframe class="embed-responsive-item" src="..."></iframe>
|
|
||||||
</div>
|
|
||||||
{% endhighlight %}
|
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Code
|
title: Code
|
||||||
|
description: Documentation and examples for displaying inline and multiline blocks of code with Bootstrap.
|
||||||
group: content
|
group: content
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,25 +1,26 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Figures
|
title: Figures
|
||||||
|
description: Documentation and examples for displaying related images and text with the figure component in Bootstrap.
|
||||||
group: content
|
group: content
|
||||||
---
|
---
|
||||||
|
|
||||||
Anytime you need to display a piece of content—like an image—with an optional caption, consider using a `<figure>`.
|
Anytime you need to display a piece of content—like an image with an optional caption, consider using a `<figure>`.
|
||||||
|
|
||||||
Use the included `.figure` , `.figure-img` and `.figure-caption` classes to provide some baseline styles for the HTML5 `<figure>` and `<figcaption>` elements. Images in figures have no explicit size, so be sure to add the `.img-fluid` class to your `<img>` to make it responsive.
|
Use the included `.figure` , `.figure-img` and `.figure-caption` classes to provide some baseline styles for the HTML5 `<figure>` and `<figcaption>` elements. Images in figures have no explicit size, so be sure to add the `.img-fluid` class to your `<img>` to make it responsive.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<img data-src="holder.js/400x300" class="figure-img img-fluid img-rounded" alt="A generic square placeholder image with rounded corners in a figure.">
|
<img data-src="holder.js/400x300" class="figure-img img-fluid rounded" alt="A generic square placeholder image with rounded corners in a figure.">
|
||||||
<figcaption class="figure-caption">A caption for the above image.</figcaption>
|
<figcaption class="figure-caption">A caption for the above image.</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
|
||||||
Aligning the figure's caption is easy with our [text utilities]({{ site.baseurl }}/components/utilities/#text-alignment).
|
Aligning the figure's caption is easy with our [text utilities]({{ site.baseurl }}/utilities/typography/#text-alignment).
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<img data-src="holder.js/400x300" class="figure-img img-fluid img-rounded" alt="A generic square placeholder image with rounded corners in a figure.">
|
<img data-src="holder.js/400x300" class="figure-img img-fluid rounded" alt="A generic square placeholder image with rounded corners in a figure.">
|
||||||
<figcaption class="figure-caption text-xs-right">A caption for the above image.</figcaption>
|
<figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
{% endexample %}
|
{% endexample %}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Images
|
title: Images
|
||||||
|
description: Documentation and examples for styling images with Bootstrap.
|
||||||
group: content
|
group: content
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -29,52 +30,48 @@ Images in Bootstrap are made responsive with `.img-fluid`. `max-width: 100%;` an
|
|||||||
In Internet Explorer 9-10, SVG images with `.img-fluid` are disproportionately sized. To fix this, add `width: 100% \9;` where necessary. This fix improperly sizes other image formats, so Bootstrap doesn't apply it automatically.
|
In Internet Explorer 9-10, SVG images with `.img-fluid` are disproportionately sized. To fix this, add `width: 100% \9;` where necessary. This fix improperly sizes other image formats, so Bootstrap doesn't apply it automatically.
|
||||||
{% endcallout %}
|
{% endcallout %}
|
||||||
|
|
||||||
## Image shapes
|
## Image thumbnails
|
||||||
|
|
||||||
Add classes to an `<img>` element to easily style images in any project.
|
In addition to our [border-radius utilities]({{ site.baseurl }}/utilities/borders/), you can use `.img-thumbnail` to give an image a rounded 1px border appearance.
|
||||||
|
|
||||||
<div class="bd-example bd-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">
|
<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">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<img src="..." alt="..." class="img-rounded">
|
|
||||||
<img src="..." alt="..." class="img-circle">
|
|
||||||
<img src="..." alt="..." class="img-thumbnail">
|
<img src="..." alt="..." class="img-thumbnail">
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
## 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). `block`-level images can be centered using [the `.m-x-auto` margin utility class]({{ site.baseurl }}/components/utilities/#horizontal-centering).
|
Align images with the [helper float classes]({{ site.baseurl }}/utilities/responsive-helpers/#responsive-floats) or [text alignment classes]({{ site.baseurl }}/utilities/typography/#text-alignment). `block`-level images can be centered using [the `.mx-auto` margin utility class]({{ site.baseurl }}/utilities/spacing/#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="rounded float-left" alt="A generic square placeholder image with rounded corners">
|
||||||
<img data-src="holder.js/200x200" class="img-rounded pull-xs-right" alt="A generic square placeholder image with rounded corners">
|
<img data-src="holder.js/200x200" class="rounded float-right" alt="A generic square placeholder image with rounded corners">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<img src="..." class="img-rounded pull-xs-left" alt="...">
|
<img src="..." class="rounded float-left" alt="...">
|
||||||
<img src="..." class="img-rounded pull-xs-right" alt="...">
|
<img src="..." class="rounded float-right" alt="...">
|
||||||
{% 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 m-x-auto d-block" alt="A generic square placeholder image with rounded corners">
|
<img data-src="holder.js/200x200" class="rounded mx-auto d-block" alt="A generic square placeholder image with rounded corners">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<img src="..." class="img-rounded m-x-auto d-block" alt="...">
|
<img src="..." class="rounded mx-auto d-block" alt="...">
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<div class="bd-example bd-example-images">
|
<div class="bd-example bd-example-images">
|
||||||
<div class="text-xs-center">
|
<div class="text-center">
|
||||||
<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="rounded" alt="A generic square placeholder image with rounded corners">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="text-xs-center">
|
<div class="text-center">
|
||||||
<img src="..." class="img-rounded" alt="...">
|
<img src="..." class="rounded" alt="...">
|
||||||
</div>
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user