No more Ruby dependency and most important more than 10 times less build time (at least on Windows)!
Similarly, when contributing to Bootstrap's documentation, you should edit the
documentation source files in
-[the `/bootstrap/site/docs/` directory of the `master` branch](https://github.com/twbs/bootstrap/tree/master/site/docs).
+[the `/bootstrap/site/content/docs/` directory of the `master` branch](https://github.com/twbs/bootstrap/tree/master/site/content/docs).
**Do not edit the `gh-pages` branch.** That branch is generated from the
documentation source files and is managed separately by the Bootstrap Core Team.
# Ignore docs files
/_gh_pages/
-/site/.jekyll-metadata
-/site/docs/**/dist/
-
-# Ignore ruby/bundler files
-/.bundle/
-/vendor/
-/.ruby-version
+/site/static/**/dist/
+/resources/
# Numerous always-ignore extensions
*.diff
node_js:
- "8"
- "10"
-install:
- - bundle install --deployment --jobs=3 --retry=3 --clean
- - npm ci
before_script:
- google-chrome-stable --product-version
script:
cache:
directories:
- "$HOME/.npm"
- - vendor/bundle
notifications:
email: false
+++ /dev/null
-source 'https://rubygems.org'
-
-group :development, :test do
- gem 'jekyll', '~> 3.8.5'
- gem 'jekyll-redirect-from', '~> 0.14.0'
- gem 'jekyll-sitemap', '~> 1.2.0'
- gem 'jekyll-toc', '~> 0.9.1'
- gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
-end
+++ /dev/null
-GEM
- remote: https://rubygems.org/
- specs:
- addressable (2.6.0)
- public_suffix (>= 2.0.2, < 4.0)
- colorator (1.1.0)
- concurrent-ruby (1.1.4)
- em-websocket (0.5.1)
- eventmachine (>= 0.12.9)
- http_parser.rb (~> 0.6.0)
- eventmachine (1.2.7)
- eventmachine (1.2.7-x64-mingw32)
- ffi (1.10.0)
- ffi (1.10.0-x64-mingw32)
- forwardable-extended (2.6.0)
- http_parser.rb (0.6.0)
- i18n (0.9.5)
- concurrent-ruby (~> 1.0)
- jekyll (3.8.5)
- addressable (~> 2.4)
- colorator (~> 1.0)
- em-websocket (~> 0.5)
- i18n (~> 0.7)
- jekyll-sass-converter (~> 1.0)
- jekyll-watch (~> 2.0)
- kramdown (~> 1.14)
- liquid (~> 4.0)
- mercenary (~> 0.3.3)
- pathutil (~> 0.9)
- rouge (>= 1.7, < 4)
- safe_yaml (~> 1.0)
- jekyll-redirect-from (0.14.0)
- jekyll (~> 3.3)
- jekyll-sass-converter (1.5.2)
- sass (~> 3.4)
- jekyll-sitemap (1.2.0)
- jekyll (~> 3.3)
- jekyll-toc (0.9.1)
- nokogiri (~> 1.8)
- jekyll-watch (2.1.2)
- listen (~> 3.0)
- kramdown (1.17.0)
- liquid (4.0.1)
- listen (3.1.5)
- rb-fsevent (~> 0.9, >= 0.9.4)
- rb-inotify (~> 0.9, >= 0.9.7)
- ruby_dep (~> 1.2)
- mercenary (0.3.6)
- mini_portile2 (2.4.0)
- nokogiri (1.10.1)
- mini_portile2 (~> 2.4.0)
- nokogiri (1.10.1-x64-mingw32)
- mini_portile2 (~> 2.4.0)
- pathutil (0.16.2)
- forwardable-extended (~> 2.6)
- public_suffix (3.0.3)
- rb-fsevent (0.10.3)
- rb-inotify (0.10.0)
- ffi (~> 1.0)
- rouge (3.3.0)
- ruby_dep (1.5.0)
- safe_yaml (1.0.5)
- sass (3.7.3)
- sass-listen (~> 4.0.0)
- sass-listen (4.0.0)
- rb-fsevent (~> 0.9, >= 0.9.4)
- rb-inotify (~> 0.9, >= 0.9.7)
- wdm (0.1.1)
-
-PLATFORMS
- ruby
- x64-mingw32
-
-DEPENDENCIES
- jekyll (~> 3.8.5)
- jekyll-redirect-from (~> 0.14.0)
- jekyll-sitemap (~> 1.2.0)
- jekyll-toc (~> 0.9.1)
- wdm (~> 0.1.1)
-
-BUNDLED WITH
- 1.17.3
## Documentation
-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.
+Bootstrap's documentation, included in this repo in the root directory, is built with [Hugo](https://gohugo.io/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
-Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.3/assets/js/src/search.js` file.
+Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/static/docs/4.3/assets/js/src/search.js` file.
### Running documentation locally
-1. Run through the [tooling setup](https://getbootstrap.com/docs/4.3/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`.
-2. Run `npm install` to install Node.js dependencies.
-3. Run `npm start` to compile CSS and JavaScript files, generate our docs, and watch for changes.
-4. Open `http://localhost:9001` in your browser, and voilà.
+1. Run `npm install` to install the Node.js dependencies, including Hugo (the site builder).
+2. Run `npm run test` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets.
+3. From the root `/bootstrap` directory, run `npm run docs-serve` in the command line.
+4. Open `http://localhost:9001/` in your browser, and voilà.
-Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/).
+Learn more about using Hugo by reading its [documentation](https://gohugo.io/documentation/).
### Documentation for previous releases
+++ /dev/null
-# Dependencies
-markdown: kramdown
-highlighter: rouge
-
-kramdown:
- auto_ids: true
-
-# Permalinks
-permalink: pretty
-
-# Server
-source: "site"
-destination: ./_gh_pages
-host: "localhost"
-port: 9001
-baseurl: ""
-url: "https://getbootstrap.com"
-encoding: UTF-8
-exclude:
- - docs/4.3/assets/scss/
-
-plugins:
- - jekyll-redirect-from
- - jekyll-sitemap
- - jekyll-toc
-
-# Social
-title: Bootstrap
-description: "The most popular HTML, CSS, and JS library in the world."
-twitter: getbootstrap
-authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
-social_image_path: /docs/4.3/assets/brand/bootstrap-social.png
-social_logo_path: /docs/4.3/assets/brand/bootstrap-social-logo.png
-
-# Custom variables
-current_version: 4.3.1
-current_ruby_version: 4.3.1
-docs_version: 4.3
-repo: "https://github.com/twbs/bootstrap"
-slack: "https://bootstrap-slack.herokuapp.com"
-opencollective: "https://opencollective.com/bootstrap"
-blog: "https://blog.getbootstrap.com"
-expo: "https://expo.getbootstrap.com"
-themes: "https://themes.getbootstrap.com"
-
-download:
- source: "https://github.com/twbs/bootstrap/archive/v4.3.1.zip"
- dist: "https://github.com/twbs/bootstrap/releases/download/v4.3.1/bootstrap-4.3.1-dist.zip"
-
-cdn:
- # See https://www.srihash.org for info on how to generate the hashes
- css: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
- css_hash: "sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
- js: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
- js_hash: "sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
- js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
- js_bundle_hash: "sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o"
- popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
- popper_hash: "sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
-
-toc:
- min_level: 2
- max_level: 4
- no_toc_section_class:
- - "bd-callout"
- - "bd-example"
sh.config.fatal = true
-const configFile = path.join(__dirname, '../_config.yml')
+const configFile = path.join(__dirname, '../config.yml')
// Array of objects which holds the files to generate SRI hashes for.
// `file` is the path from the root folder
-// `configPropertyName` is the _config.yml variable's name of the file
+// `configPropertyName` is the config.yml variable's name of the file
const files = [
{
file: 'dist/css/bootstrap.min.css',
--- /dev/null
+languageCode: "en"
+title: "Bootstrap"
+baseURL: "https://getbootstrap.com"
+enableInlineShortcodes: true
+
+pygmentsUseClasses: true
+# you can use ```lang if you want too
+pygmentsCodeFences: true
+
+buildDrafts: true
+buildFuture: true
+
+enableRobotsTXT: true
+metaDataFormat: "yaml"
+disableKinds: ["404", "taxonomy", "taxonomyTerm", "RSS"]
+
+publishDir: "_gh_pages"
+archetypeDir: "site/archetypes"
+assetDir: "site/assets"
+contentDir: "site/content"
+dataDir: "site/data"
+layoutDir: "site/layouts"
+staticDir: "site/static"
+themesDir: "site/themes"
+
+params:
+ description: "The most popular HTML, CSS, and JS library in the world."
+ authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
+ social_image_path: /docs/4.3/assets/brand/bootstrap-social.png
+ social_logo_path: /docs/4.3/assets/brand/bootstrap-social-logo.png
+
+ current_version: "4.3.1"
+ current_ruby_version: "4.3.1"
+ docs_version: "4.3"
+ repo: "https://github.com/twbs/bootstrap"
+ twitter: "getbootstrap"
+ slack: "https://bootstrap-slack.herokuapp.com"
+ blog: "https://blog.getbootstrap.com"
+ expo: "https://expo.getbootstrap.com"
+ themes: "https://themes.getbootstrap.com"
+
+ download:
+ source: "https://github.com/twbs/bootstrap/archive/v4.3.1.zip"
+ dist: "https://github.com/twbs/bootstrap/releases/download/v4.3.1/bootstrap-4.3.1-dist.zip"
+
+ cdn:
+ # See https://www.srihash.org for info on how to generate the hashes
+ css: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
+ css_hash: "sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
+ js: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
+ js_hash: "sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
+ js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
+ js_bundle_hash: "sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o"
+ popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
+ popper_hash: "sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==",
"dev": true
},
+ "@sindresorhus/is": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
+ "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==",
+ "dev": true
+ },
"@sinonjs/commons": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.3.1.tgz",
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"dev": true
},
+ "arch": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.1.tgz",
+ "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==",
+ "dev": true
+ },
+ "archive-type": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/archive-type/-/archive-type-4.0.0.tgz",
+ "integrity": "sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=",
+ "dev": true,
+ "requires": {
+ "file-type": "^4.2.0"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-4.4.0.tgz",
+ "integrity": "sha1-G2AOX8ofvcboDApwxxyNul95BsU=",
+ "dev": true
+ }
+ }
+ },
"are-we-there-yet": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
"integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=",
"dev": true
},
+ "base64-js": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
+ "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==",
+ "dev": true
+ },
"base64id": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
"integrity": "sha512-3UQFKcRMx+5Z+IK5vYTMYK2jzLRJkt+XqyDdacgWgtMjjuifKpKTFneJLEgeBElOE2/lXZ1LcMcb5s8pwG2U8Q==",
"dev": true
},
+ "bin-check": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bin-check/-/bin-check-4.1.0.tgz",
+ "integrity": "sha512-b6weQyEUKsDGFlACWSIOfveEnImkJyK/FGW6FAG42loyoquvjdtOIqO6yBFzHyqyVVhNgNkQxxx09SFLK28YnA==",
+ "dev": true,
+ "requires": {
+ "execa": "^0.7.0",
+ "executable": "^4.1.0"
+ }
+ },
+ "bin-version": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/bin-version/-/bin-version-3.0.0.tgz",
+ "integrity": "sha512-Ekhwm6AUiMbZ1LgVCNMkgjovpMR30FyQN74laAW9gs0NPjZR5gdY0ARNB0YsQG8GOme3CsHbxmeyq/7Ofq6QYQ==",
+ "dev": true,
+ "requires": {
+ "execa": "^1.0.0",
+ "find-versions": "^3.0.0"
+ },
+ "dependencies": {
+ "execa": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
+ "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^6.0.0",
+ "get-stream": "^4.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
+ }
+ },
+ "get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dev": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ }
+ }
+ },
+ "bin-version-check": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/bin-version-check/-/bin-version-check-4.0.0.tgz",
+ "integrity": "sha512-sR631OrhC+1f8Cvs8WyVWOA33Y8tgwjETNPyyD/myRBXLkfS/vl74FmH/lFcRl9KY3zwGh7jFhvyk9vV3/3ilQ==",
+ "dev": true,
+ "requires": {
+ "bin-version": "^3.0.0",
+ "semver": "^5.6.0",
+ "semver-truncate": "^1.1.2"
+ }
+ },
+ "bin-wrapper": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bin-wrapper/-/bin-wrapper-4.1.0.tgz",
+ "integrity": "sha512-hfRmo7hWIXPkbpi0ZltboCMVrU+0ClXR/JgbCKKjlDjQf6igXa7OwdqNcFWQZPZTgiY7ZpzE3+LjjkLiTN2T7Q==",
+ "dev": true,
+ "requires": {
+ "bin-check": "^4.1.0",
+ "bin-version-check": "^4.0.0",
+ "download": "^7.1.0",
+ "import-lazy": "^3.1.0",
+ "os-filter-obj": "^2.0.0",
+ "pify": "^4.0.1"
+ },
+ "dependencies": {
+ "import-lazy": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-3.1.0.tgz",
+ "integrity": "sha512-8/gvXvX2JMn0F+CDlSC4l6kOmVaLOO3XLkksI7CI3Ud95KDYJuYur2b9P/PUt/i/pDAMd/DulQsNbbbmRRsDIQ==",
+ "dev": true
+ },
+ "pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
+ "dev": true
+ }
+ }
+ },
"binary": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
"integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==",
"dev": true
},
+ "bl": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
+ "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
+ "dev": true,
+ "requires": {
+ "readable-stream": "^2.3.5",
+ "safe-buffer": "^5.1.1"
+ }
+ },
"blob": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz",
"unzipper": "^0.9.3"
}
},
+ "buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz",
+ "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==",
+ "dev": true,
+ "requires": {
+ "base64-js": "^1.0.2",
+ "ieee754": "^1.1.4"
+ }
+ },
"buffer-alloc": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
"integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==",
"dev": true
},
+ "buffer-crc32": {
+ "version": "0.2.13",
+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
+ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
+ "dev": true
+ },
"buffer-fill": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
"unset-value": "^1.0.0"
}
},
+ "cacheable-request": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz",
+ "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=",
+ "dev": true,
+ "requires": {
+ "clone-response": "1.0.2",
+ "get-stream": "3.0.0",
+ "http-cache-semantics": "3.8.1",
+ "keyv": "3.0.0",
+ "lowercase-keys": "1.0.0",
+ "normalize-url": "2.0.1",
+ "responselike": "1.0.2"
+ },
+ "dependencies": {
+ "lowercase-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz",
+ "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=",
+ "dev": true
+ }
+ }
+ },
"call-me-maybe": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"dev": true
},
+ "caw": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz",
+ "integrity": "sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==",
+ "dev": true,
+ "requires": {
+ "get-proxy": "^2.0.0",
+ "isurl": "^1.0.0-alpha5",
+ "tunnel-agent": "^0.6.0",
+ "url-to-options": "^1.0.1"
+ }
+ },
"ccount": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.3.tgz",
"is-supported-regexp-flag": "^1.0.0"
}
},
+ "clone-response": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
+ "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=",
+ "dev": true,
+ "requires": {
+ "mimic-response": "^1.0.0"
+ }
+ },
"code-point-at": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
+ "config-chain": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz",
+ "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==",
+ "dev": true,
+ "requires": {
+ "ini": "^1.3.4",
+ "proto-list": "~1.2.1"
+ }
+ },
"configstore": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz",
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
"dev": true
},
+ "content-disposition": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
+ "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "5.1.2"
+ }
+ },
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true
},
+ "corser": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
+ "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=",
+ "dev": true
+ },
"cosmiconfig": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-4.0.0.tgz",
"integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
"dev": true
},
+ "decompress": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz",
+ "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=",
+ "dev": true,
+ "requires": {
+ "decompress-tar": "^4.0.0",
+ "decompress-tarbz2": "^4.0.0",
+ "decompress-targz": "^4.0.0",
+ "decompress-unzip": "^4.0.1",
+ "graceful-fs": "^4.1.10",
+ "make-dir": "^1.0.0",
+ "pify": "^2.3.0",
+ "strip-dirs": "^2.0.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ }
+ }
+ },
+ "decompress-response": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
+ "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=",
+ "dev": true,
+ "requires": {
+ "mimic-response": "^1.0.0"
+ }
+ },
+ "decompress-tar": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz",
+ "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==",
+ "dev": true,
+ "requires": {
+ "file-type": "^5.2.0",
+ "is-stream": "^1.1.0",
+ "tar-stream": "^1.5.2"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
+ "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=",
+ "dev": true
+ }
+ }
+ },
+ "decompress-tarbz2": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz",
+ "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==",
+ "dev": true,
+ "requires": {
+ "decompress-tar": "^4.1.0",
+ "file-type": "^6.1.0",
+ "is-stream": "^1.1.0",
+ "seek-bzip": "^1.0.5",
+ "unbzip2-stream": "^1.0.9"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz",
+ "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==",
+ "dev": true
+ }
+ }
+ },
+ "decompress-targz": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz",
+ "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==",
+ "dev": true,
+ "requires": {
+ "decompress-tar": "^4.1.1",
+ "file-type": "^5.2.0",
+ "is-stream": "^1.1.0"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
+ "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=",
+ "dev": true
+ }
+ }
+ },
+ "decompress-unzip": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz",
+ "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=",
+ "dev": true,
+ "requires": {
+ "file-type": "^3.8.0",
+ "get-stream": "^2.2.0",
+ "pify": "^2.3.0",
+ "yauzl": "^2.4.2"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "3.9.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
+ "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=",
+ "dev": true
+ },
+ "get-stream": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz",
+ "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=",
+ "dev": true,
+ "requires": {
+ "object-assign": "^4.0.1",
+ "pinkie-promise": "^2.0.0"
+ }
+ },
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ }
+ }
+ },
"deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"is-obj": "^1.0.0"
}
},
+ "download": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/download/-/download-7.1.0.tgz",
+ "integrity": "sha512-xqnBTVd/E+GxJVrX5/eUJiLYjCGPwMpdL+jGhGU57BvtcA7wwhtHVbXBeUk51kOpW3S7Jn3BQbN9Q1R1Km2qDQ==",
+ "dev": true,
+ "requires": {
+ "archive-type": "^4.0.0",
+ "caw": "^2.0.1",
+ "content-disposition": "^0.5.2",
+ "decompress": "^4.2.0",
+ "ext-name": "^5.0.0",
+ "file-type": "^8.1.0",
+ "filenamify": "^2.0.0",
+ "get-stream": "^3.0.0",
+ "got": "^8.3.1",
+ "make-dir": "^1.2.0",
+ "p-event": "^2.1.0",
+ "pify": "^3.0.0"
+ },
+ "dependencies": {
+ "got": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz",
+ "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==",
+ "dev": true,
+ "requires": {
+ "@sindresorhus/is": "^0.7.0",
+ "cacheable-request": "^2.1.1",
+ "decompress-response": "^3.3.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^3.0.0",
+ "into-stream": "^3.1.0",
+ "is-retry-allowed": "^1.1.0",
+ "isurl": "^1.0.0-alpha5",
+ "lowercase-keys": "^1.0.0",
+ "mimic-response": "^1.0.0",
+ "p-cancelable": "^0.4.0",
+ "p-timeout": "^2.0.1",
+ "pify": "^3.0.0",
+ "safe-buffer": "^5.1.1",
+ "timed-out": "^4.0.1",
+ "url-parse-lax": "^3.0.0",
+ "url-to-options": "^1.0.1"
+ }
+ },
+ "prepend-http": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
+ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=",
+ "dev": true
+ },
+ "url-parse-lax": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
+ "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=",
+ "dev": true,
+ "requires": {
+ "prepend-http": "^2.0.0"
+ }
+ }
+ }
+ },
"duplexer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
"clone-regexp": "^1.0.0"
}
},
+ "executable": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz",
+ "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==",
+ "dev": true,
+ "requires": {
+ "pify": "^2.2.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ }
+ }
+ },
"expand-brackets": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
}
}
},
+ "ext-list": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz",
+ "integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==",
+ "dev": true,
+ "requires": {
+ "mime-db": "^1.28.0"
+ }
+ },
+ "ext-name": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ext-name/-/ext-name-5.0.0.tgz",
+ "integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==",
+ "dev": true,
+ "requires": {
+ "ext-list": "^2.0.0",
+ "sort-keys-length": "^1.0.0"
+ }
+ },
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
"dev": true
},
+ "fd-slicer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
+ "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
+ "dev": true,
+ "requires": {
+ "pend": "~1.2.0"
+ }
+ },
"figures": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
"flat-cache": "^2.0.1"
}
},
+ "file-type": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-8.1.0.tgz",
+ "integrity": "sha512-qyQ0pzAy78gVoJsmYeNgl8uH8yKhr1lVhW7JbzJmnlRi0I4R2eEDEJZVKG8agpDnLpacwNbDhLNG/LMdxHD2YQ==",
+ "dev": true
+ },
+ "filename-reserved-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz",
+ "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=",
+ "dev": true
+ },
+ "filenamify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-2.1.0.tgz",
+ "integrity": "sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==",
+ "dev": true,
+ "requires": {
+ "filename-reserved-regex": "^2.0.0",
+ "strip-outer": "^1.0.0",
+ "trim-repeated": "^1.0.0"
+ }
+ },
"fileset": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz",
"locate-path": "^3.0.0"
}
},
+ "find-versions": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.0.0.tgz",
+ "integrity": "sha512-IUvtItVFNmTtKoB0PRfbkR0zR9XMG5rWNO3qI1S8L0zdv+v2gqzM0pAunloxqbqAfT8w7bg8n/5gHzTXte8H5A==",
+ "dev": true,
+ "requires": {
+ "array-uniq": "^2.0.0",
+ "semver-regex": "^2.0.0"
+ },
+ "dependencies": {
+ "array-uniq": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-2.0.0.tgz",
+ "integrity": "sha512-O3QZEr+3wDj7otzF7PjNGs6CA3qmYMLvt5xGkjY/V0VxS+ovvqVo/5wKM/OVOAyuX4DTh9H31zE/yKtO66hTkg==",
+ "dev": true
+ }
+ }
+ },
"flat-cache": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
"map-cache": "^0.2.2"
}
},
+ "from2": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
+ "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.0.0"
+ }
+ },
"fs-access": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz",
"null-check": "^1.0.0"
}
},
+ "fs-constants": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
+ "dev": true
+ },
"fs-extra": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"concat-map": {
"version": "0.0.1",
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"core-util-is": {
"version": "1.0.2",
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"ini": {
"version": "1.3.5",
"version": "1.0.0",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"object-assign": {
"version": "4.1.1",
"version": "1.4.0",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"wrappy": "1"
}
"version": "1.0.2",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
"dev": true
},
+ "get-proxy": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/get-proxy/-/get-proxy-2.1.0.tgz",
+ "integrity": "sha512-zmZIaQTWnNQb4R4fJUEp/FC51eZsc6EkErspy3xtIYStaq8EB/hDIWipxsal+E8rz0qD7f2sL/NA9Xee4RInJw==",
+ "dev": true,
+ "requires": {
+ "npm-conf": "^1.1.0"
+ }
+ },
"get-stdin": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
"dev": true
},
+ "graceful-readlink": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
+ "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
+ "dev": true
+ },
"growl": {
"version": "1.10.5",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
+ "has-symbol-support-x": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz",
+ "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==",
+ "dev": true
+ },
"has-symbols": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
"integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=",
"dev": true
},
+ "has-to-string-tag-x": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz",
+ "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==",
+ "dev": true,
+ "requires": {
+ "has-symbol-support-x": "^1.4.1"
+ }
+ },
"has-unicode": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
}
}
},
+ "http-cache-semantics": {
+ "version": "3.8.1",
+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz",
+ "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==",
+ "dev": true
+ },
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"requires-port": "^1.0.0"
}
},
+ "http-server": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.11.1.tgz",
+ "integrity": "sha512-6JeGDGoujJLmhjiRGlt8yK8Z9Kl0vnl/dQoQZlc4oeqaUoAKQg94NILLfrY3oWzSyFaQCVNTcKE5PZ3cH8VP9w==",
+ "dev": true,
+ "requires": {
+ "colors": "1.0.3",
+ "corser": "~2.0.0",
+ "ecstatic": "^3.0.0",
+ "http-proxy": "^1.8.1",
+ "opener": "~1.4.0",
+ "optimist": "0.6.x",
+ "portfinder": "^1.0.13",
+ "union": "~0.4.3"
+ },
+ "dependencies": {
+ "colors": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
+ "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
+ "dev": true
+ }
+ }
+ },
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
}
}
},
+ "hugo-bin": {
+ "version": "0.42.0",
+ "resolved": "https://registry.npmjs.org/hugo-bin/-/hugo-bin-0.42.0.tgz",
+ "integrity": "sha512-GlPU2cmRLMPFJ6tkHIbsCDS3myWEA803pSV39/71476dUKkVoaKAqPoXI+OFB92TBc+k4Svc037VhODdITpBdQ==",
+ "dev": true,
+ "requires": {
+ "bin-wrapper": "^4.1.0",
+ "pkg-conf": "^2.1.0",
+ "rimraf": "^2.6.3",
+ "signale": "^1.3.0"
+ }
+ },
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"safer-buffer": ">= 2.1.2 < 3"
}
},
+ "ieee754": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz",
+ "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==",
+ "dev": true
+ },
"ignore": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
"integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
"dev": true
},
+ "into-stream": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz",
+ "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=",
+ "dev": true,
+ "requires": {
+ "from2": "^2.1.1",
+ "p-is-promise": "^1.1.0"
+ },
+ "dependencies": {
+ "p-is-promise": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz",
+ "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=",
+ "dev": true
+ }
+ }
+ },
"invariant": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
"integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
"dev": true
},
+ "is-natural-number": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz",
+ "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=",
+ "dev": true
+ },
"is-npm": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true
},
+ "is-object": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz",
+ "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=",
+ "dev": true
+ },
"is-path-inside": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
"handlebars": "^4.1.0"
}
},
+ "isurl": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz",
+ "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==",
+ "dev": true,
+ "requires": {
+ "has-to-string-tag-x": "^1.2.0",
+ "is-object": "^1.0.1"
+ }
+ },
"jquery": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
"dev": true
},
+ "json-buffer": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
+ "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=",
+ "dev": true
+ },
"json-parse-better-errors": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
"integrity": "sha1-TjRD8oMP3s/2JNN0cWPxIX2qKpo=",
"dev": true
},
+ "keyv": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz",
+ "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==",
+ "dev": true,
+ "requires": {
+ "json-buffer": "3.0.0"
+ }
+ },
"kind-of": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
"dev": true
},
+ "mimic-response": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
+ "dev": true
+ },
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=",
"dev": true
},
+ "normalize-url": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz",
+ "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==",
+ "dev": true,
+ "requires": {
+ "prepend-http": "^2.0.0",
+ "query-string": "^5.0.1",
+ "sort-keys": "^2.0.0"
+ },
+ "dependencies": {
+ "prepend-http": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
+ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=",
+ "dev": true
+ },
+ "sort-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz",
+ "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=",
+ "dev": true,
+ "requires": {
+ "is-plain-obj": "^1.0.0"
+ }
+ }
+ }
+ },
+ "npm-conf": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz",
+ "integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==",
+ "dev": true,
+ "requires": {
+ "config-chain": "^1.1.11",
+ "pify": "^3.0.0"
+ }
+ },
"npm-run-all": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
}
}
},
+ "opener": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz",
+ "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=",
+ "dev": true
+ },
"opn": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz",
}
}
},
+ "os-filter-obj": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/os-filter-obj/-/os-filter-obj-2.0.0.tgz",
+ "integrity": "sha512-uksVLsqG3pVdzzPvmAHpBK0wKxYItuzZr7SziusRPoz67tGV8rL1szZ6IdeUrbqLjGDwApBtN29eEE3IqGHOjg==",
+ "dev": true,
+ "requires": {
+ "arch": "^2.1.0"
+ }
+ },
"os-homedir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"mkdirp": "^0.5.1"
}
},
+ "p-cancelable": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz",
+ "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==",
+ "dev": true
+ },
"p-defer": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
"integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
"dev": true
},
+ "p-event": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/p-event/-/p-event-2.3.1.tgz",
+ "integrity": "sha512-NQCqOFhbpVTMX4qMe8PF8lbGtzZ+LCiN7pcNrb/413Na7+TRoe1xkKUzuWa/YEJdGQ0FvKtj35EEbDoVPO2kbA==",
+ "dev": true,
+ "requires": {
+ "p-timeout": "^2.0.1"
+ }
+ },
"p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"p-limit": "^2.0.0"
}
},
+ "p-timeout": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz",
+ "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==",
+ "dev": true,
+ "requires": {
+ "p-finally": "^1.0.0"
+ }
+ },
"p-try": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
"pify": "^3.0.0"
}
},
+ "pend": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
+ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=",
+ "dev": true
+ },
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"pinkie": "^2.0.0"
}
},
+ "pkg-conf": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz",
+ "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=",
+ "dev": true,
+ "requires": {
+ "find-up": "^2.0.0",
+ "load-json-file": "^4.0.0"
+ },
+ "dependencies": {
+ "find-up": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
+ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+ "dev": true,
+ "requires": {
+ "locate-path": "^2.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
+ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
+ "dev": true,
+ "requires": {
+ "p-locate": "^2.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
+ "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
+ "dev": true,
+ "requires": {
+ "p-try": "^1.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
+ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
+ "dev": true,
+ "requires": {
+ "p-limit": "^1.1.0"
+ }
+ },
+ "p-try": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
+ "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
+ "dev": true
+ }
+ }
+ },
"pkg-dir": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
"integrity": "sha512-4q1hNvoUre/8srWsH7hnoSJ5xVmIL4qgz+s4qf2TnJIMyZFUFMGH+9vE7mXynAlHSZ/NdTmmow86muD0myUkVQ==",
"dev": true
},
+ "portfinder": {
+ "version": "1.0.20",
+ "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.20.tgz",
+ "integrity": "sha512-Yxe4mTyDzTd59PZJY4ojZR8F+E5e97iq2ZOHPz3HDgSvYC5siNad2tLooQ5y5QHyQhc3xVqvyk/eNA3wuoa7Sw==",
+ "dev": true,
+ "requires": {
+ "async": "^1.5.2",
+ "debug": "^2.2.0",
+ "mkdirp": "0.5.x"
+ },
+ "dependencies": {
+ "async": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
+ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
+ "dev": true
+ }
+ }
+ },
"posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
"dev": true
},
+ "proto-list": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
+ "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=",
+ "dev": true
+ },
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true
},
+ "query-string": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz",
+ "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==",
+ "dev": true,
+ "requires": {
+ "decode-uri-component": "^0.2.0",
+ "object-assign": "^4.1.0",
+ "strict-uri-encode": "^1.0.0"
+ }
+ },
"quick-lru": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
"integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
"dev": true
},
+ "responselike": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
+ "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=",
+ "dev": true,
+ "requires": {
+ "lowercase-keys": "^1.0.0"
+ }
+ },
"restore-cursor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
}
}
},
+ "seek-bzip": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz",
+ "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=",
+ "dev": true,
+ "requires": {
+ "commander": "~2.8.1"
+ },
+ "dependencies": {
+ "commander": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
+ "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=",
+ "dev": true,
+ "requires": {
+ "graceful-readlink": ">= 1.0.0"
+ }
+ }
+ }
+ },
"semver": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
"semver": "^5.0.3"
}
},
+ "semver-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz",
+ "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==",
+ "dev": true
+ },
+ "semver-truncate": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/semver-truncate/-/semver-truncate-1.1.2.tgz",
+ "integrity": "sha1-V/Qd5pcHpicJp+AQS6IRcQnqR+g=",
+ "dev": true,
+ "requires": {
+ "semver": "^5.3.0"
+ }
+ },
"server-destroy": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"dev": true
},
+ "signale": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz",
+ "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.3.2",
+ "figures": "^2.0.0",
+ "pkg-conf": "^2.1.0"
+ }
+ },
"sinon": {
"version": "7.2.5",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.5.tgz",
}
}
},
+ "sort-keys": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
+ "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
+ "dev": true,
+ "requires": {
+ "is-plain-obj": "^1.0.0"
+ }
+ },
+ "sort-keys-length": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz",
+ "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=",
+ "dev": true,
+ "requires": {
+ "sort-keys": "^1.0.0"
+ }
+ },
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
}
}
},
+ "strict-uri-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
+ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
+ "dev": true
+ },
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
"integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
"dev": true
},
+ "strip-dirs": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz",
+ "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==",
+ "dev": true,
+ "requires": {
+ "is-natural-number": "^4.0.1"
+ }
+ },
"strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"dev": true
},
+ "strip-outer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz",
+ "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.2"
+ }
+ },
"style-search": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz",
"inherits": "2"
}
},
+ "tar-stream": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz",
+ "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==",
+ "dev": true,
+ "requires": {
+ "bl": "^1.0.0",
+ "buffer-alloc": "^1.2.0",
+ "end-of-stream": "^1.0.0",
+ "fs-constants": "^1.0.0",
+ "readable-stream": "^2.3.0",
+ "to-buffer": "^1.1.1",
+ "xtend": "^4.0.0"
+ }
+ },
"term-size": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz",
"integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=",
"dev": true
},
+ "to-buffer": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
+ "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==",
+ "dev": true
+ },
"to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
"integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=",
"dev": true
},
+ "trim-repeated": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz",
+ "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.2"
+ }
+ },
"trim-right": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
"integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==",
"dev": true
},
+ "unbzip2-stream": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz",
+ "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==",
+ "dev": true,
+ "requires": {
+ "buffer": "^5.2.1",
+ "through": "^2.3.8"
+ }
+ },
"undefsafe": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz",
"x-is-string": "^0.1.0"
}
},
+ "union": {
+ "version": "0.4.6",
+ "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz",
+ "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=",
+ "dev": true,
+ "requires": {
+ "qs": "~2.3.3"
+ },
+ "dependencies": {
+ "qs": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz",
+ "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=",
+ "dev": true
+ }
+ }
+ },
"union-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
"prepend-http": "^1.0.1"
}
},
+ "url-to-options": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz",
+ "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=",
+ "dev": true
+ },
"use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
"camelcase": "^4.1.0"
}
},
+ "yauzl": {
+ "version": "2.10.0",
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
+ "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
+ "dev": true,
+ "requires": {
+ "buffer-crc32": "~0.2.3",
+ "fd-slicer": "~1.1.0"
+ }
+ },
"yeast": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
"linkinator": "linkinator _gh_pages --recurse --skip \"^(?!http://localhost)\"",
"bundlesize": "bundlesize",
"css": "npm-run-all css-compile css-prefix css-minify css-copy",
- "css-copy": "cross-env-shell shx mkdir -p site/docs/$npm_package_version_short/dist/ && cross-env-shell shx cp -r dist/css/ site/docs/$npm_package_version_short/dist/",
+ "css-copy": "cross-env-shell shx mkdir -p site/static/docs/$npm_package_version_short/dist/ && cross-env-shell shx cp -r dist/css/ site/static/docs/$npm_package_version_short/dist/",
"css-main": "npm-run-all css-lint css-compile-main css-prefix-main css-minify-main css-copy",
- "css-docs": "npm-run-all css-compile-docs css-prefix-docs css-minify-docs",
+ "css-docs": "npm-run-all css-compile-docs css-prefix-docs css-prefix-examples css-minify-docs",
"css-compile": "npm-run-all --parallel css-compile-*",
"css-compile-main": "node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/bootstrap.scss dist/css/bootstrap.css && node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/bootstrap-grid.scss dist/css/bootstrap-grid.css && node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/bootstrap-reboot.scss dist/css/bootstrap-reboot.css && npm run css-copy",
- "css-compile-docs": "cross-env-shell node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 site/docs/$npm_package_version_short/assets/scss/docs.scss site/docs/$npm_package_version_short/assets/css/docs.min.css",
+ "css-compile-docs": "cross-env-shell node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 site/static/docs/$npm_package_version_short/assets/scss/docs.scss site/static/docs/$npm_package_version_short/assets/css/docs.min.css",
"css-lint": "npm-run-all --parallel css-lint-*",
"css-lint-main": "stylelint \"scss/**/*.scss\" --cache --cache-location .cache/.stylelintcache",
- "css-lint-docs": "stylelint \"site/docs/**/assets/scss/*.scss\" \"site/docs/**/*.css\" --cache --cache-location .cache/.stylelintcache",
- "css-lint-vars": "fusv scss/ site/docs/",
+ "css-lint-docs": "stylelint \"site/static/**/assets/scss/*.scss\" \"site/content/**/*.css\" --cache --cache-location .cache/.stylelintcache",
+ "css-lint-vars": "fusv scss/ site/static/",
"css-minify": "npm-run-all --parallel css-minify-*",
"css-minify-main": "cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css",
- "css-minify-docs": "cross-env-shell cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output site/docs/$npm_package_version_short/assets/css/docs.min.css site/docs/$npm_package_version_short/assets/css/docs.min.css",
+ "css-minify-docs": "cross-env-shell cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output site/static/docs/$npm_package_version_short/assets/css/docs.min.css site/static/docs/$npm_package_version_short/assets/css/docs.min.css",
"css-prefix": "npm-run-all --parallel css-prefix-*",
"css-prefix-main": "postcss --config build/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.min.css\"",
- "css-prefix-docs": "postcss --config build/postcss.config.js --replace \"site/docs/**/*.css\" \"site/docs/**/*.css\"",
+ "css-prefix-docs": "postcss --config build/postcss.config.js --replace \"site/static/**/*.css\" \"site/static/**/*.css\"",
+ "css-prefix-examples": "postcss --config build/postcss.config.js --replace \"site/content/**/*.css\" \"site/content/**/*.css\"",
"js": "npm-run-all js-compile js-minify js-copy",
- "js-copy": "cross-env-shell shx mkdir -p site/docs/$npm_package_version_short/dist/ && cross-env-shell shx cp -r dist/js/ site/docs/$npm_package_version_short/dist/",
+ "js-copy": "cross-env-shell shx mkdir -p site/static/docs/$npm_package_version_short/dist/ && cross-env-shell shx cp -r dist/js/ site/static/docs/$npm_package_version_short/dist/",
"js-main": "npm-run-all js-lint js-compile js-minify-main",
"js-docs": "npm-run-all js-lint-docs js-minify-docs",
"js-compile": "npm-run-all --parallel js-compile-* --sequential js-copy",
"js-minify-standalone": "terser --compress --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
"js-minify-standalone-esm": "terser --compress --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.esm.js.map,includeSources,url=bootstrap.esm.min.js.map\" --output dist/js/bootstrap.esm.min.js dist/js/bootstrap.esm.js",
"js-minify-bundle": "terser --compress --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.bundle.js.map,includeSources,url=bootstrap.bundle.min.js.map\" --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",
- "js-minify-docs": "cross-env-shell terser --mangle --comments \\\"/^!/\\\" --output site/docs/$npm_package_version_short/assets/js/docs.min.js site/docs/$npm_package_version_short/assets/js/vendor/anchor.min.js site/docs/$npm_package_version_short/assets/js/vendor/clipboard.min.js site/docs/$npm_package_version_short/assets/js/vendor/bs-custom-file-input.min.js \"site/docs/$npm_package_version_short/assets/js/src/*.js\"",
+ "js-minify-docs": "cross-env-shell terser --mangle --comments \\\"/^!/\\\" --output site/static/docs/$npm_package_version_short/assets/js/docs.min.js site/static/docs/$npm_package_version_short/assets/js/vendor/anchor.min.js site/static/docs/$npm_package_version_short/assets/js/vendor/clipboard.min.js site/static/docs/$npm_package_version_short/assets/js/vendor/bs-custom-file-input.min.js \"site/static/docs/$npm_package_version_short/assets/js/src/*.js\"",
"js-test": "npm-run-all js-test-karma* js-test-integration",
"js-debug": "cross-env DEBUG=true karma start js/tests/karma.conf.js",
"js-test-karma": "karma start js/tests/karma.conf.js",
"lint": "npm-run-all --parallel js-lint css-lint",
"coveralls": "shx cat js/coverage/lcov.info | coveralls",
"docs": "npm-run-all css-docs js-docs docs-compile docs-lint",
- "docs-compile": "bundle exec jekyll build",
- "docs-production": "cross-env JEKYLL_ENV=production npm run docs-compile",
+ "docs-compile": "hugo --cleanDestinationDir",
+ "docs-production": "cross-env HUGO_ENV=production npm run docs-compile",
"docs-lint": "node build/vnu-jar.js",
- "docs-serve": "bundle exec jekyll serve",
- "docs-serve-only": "npm run docs-serve -- --skip-initial-build --no-watch",
- "update-deps": "ncu -a -x jquery -x bundlesize && npm update && bundle update && cross-env-shell echo Manually update \\\"site/docs/$npm_package_version_short/assets/js/vendor/\\\"",
+ "docs-serve": "hugo server --port 9001 --disableFastRender --renderToDisk",
+ "docs-serve-only": "http-server _gh_pages -p 9001 -a localhost",
+ "update-deps": "ncu -a -x jquery -x bundlesize && npm update && cross-env-shell echo Manually update \\\"site/static/docs/$npm_package_version_short/assets/js/vendor/\\\"",
"release": "npm-run-all dist release-sri release-zip docs-production",
"release-sri": "node build/generate-sri.js",
"release-version": "node build/change-version.js",
"test": "npm-run-all lint dist js-test docs-compile docs-lint bundlesize",
"watch": "npm-run-all --parallel watch-*",
"watch-css-main": "nodemon --watch scss/ --ext scss --exec \"npm run css-main\"",
- "watch-css-docs": "nodemon --watch \"site/docs/**/assets/scss/\" --ext scss --exec \"npm run css-docs\"",
+ "watch-css-docs": "nodemon --watch \"site/static/**/assets/scss/\" --ext scss --exec \"npm run css-docs\"",
"watch-js-main": "nodemon --watch js/src/ --ext js --exec \"npm run js-compile\"",
- "watch-js-docs": "nodemon --watch \"site/docs/**/assets/js/src/\" --ext js --exec \"npm run js-docs\""
+ "watch-js-docs": "nodemon --watch \"site/static/**/assets/js/src/\" --ext js --exec \"npm run js-docs\""
},
"style": "dist/css/bootstrap.css",
"sass": "scss/bootstrap.scss",
"find-unused-sass-variables": "^0.3.2",
"glob": "^7.1.3",
"hammer-simulator": "0.0.1",
+ "http-server": "^0.11.1",
+ "hugo-bin": "^0.42.0",
"ip": "^1.1.5",
"jquery": "^3.3.1",
"karma": "^4.0.1",
+++ /dev/null
-- group: v1.x
- baseurl: https://getbootstrap.com
- description: Every minor and patch release from v1 is listed below.
- versions:
- - v: 1.0.0
- - v: 1.1.0
- - v: 1.1.1
- - v: 1.2.0
- - v: 1.3.0
- - v: 1.4.0
-
-- group: v2.x
- baseurl: https://getbootstrap.com
- description: Every minor and patch release from v2 is listed below.
- versions:
- - v: 2.0.0
- - v: 2.0.1
- - v: 2.0.2
- - v: 2.0.3
- - v: 2.0.4
- - v: 2.1.0
- - v: 2.1.1
- - v: 2.2.0
- - v: 2.2.1
- - v: 2.2.2
- - v: 2.3.0
- - v: 2.3.1
- - v: 2.3.2
-
-- group: v3.x
- baseurl: https://getbootstrap.com/docs
- description: Our previous major release and its minor versions. Last update was v3.4.1.
- versions:
- - v: 3.3
- - v: 3.4
-
-- group: v4.x
- baseurl: https://getbootstrap.com/docs
- description: Current major release with two minor releases. Last update was v4.3.1.
- versions:
- - v: 4.0
- - v: 4.1
- - v: 4.2
- - v: 4.3
+++ /dev/null
-{%- comment -%}
- Usage: include bugify.html content=text,
- where content is a string that contains a bug reference name and id.
- e.g. Bootstrap#19984
-{%- endcomment -%}
-
-{%- assign words = include.content | split: " " -%}
-
-{%- for word in words -%}
- {% if word contains "#" %}
- {% if word contains "," %}{% assign separator = true %}{% else %}{% assign separator = false %}{% endif %}
- {%- assign data = word | split: "#" -%}
- {%- assign bug_cat = data[0] | strip_newlines -%}
- {%- assign bug_id = data[1] | strip_newlines | remove: "," -%}
-
- {%- case bug_cat -%}
- {%- when "Bootstrap" -%}
- <a href="https://github.com/twbs/bootstrap/issues/{{ bug_id }}">#{{ bug_id }}</a>
- {%- when "Edge" -%}
- <a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/{{ bug_id }}/">Edge issue #{{ bug_id }}</a>
- {%- when "A11yUserVoice" -%}
- <a href="https://microsoftaccessibility.uservoice.com/forums/307429-microsoft-accessibility-feedback/suggestions/{{ bug_id }}">Microsoft A11y UserVoice idea #{{ bug_id }}</a>
- {%- when "UserVoice" -%}
- <a href="https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/{{ bug_id }}">Edge UserVoice idea #{{ bug_id }}</a>
- {%- when "Mozilla" -%}
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id={{ bug_id }}">Mozilla bug #{{ bug_id }}</a>
- {%- when "Chromium" -%}
- <a href="https://bugs.chromium.org/p/chromium/issues/detail?id={{ bug_id }}">Chromium issue #{{ bug_id }}</a>
- {%- when "WebKit" -%}
- <a href="https://bugs.webkit.org/show_bug.cgi?id={{ bug_id }}">WebKit bug #{{ bug_id }}</a>
- {%- when "Safari" -%}
- <a href="https://openradar.appspot.com/{{ bug_id }}">Apple Safari Radar #{{ bug_id }}</a>
- {%- when "Normalize" -%}
- <a href="https://github.com/necolas/normalize.css/issues/{{ bug_id }}">Normalize #{{ bug_id }}</a>
- {%- else -%}
- <strong>parse error</strong>
- {%- endcase -%}{% if separator %}, {% endif %}
-
- {% else %}
- {{ word }}
- {%- endif -%}
-{%- endfor -%}
+++ /dev/null
-{% capture callout %}
-The animation effect of this component is dependent on the `prefers-reduced-motion` media query. See the [reduced motion section of our accessibility documentation]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/accessibility/#reduced-motion).
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+++ /dev/null
-{%- comment -%}
- Usage: include callout.html content=callout type="type",
- where content is a capture with the content
- and type is one of: info (default), danger, warning
-{%- endcomment -%}
-{%- assign css_class = include.type | default: "info" -%}
-<div class="bd-callout bd-callout-{{ css_class }}">
- {{- include.content | markdownify -}}
-</div>
+++ /dev/null
-<header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
- <a class="navbar-brand mr-0 mr-md-2" href="{{ site.baseurl }}/" aria-label="Bootstrap">
- {%- include icons/bootstrap.svg width="36" height="36" class="d-block" -%}
- </a>
-
- <div class="navbar-nav-scroll">
- <ul class="navbar-nav bd-navbar-nav flex-row">
- <li class="nav-item">
- <a class="nav-link {% if page.layout == "home" %}active{% endif %}" href="{{ site.baseurl }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Home</a>
- </li>
- <li class="nav-item">
- <a class="nav-link {% if page.layout == "docs" %}active{% endif %}" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/introduction/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Docs');">Documentation</a>
- </li>
- <li class="nav-item">
- <a class="nav-link {% if page.title == "Examples" %}active{% endif %}" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/examples/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Examples');">Examples</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="{{ site.themes }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');" target="_blank" rel="noopener">Themes</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="{{ site.expo }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Expo');" target="_blank" rel="noopener">Expo</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="{{ site.blog }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Blog');" target="_blank" rel="noopener">Blog</a>
- </li>
- </ul>
- </div>
-
- <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
- <li class="nav-item dropdown">
- <a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-expanded="false">
- v{{ site.docs_version }}
- </a>
- <div class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-versions">
- <a class="dropdown-item active" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/">Latest (4.3.x)</a>
- <a class="dropdown-item" href="https://getbootstrap.com/docs/4.2/">v4.2.1</a>
- <a class="dropdown-item" href="https://getbootstrap.com/docs/4.0/">v4.0.0</a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="https://v4-alpha.getbootstrap.com/">v4 Alpha 6</a>
- <a class="dropdown-item" href="https://getbootstrap.com/docs/3.4/">v3.4.1</a>
- <a class="dropdown-item" href="https://getbootstrap.com/docs/3.3/">v3.3.7</a>
- <a class="dropdown-item" href="https://getbootstrap.com/2.3.2/">v2.3.2</a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="{{ site.baseurl }}/docs/versions/">All versions</a>
- </div>
- </li>
-
- <li class="nav-item">
- <a class="nav-link p-2" href="{{ site.repo }}" target="_blank" rel="noopener" aria-label="GitHub">
- {%- include icons/github.svg class="navbar-nav-svg" -%}
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link p-2" href="https://twitter.com/{{ site.twitter }}" target="_blank" rel="noopener" aria-label="Twitter">
- {%- include icons/twitter.svg class="navbar-nav-svg" -%}
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link p-2" href="{{ site.slack }}/" target="_blank" rel="noopener" aria-label="Slack">
- {%- include icons/slack.svg class="navbar-nav-svg" -%}
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link p-2" href="{{ site.opencollective }}/" target="_blank" rel="noopener" aria-label="Open Collective">
- {%- include icons/opencollective.svg class="navbar-nav-svg" -%}
- </a>
- </li>
- </ul>
-
- <a class="btn btn-bd-download d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/download/">Download</a>
-</header>
+++ /dev/null
-<form class="bd-search d-flex align-items-center">
- <input type="search" class="form-control" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off" data-docs-version="{{ site.docs_version }}">
- <button class="btn btn-link bd-search-docs-toggle d-md-none p-0 ml-3" type="button" data-toggle="collapse" data-target="#bd-docs-nav" aria-controls="bd-docs-nav" aria-expanded="false" aria-label="Toggle docs navigation">
- {%- include icons/menu.svg width="30" height="30" -%}
- </button>
-</form>
-
-<nav class="collapse bd-links" id="bd-docs-nav" aria-label="Main navigation">
- {%- assign page_slug = page.url | split: '/' | last -%}
- {%- for group in site.data.nav -%}
- {%- assign link = group.pages | first -%}
- {%- assign link_slug = link.title | slugify -%}
- {%- assign group_slug = group.title | slugify -%}
- {%- assign active = nil -%}
-
- {%- if page.group == group_slug -%}
- {%- assign active = 'active' -%}
- {%- endif -%}
-
- <div class="bd-toc-item{% unless active == nil %} {{ active }}{% endunless %}">
- <a class="bd-toc-link" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/{{ group_slug }}/{{ link_slug }}{% if link_slug %}/{% endif %}">
- {{ group.title }}
- </a>
-
- <ul class="nav bd-sidenav">
- {%- for doc in group.pages -%}
- {%- assign doc_slug = doc.title | slugify -%}
- {%- assign active = nil -%}
-
- {%- if page.group == group_slug and page_slug == doc_slug -%}
- {%- assign active = 'active bd-sidenav-active' -%}
- {%- endif -%}
-
- <li{% unless active == nil %} class="{{ active }}"{% endunless %}>
- <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/{{ group_slug }}/{{ doc_slug }}/">
- {{ doc.title }}
- </a>
- </li>
- {%- endfor -%}
- </ul>
- </div>
- {%- endfor -%}
-</nav>
+++ /dev/null
-{%- comment -%}
- Usage: include example.html content=markup [args],
- where content is a capture with the HTML content
-
- args can be one of the following:
- id - null (default)
- class - "bd-example" (default)
- optional: hide_preview - disabled (default)
- optional: hide_markup - disabled (default)
-{%- endcomment -%}
-
-{%- assign id = include.id -%}
-{%- assign class = include.class -%}
-
-{%- if include.hide_preview == null -%}
-<div{% if id %} id="{{ id }}"{% endif %} class="bd-example{% if class %} {{ class }}{% endif %}">
- {{- include.content -}}
-</div>
-{%- endif -%}
-
-{%- if include.hide_markup == null -%}
- {%- highlight html -%}
- {%- if include.content contains '<svg class="bd-placeholder-img' -%}
- {%- assign modified_content = include.content
- | replace: '<svg class="bd-placeholder-img', '✂️<svg class="bd-placeholder-img'
- | replace: '</svg>', '</svg>✂️'
- | split: '✂️' -%}
-
- {%- if include.content contains 'bd-placeholder-img ' -%}
- {%- assign image_class = include.content
- | replace_first: 'bd-placeholder-img', 'bd-placeholder-img ✂️'
- | replace: '" width="', '✂️" width="'
- | split: '✂️' -%}
- {%- assign image_class = image_class[1] | replace: 'bd-placeholder-img-lg', '' | strip -%}
- {%- endif -%}
-
- {%- for content_chunk in modified_content -%}
- {%- if content_chunk contains '<svg class="bd-placeholder-img' -%}
- {%- capture img_placeholder -%}
- <img src="..." {% if image_class %}class="{{ image_class }}" {% endif %}alt="...">
- {%- endcapture -%}
- {{- img_placeholder -}}
- {%- else -%}
- {{- content_chunk -}}
- {%- endif -%}
- {%- endfor -%}
- {%- else -%}
- {{- include.content -}}
- {%- endif -%}
- {%- endhighlight -%}
-{%- endif -%}
+++ /dev/null
-<!-- Favicons -->
-<link rel="apple-touch-icon" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
-<link rel="icon" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
-<link rel="icon" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
-<link rel="manifest" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/manifest.json">
-<link rel="mask-icon" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/safari-pinned-tab.svg" color="#563d7c">
-<link rel="icon" href="{{ site.baseurl }}/favicon.ico">
-<meta name="msapplication-config" content="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/browserconfig.xml">
-<meta name="theme-color" content="#563d7c">
+++ /dev/null
-<footer class="bd-footer text-muted">
- <div class="container-fluid p-3 p-md-5">
- <ul class="bd-footer-links">
- <li><a href="{{ site.repo }}">GitHub</a></li>
- <li><a href="https://twitter.com/{{ site.twitter }}">Twitter</a></li>
- <li><a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/examples/">Examples</a></li>
- <li><a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/about/overview/">About</a></li>
- </ul>
- <p>Designed and built with all the love in the world by the <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/about/team/">Bootstrap team</a> with the help of <a href="{{ site.repo }}/graphs/contributors">our contributors</a>.</p>
- <p>Currently v{{ site.current_version }}. Code licensed <a href="{{ site.repo }}/blob/master/LICENSE" target="_blank" rel="license noopener">MIT</a>, docs <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" rel="license noopener">CC BY 3.0</a>.</p>
- </div>
-</footer>
+++ /dev/null
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1">
-<meta name="description" content="{{ page.description | default: site.description | smartify }}">
-<meta name="author" content="{{ site.authors }}">
-<meta name="generator" content="Jekyll v{{ jekyll.version }}">
-
-<meta name="docsearch:language" content="en">
-<meta name="docsearch:version" content="{{ site.docs_version }}">
-
-<title>
- {%- if page.title -%}
- {{ page.title | smartify }} · {{ site.title | smartify }}
- {%- else -%}
- {{ site.title | smartify }} · {{ site.description | smartify }}
- {%- endif -%}
-</title>
-
-<link rel="canonical" href="{{ site.url | append: page.url }}">
-
-{% include stylesheet.html %}
-{% include favicons.html %}
-{% include social.html %}
-{% include analytics.html %}
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}{% if include.class %} class="{{ include.class }}"{% endif %} role="img" viewBox="0 0 1024 860"><title>Bootstrap</title><defs><linearGradient id="c" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#5C24AE"/><stop offset="100%" stop-color="#30135A"/></linearGradient><path id="b" d="M355.967 242.807l-322 216.395c-44.275 29.754-44.275 78.443 0 108.197l322 216.395c44.275 29.754 116.725 29.754 161 0l322-216.395c44.275-29.754 44.275-78.443 0-108.197l-322-216.395c-44.275-29.754-116.725-29.754-161 0z"/><filter id="a" width="108%" height="112%" x="-4%" y="-4.3%" filterUnits="objectBoundingBox"><feOffset dy="10" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="10"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/></filter><linearGradient id="f" x1="50%" x2="50%" y1="-17.303%" y2="100%"><stop offset="0%" stop-color="#7331D4"/><stop offset="100%" stop-color="#461B84"/></linearGradient><path id="e" d="M355.967 132.807l-322 216.395c-44.275 29.754-44.275 78.443 0 108.197l322 216.395c44.275 29.754 116.725 29.754 161 0l322-216.395c44.275-29.754 44.275-78.443 0-108.197l-322-216.395c-44.275-29.754-116.725-29.754-161 0z"/><filter id="d" width="108%" height="112%" x="-4%" y="-4.3%" filterUnits="objectBoundingBox"><feOffset dy="10" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="10"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/></filter><linearGradient id="i" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#905BDD"/><stop offset="100%" stop-color="#5521A0"/></linearGradient><path id="h" d="M355.967 22.807l-322 216.395c-44.275 29.754-44.275 78.443 0 108.197l322 216.395c44.275 29.754 116.725 29.754 161 0l322-216.395c44.275-29.754 44.275-78.443 0-108.197l-322-216.395c-44.275-29.754-116.725-29.754-161 0z"/><filter id="g" width="108%" height="112%" x="-4%" y="-4.3%" filterUnits="objectBoundingBox"><feOffset dy="10" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="10"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/></filter></defs><g fill="none"><g transform="translate(75 23)"><use fill="#000" filter="url(#a)" xlink:href="#b"/><use fill="url(#c)" xlink:href="#b"/></g><g transform="translate(75 23)"><use fill="#000" filter="url(#d)" xlink:href="#e"/><use fill="url(#f)" xlink:href="#e"/></g><g transform="translate(75 23)"><use fill="#000" filter="url(#g)" xlink:href="#h"/><use fill="url(#i)" xlink:href="#h"/></g><path fill="#FFF" d="M558.273 447.667L308.036 279.5l97.982-65.847c42.83-28.784 96.789-31.483 134.245-6.311 26.044 17.502 31.214 46.615 11.444 65.724l1.389.934c38.324-19.932 84.107-18.527 117.396 3.845 44.046 29.6 38.671 68.419-14.561 104.193l-97.658 65.629zM447.112 331.01l49.942-33.562c36.935-24.822 42.31-48.249 15.224-66.451-24.798-16.665-55.49-14.453-85.851 5.95l-59.641 40.081 80.326 53.982zm176.532 35.663c37.63-25.289 42.136-48.832 13.203-68.276-28.932-19.444-64.163-15.614-104.042 11.186l-58.789 39.508 87.92 59.084 61.708-41.502z"/></g></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 612 612" role="img"><title>Bootstrap</title><path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"/><path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true"{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 32 32"><title>Download</title><path d="M9 22c-9 1-8-10 0-9C6 2 23 2 22 10c10-3 10 13 1 12m-12 4l5 4 5-4m-5-10v14"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 512 499.36" role="img"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true"{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 32 32"><title>Import</title><path d="M28 22v8H4v-8M16 4v20m-8-8l8 8 8-8"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true"{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 32 32"><title>Lightning</title><path d="M18 13l8-11L8 13l6 6-8 11 18-11z"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 30 30" role="img"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} fill="currentColor" fill-rule="evenodd"{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 40 41" role="img"><title>Open Collective</title><path fill-opacity=".4" d="M32.8 21c0 2.4-.8 4.9-2 6.9l5.1 5.1c2.5-3.4 4.1-7.6 4.1-12 0-4.6-1.6-8.8-4-12.2L30.7 14c1.2 2 2 4.3 2 7z"/><path d="M20 33.7a12.8 12.8 0 0 1 0-25.6c2.6 0 5 .7 7 2.1L32 5a20 20 0 1 0 .1 31.9l-5-5.2a13 13 0 0 1-7 2z"/></svg>
\ No newline at end of file
+++ /dev/null
-{%- comment -%}
- Usage: include icons/placeholder.svg args
-
- args can be one of the following:
- title: Used in the SVG `title` tag
- text: The text to show in the image - default: 'width x height'
- class: default: 'bd-placeholder-img'
- color: The text color (foreground) - default: '#dee2e6'
- background: The background color - default: '#868e96'
- width: default: 100%
- height: default: 180px
-{%- endcomment -%}
-
-{%- assign title = include.title | default: 'Placeholder' -%}
-{%- assign class = include.class | default: '' -%}
-{%- assign color = include.color | default: site.data.grays[2].hex -%}
-{%- assign background = include.background | default: site.data.grays[5].hex -%}
-{%- assign width = include.width | default: '100%' -%}
-{%- assign height = include.height | default: '180' -%}
-
-{%- if include.text -%}
- {%- assign text = include.text -%}
-{%- else -%}
- {%- assign text = width | append: 'x' | append: height -%}
-{%- endif -%}
-
-{%- capture svg -%}
-<svg class="bd-placeholder-img{% if class != '' %} {{ class }}{% endif %}" width="{{ width }}" height="{{ height }}" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice" role="img"{% if title != ' ' or text != ' ' %} aria-label="{% if title != ' ' %}{{ title }}{% if text != ' ' %}: {% endif %}{% endif %}{% if text != ' ' %}{{ text }}{% endif %}"{% endif %}>
- {% if title != ' ' %}<title>{{ title }}</title>{% endif %}
- <rect width="100%" height="100%" fill="{{ background }}"/>
- {% if text != ' ' %}<text x="50%" y="50%" fill="{{ color }}" dy=".3em">{{ text }}</text>{% endif %}
-</svg>
-{%- endcapture -%}
-
-{{- svg | replace: ' ', '' | strip_newlines -}}
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 512 512" role="img"><title>Slack</title><path fill="currentColor" d="M210.787 234.832l68.31-22.883 22.1 65.977-68.309 22.882z"/><path fill="currentColor" d="M490.54 185.6C437.7 9.59 361.6-31.34 185.6 21.46S-31.3 150.4 21.46 326.4 150.4 543.3 326.4 490.54 543.34 361.6 490.54 185.6zM401.7 299.8l-33.15 11.05 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.38-68.36 22.92 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.43-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.5-13.92 2.87-29.06 16.78-33.56l33.12-11.03-22.1-65.9-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.48-13.93 2.89-29.07 16.81-33.58l33.15-11.05-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.46 34.38 68.36-22.92-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.47 34.42 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.87 29.06-16.78 33.56L329.7 194.6l22.1 65.9 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.88 29.07-16.81 33.57z"/></svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}{% if include.class %} class="{{ include.class }}"{% endif %} viewBox="0 0 512 416.32" role="img"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg>
\ No newline at end of file
+++ /dev/null
-{%- if jekyll.environment == "production" -%}
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ site.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
-{%- else -%}
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/js/bootstrap.bundle.js"></script>
-{%- endif -%}
-
-{%- if page.layout == "docs" -%}
-<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
-{%- endif -%}
-
-{%- if jekyll.environment == "production" -%}
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/docs.min.js"></script>
-{%- else -%}
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/anchor.min.js"></script>
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/clipboard.min.js"></script>
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/bs-custom-file-input.min.js"></script>
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/src/application.js"></script>
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/src/search.js"></script>
-{%- endif -%}
+++ /dev/null
-<!-- Twitter -->
-<meta name="twitter:card" content="{% if page.title %}summary{% else %}summary_large_image{% endif %}">
-<meta name="twitter:site" content="@{{ site.twitter }}">
-<meta name="twitter:creator" content="@{{ site.twitter }}">
-<meta name="twitter:title" content="{{ page.title | default: site.title | smartify }}">
-<meta name="twitter:description" content="{{ page.description | default: site.description | smartify }}">
-<meta name="twitter:image" content="{% if page.title %}{{ site.url | append: site.social_logo_path }}{% else %}{{ site.url | append: site.social_image_path }}{% endif %}">
-
-<!-- Facebook -->
-<meta property="og:url" content="{{ site.url | append: page.url }}">
-<meta property="og:title" content="{{ page.title | default: site.title | smartify }}">
-<meta property="og:description" content="{{ page.description | default: site.description | smartify }}">
-<meta property="og:type" content="website">
-<meta property="og:image" content="{{ site.url | replace: 'https://', 'http://' | append: site.social_image_path }}">
-<meta property="og:image:secure_url" content="{{ site.url | append: site.social_image_path }}">
-<meta property="og:image:type" content="image/png">
-<meta property="og:image:width" content="1200">
-<meta property="og:image:height" content="630">
+++ /dev/null
-<!-- Bootstrap core CSS -->
-{%- if jekyll.environment == "production" %}
-<link href="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/css/bootstrap.min.css" rel="stylesheet" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
-{% else %}
-<link href="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/css/bootstrap.css" rel="stylesheet">
-{% endif -%}
-
-{%- if page.layout == "docs" or page.layout != "examples" -%}
-<!-- Documentation extras -->
-{% if page.layout == "docs" %}
-<link href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" rel="stylesheet">
-{% endif %}
-{% if page.layout != "examples" %}
-<link href="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/css/docs.min.css" rel="stylesheet">
-{% endif %}
-{%- endif -%}
+++ /dev/null
-<!doctype html>
-<html lang="en">
- <head>
- {% include header.html %}
- </head>
- <body>
- {% include skippy.html %}
-
- {% include docs-navbar.html %}
-
- {% if page.layout == "simple" %}
- {{ content }}
- {% else %}
- <main id="content" role="main">
- {{ content }}
- </main>
- {% endif %}
-
- {% include footer.html %}
- {% include scripts.html %}
- </body>
-</html>
+++ /dev/null
-<!doctype html>
-<html lang="en">
- <head>
- {% include header.html %}
- </head>
- <body>
- {% include skippy.html %}
-
- {% include docs-navbar.html %}
-
- <div class="container-fluid">
- <div class="row flex-xl-nowrap">
- <div class="col-12 col-md-3 col-xl-2 bd-sidebar">
- {% include docs-sidebar.html %}
- </div>
-
- {% if page.toc %}
- <nav class="d-none d-xl-block col-xl-2 bd-toc" aria-label="Secondary navigation">
- {{ content | toc_only }}
- </nav>
- {% endif %}
-
- <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
- <h1 class="bd-title" id="content">{{ page.title | smartify }}</h1>
- <p class="bd-lead">{{ page.description | smartify }}</p>
- {% include ads.html %}
- {{ content }}
- </main>
- </div>
- </div>
-
- {% include scripts.html %}
- </body>
-</html>
+++ /dev/null
-<!doctype html>
-<html lang="en"{% if page.html_class %} class="{{ page.html_class }}"{% endif %}>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="description" content="">
- <meta name="author" content="{{ site.authors }}">
- <meta name="generator" content="Jekyll v{{ jekyll.version }}">
- <title>{{ page.title | smartify }} · {{ site.title | smartify }}</title>
-
- <link rel="canonical" href="{{ site.url | append: page.url }}">
-
- {% include stylesheet.html %}
-
- <style>
- .bd-placeholder-img {
- font-size: 1.125rem;
- text-anchor: middle;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- }
-
- @media (min-width: 768px) {
- .bd-placeholder-img-lg {
- font-size: 3.5rem;
- }
- }
- </style>
-
- {%- for css in page.extra_css %}
- <!-- Custom styles for this template -->
- <link href="{{ css }}" rel="stylesheet">
- {%- endfor %}
- </head>
- <body{% if page.body_class %} class="{{ page.body_class }}"{% endif %}>
- {{ content }}
-
- {%- if page.include_js != false -%}
- {%- if jekyll.environment == "production" -%}
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ site.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
- {%- else -%}
- <script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/js/bootstrap.bundle.js"></script>
- {%- endif -%}
-
- {%- for js in page.extra_js %}
- <script src="{{ js }}"></script>
- {%- endfor %}
- {%- endif -%}
- </body>
-</html>
+++ /dev/null
-<!doctype html>
-<html lang="en">
- <head>
- {% include header.html %}
- </head>
- <body>
- {% include skippy.html %}
-
- {% include docs-navbar.html %}
-
- {{ content }}
-
- {% include footer.html %}
- {% include scripts.html %}
- </body>
-</html>
+++ /dev/null
----
-layout: default
----
-
-<header class="d-flex flex-column flex-md-row align-items-md-center p-5 bg-light">
- <div class="pt-md-3 pb-md-4">
- <h1 class="bd-title mt-0">{{ page.title | smartify }}</h1>
- <p class="bd-lead">{{ page.description | smartify }}</p>
- {%- if page.title == "Examples" -%}
- <a href="{{ site.download.source }}" class="btn btn-lg btn-bd-primary" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download');">Download source code</a>
- {%- endif -%}
- </div>
- {% include ads.html %}
-</header>
-
-<main class="bd-content p-5" id="content" role="main">
- {{ content }}
-</main>
<div class="bd-brand-logos">
<div class="bd-brand-item">
- <img class="svg" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144">
+ <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144">
</div>
<div class="bd-brand-item inverse">
- <img class="svg" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144">
+ <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144">
</div>
</div>
<div class="bd-brand-logos">
<div class="bd-brand-logos">
<div class="bd-brand-item">
- <img class="svg" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144">
+ <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144">
</div>
<div class="bd-brand-item inverse">
- <img class="svg" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144">
+ <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144">
</div>
<div class="bd-brand-item inverse">
- <img class="svg" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-punchout.svg" alt="Bootstrap" width="144" height="144">
+ <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-punchout.svg" alt="Bootstrap" width="144" height="144">
</div>
</div>
group: about
---
-Bootstrap is released under the MIT license and is copyright {{ site.time | date: "%Y" }} Twitter. Boiled down to smaller chunks, it can be described with the following conditions.
+Bootstrap is released under the MIT license and is copyright {{< year >}} Twitter. Boiled down to smaller chunks, it can be described with the following conditions.
#### It requires you to:
- Include the source of Bootstrap itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it
- Submit changes that you make to Bootstrap back to the Bootstrap project (though such feedback is encouraged)
-The full Bootstrap license is located [in the project repository]({{ site.repo }}/blob/v{{ site.current_version }}/LICENSE) for more information.
+The full Bootstrap license is located [in the project repository]({{< param repo >}}/blob/v{{< param current_version >}}/LICENSE) for more information.
title: About
description: Learn more about the team maintaining Bootstrap, how and why the project started, and how to get involved.
group: about
-redirect_from:
+aliases:
- "/about/"
- "/docs/4.3/about/"
---
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/engineering/en_us/a/2010/hack-week.html) 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/developer/en_us/a/2011/bootstrap-twitter.html) on <time datetime="2011-08-19 11:25">Friday, August 19, 2011</time>, we've since had over [twenty releases]({{ site.repo }}/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/developer/en_us/a/2011/bootstrap-twitter.html) on <time datetime="2011-08-19 11:25">Friday, August 19, 2011</time>, we've since had over [twenty releases]({{< param repo >}}/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.
With Bootstrap 4, we once again rewrote the project to account for two key architectural changes: a migration to Sass and the move to CSS's flexbox. Our intention is to help in a small way to move the web development community forward by pushing for newer CSS properties, fewer dependencies, and new technologies across more modern browsers.
## Get involved
-Get involved with Bootstrap development by [opening an issue]({{ site.repo }}/issues/new) or submitting a pull request. Read our [contributing guidelines]({{ site.repo }}/blob/v{{ site.current_version }}/.github/CONTRIBUTING.md) for information on how we develop.
+Get involved with Bootstrap development by [opening an issue]({{< param repo >}}/issues/new) or submitting a pull request. Read our [contributing guidelines]({{< param repo >}}/blob/v{{< param current_version >}}/.github/CONTRIBUTING.md) for information on how we develop.
--- /dev/null
+---
+layout: docs
+title: Team
+description: An overview of the founding team and core contributors to Bootstrap.
+group: about
+---
+
+Bootstrap is maintained by the founding team and a small group of invaluable core contributors, with the massive support and involvement of our community.
+
+{{< team.inline >}}
+<div class="list-group mb-3">
+ {{- range (index $.Site.Data "core-team") }}
+ <a class="list-group-item list-group-item-action d-flex align-items-center" href="https://github.com/{{ .user }}">
+ <img src="https://github.com/{{ .user }}.png" alt="@{{ .user }}" width="32" height="32" class="rounded mr-2">
+ <span>
+ <strong>{{ .name }}</strong> @{{ .user }}
+ </span>
+ </a>
+ {{ end -}}
+</div>
+{{< /team.inline >}}
+
+Get involved with Bootstrap development by [opening an issue]({{< param repo >}}/issues/new) or submitting a pull request. Read our [contributing guidelines]({{< param repo >}}/blob/v{{< param current_version >}}/.github/CONTRIBUTING.md) for information on how we develop.
Community members have translated Bootstrap's documentation into various languages. None are officially supported and they may not always be up to date.
+{{< translations.inline >}}
<ul>
-{% for language in site.data.translations %}
- <li><a href="{{ language.url }}" hreflang="{{ language.code }}">{{ language.description }} ({{ language.name }})</a></li>
-{% endfor %}
+{{ range .Site.Data.translations -}}
+ <li><a href="{{ .url }}" hreflang="{{ .code }}">{{ .description }} ({{ .name }})</a></li>
+{{ end -}}
</ul>
+{{< /translations.inline >}}
**We don't help organize or host translations, we just link to them.**
layout: docs
title: Wall of browser bugs
group: browser-bugs
-redirect_from: "/browser-bugs/"
+aliases: "/browser-bugs/"
---
Bootstrap currently works around several outstanding browser bugs in major browsers to deliver the best cross-browser experience possible. Some bugs, like those listed below, cannot be solved by us.
-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 }}/docs/{{ site.docs_version }}/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](/docs/{{< param docs_version >}}/getting-started/browsers-devices/#supported-browsers).
See also:
</tr>
</thead>
<tbody>
- {% for bug in site.data.browser-bugs %}
+ {{< bug.inline >}}
+ {{- range (index $.Site.Data $data) }}
<tr>
- <td>{{ bug.browser }}</td>
- <td>{{ bug.summary | markdownify }}</td>
+ <td>{{ .browser | chomp }}</td>
+ <td>{{ .summary | markdownify }}</td>
<td>{% include bugify.html content=bug.upstream_bug %}</td>
<td>{% include bugify.html content=bug.origin %}</td>
</tr>
- {% endfor %}
+ {{- end }}
+ {{< /bug.inline >}}
</tbody>
</table>
</tr>
</thead>
<tbody>
- {% for feat in site.data.browser-features %}
+ {{< feat.inline >}}
+ {{ range (index $.Site.Data "browser-features") }}
<tr>
- <td>{{ feat.browser }}</td>
- <td>{{ feat.summary | markdownify }}</td>
+ <td>{{ .browser }}</td>
+ <td>{{ .summary | markdownify }}</td>
<td>{% include bugify.html content=feat.upstream_bug %}</td>
<td>{% include bugify.html content=feat.origin %}</td>
</tr>
- {% endfor %}
+ {{ end }}
+ {{< /feat.inline >}}
</tbody>
</table>
title: Alerts
description: Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
group: components
-redirect_from:
+aliases:
- "/components/"
- "/docs/4.3/components/"
toc: true
Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts JavaScript plugin](#dismissing).
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<div class="alert alert-{{ color.name }}" role="alert">
- A simple {{ color.name }} alert—check it out!
-</div>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+{{< example >}}
+{{< alerts.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<div class="alert alert-{{ .name }}" role="alert">
+ A simple {{ .name }} alert—check it out!
+</div>{{- end -}}
+{{< /alerts.inline >}}
+{{< /example >}}
-{% include callout-warning-color-assistive-technologies.md %}
+{{< callout info >}}
+{{< partial "callout-warning-color-assistive-technologies.md" >}}
+{{< /callout >}}
### Link color
Use the `.alert-link` utility class to quickly provide matching colored links within any alert.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<div class="alert alert-{{ color.name }}" role="alert">
- A simple {{ color.name }} alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
-</div>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+{{< example >}}
+{{< alerts.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<div class="alert alert-{{ .name }}" role="alert">
+ A simple {{ .name }} alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
+</div>{{ end -}}
+{{< /alerts.inline >}}
+{{< /example >}}
### Additional content
Alerts can also contain additional HTML elements like headings, paragraphs and dividers.
-{% capture example %}
+{{< example >}}
<div class="alert alert-success" role="alert">
<h4 class="alert-heading">Well done!</h4>
<p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
<hr>
<p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Dismissing
Using the alert JavaScript plugin, it's possible to dismiss any alert inline. Here's how:
- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript.
-- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util). The compiled version includes this.
+- If you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util). The compiled version includes this.
- 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.
- 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:
-{% capture example %}
+{{< example >}}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## JavaScript behavior
Enable dismissal of an alert via JavaScript:
-{% highlight js %}
+{{< highlight js >}}
var alertList = document.querySelectorAll('.alert')
alertList.forEach(function (alert) {
new bootstrap.Alert(alert)
})
-{% endhighlight %}
+{{< /highlight >}}
Or with `data` attributes on a button **within the alert**, as demonstrated above:
-{% highlight html %}
+{{< highlight html >}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
-{% endhighlight %}
+{{< /highlight >}}
Note that closing an alert will remove it from the DOM.
You can create an alert instance with the alert constructor, for example:
-{% highlight js %}
+{{< highlight js >}}
var myAlert = document.getElementById('myAlert')
var bsAlert = new bootstrap.Alert(myAlert)
-{% endhighlight %}
+{{< /highlight >}}
This 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.)
| `dispose` | Destroys an element's alert. |
| `_getInstance` | *Static* method which allows you to get the alert instance associated to a DOM element, you can use it like this: `bootstrap.Alert._getInstance(alert)` |
-{% highlight js %}
+{{< highlight js >}}
var alertNode = document.querySelector('.alert')
var alert = bootstrap.Alert._getInstance(alertNode)
alert.close()
-{% endhighlight %}
+{{< /highlight >}}
### Events
| `close.bs.alert` | This event fires immediately when the <code>close</code> instance method is called. |
| `closed.bs.alert` | This event is fired when the alert has been closed (will wait for CSS transitions to complete). |
-{% highlight js %}
+{{< highlight js >}}
var myAlert = document.getElementById('myAlert')
myAlert.addEventListener('closed.bs.alert', function () {
// do something…
})
-{% endhighlight %}
+{{< /highlight >}}
Badges scale to match the size of the immediate parent element by using relative font sizing and `em` units.
-{% capture example %}
+{{< example >}}
<h1>Example heading <span class="badge badge-secondary">New</span></h1>
<h2>Example heading <span class="badge badge-secondary">New</span></h2>
<h3>Example heading <span class="badge badge-secondary">New</span></h3>
<h4>Example heading <span class="badge badge-secondary">New</span></h4>
<h5>Example heading <span class="badge badge-secondary">New</span></h5>
<h6>Example heading <span class="badge badge-secondary">New</span></h6>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Badges can be used as part of links or buttons to provide a counter.
-{% capture example %}
+{{< example >}}
<button type="button" class="btn btn-primary">
Notifications <span class="badge badge-light">4</span>
</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.
Unless the context is clear (as with the "Notifications" example, where it is understood that the "4" is the number of notifications), consider including additional context with a visually hidden piece of additional text.
-{% capture example %}
+{{< example >}}
<button type="button" class="btn btn-primary">
Profile <span class="badge badge-light">9</span>
<span class="sr-only">unread messages</span>
</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Contextual variations
Add any of the below mentioned modifier classes to change the appearance of a badge.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<span class="badge badge-{{ color.name }}">{{ color.name | capitalize }}</span>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+{{< example >}}
+{{< badge.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<span class="badge badge-{{ .name }}">{{ .name | title }}</span>{{- end -}}
+{{< /badge.inline >}}
+{{< /example >}}
-{% include callout-warning-color-assistive-technologies.md %}
+{{< callout info >}}
+{{< partial "callout-warning-color-assistive-technologies.md" >}}
+{{< /callout >}}
## 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.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<span class="badge badge-pill badge-{{ color.name }}">{{ color.name | capitalize }}</span>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+{{< example >}}
+{{< badge.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<span class="badge badge-pill badge-{{ .name }}">{{ .name | title }}</span>{{- end -}}
+{{< /badge.inline >}}
+{{< /example >}}
## Links
Using the contextual `.badge-*` classes on an `<a>` element quickly provide _actionable_ badges with hover and focus states.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<a href="#" class="badge badge-{{ color.name }}">{{ color.name | capitalize }}</a>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+{{< example >}}
+{{< badge.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<a href="#" class="badge badge-{{ .name }}">{{ .name | title }}</a>{{- end -}}
+{{< /badge.inline >}}
+{{< /example >}}
## Example
-{% capture example %}
+{{< example >}}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">Home</li>
<li class="breadcrumb-item active" aria-current="page">Data</li>
</ol>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Changing the separator
## Basic example
-Wrap a series of buttons with `.btn` in `.btn-group`. Add on optional JavaScript radio and checkbox style behavior with [our buttons plugin]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/buttons/#button-plugin).
+Wrap a series of buttons with `.btn` in `.btn-group`. Add on optional JavaScript radio and checkbox style behavior with [our buttons plugin](/docs/{{< param docs_version >}}/components/buttons/#button-plugin).
-{% capture example %}
+{{< example >}}
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-secondary">Left</button>
<button type="button" class="btn btn-secondary">Middle</button>
<button type="button" class="btn btn-secondary">Right</button>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture callout %}
+{{< callout warning >}}
##### Ensure correct `role` and provide a label
In order for assistive technologies (such as screen readers) to convey that a series of buttons is grouped, an appropriate `role` attribute needs to be provided. For button groups, this would be `role="group"`, while toolbars should have a `role="toolbar"`.
In addition, groups and toolbars should be given an explicit label, as most assistive technologies will otherwise not announce them, despite the presence of the correct role attribute. In the examples provided here, we use `aria-label`, but alternatives such as `aria-labelledby` can also be used.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
## Button toolbar
Combine sets of button groups into button toolbars for more complex components. Use utility classes as needed to space out groups, buttons, and more.
-{% capture example %}
+{{< example >}}
<div class="btn-toolbar" 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">8</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture example %}
+{{< example >}}
<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>
<input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="btnGroupAddon2">
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Sizing
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="btn-group btn-group-lg" role="group" aria-label="...">...</div>
<div class="btn-group" role="group" aria-label="...">...</div>
<div class="btn-group btn-group-sm" role="group" aria-label="...">...</div>
-{% endhighlight %}
+{{< /highlight >}}
## Nesting
Place a `.btn-group` within another `.btn-group` when you want dropdown menus mixed with a series of buttons.
-{% capture example %}
+{{< example >}}
<div class="btn-group" role="group" aria-label="Button group with nested dropdown">
<button type="button" class="btn btn-secondary">1</button>
<button type="button" class="btn btn-secondary">2</button>
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Vertical variation
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="btn-group-vertical">
...
</div>
-{% endhighlight %}
+{{< /highlight >}}
Bootstrap includes several predefined button styles, each serving its own semantic purpose, with a few extras thrown in for more control.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<button type="button" class="btn btn-{{ color.name }}">{{ color.name | capitalize }}</button>{% endfor %}
+{{< example >}}
+{{< buttons.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<button type="button" class="btn btn-{{ .name }}">{{ .name | title }}</button>
+{{- end -}}
+{{< /buttons.inline >}}
<button type="button" class="btn btn-link">Link</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% include callout-warning-color-assistive-technologies.md %}
+{{< callout info >}}
+{{< partial "callout-warning-color-assistive-technologies.md" >}}
+{{< /callout >}}
## Button tags
When using button classes on `<a>` elements that are used to trigger in-page functionality (like collapsing content), rather than linking to new pages or sections within the current page, these links should be given a `role="button"` to appropriately convey their purpose to assistive technologies such as screen readers.
-{% capture example %}
+{{< example >}}
<a class="btn btn-primary" href="#" role="button">Link</a>
<button class="btn btn-primary" type="submit">Button</button>
<input class="btn btn-primary" type="button" value="Input">
<input class="btn btn-primary" type="submit" value="Submit">
<input class="btn btn-primary" type="reset" value="Reset">
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Outline buttons
In need of a button, but not the hefty background colors they bring? Replace the default modifier classes with the `.btn-outline-*` ones to remove all background images and colors on any button.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<button type="button" class="btn btn-outline-{{ color.name }}">{{ color.name | capitalize }}</button>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+{{< example >}}
+{{< buttons.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<button type="button" class="btn btn-outline-{{ .name }}">{{ .name | title }}</button>
+{{- end -}}
+{{< /buttons.inline >}}
+{{< /example >}}
## Sizes
Fancy larger or smaller buttons? Add `.btn-lg` or `.btn-sm` for additional sizes.
-{% capture example %}
+{{< example >}}
<button type="button" class="btn btn-primary btn-lg">Large button</button>
<button type="button" class="btn btn-secondary btn-lg">Large button</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<button type="button" class="btn btn-primary btn-sm">Small button</button>
<button type="button" class="btn btn-secondary btn-sm">Small button</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Create block level buttons—those that span the full width of a parent—by adding `.btn-block`.
-{% capture example %}
+{{< example >}}
<button type="button" class="btn btn-primary btn-lg btn-block">Block level button</button>
<button type="button" class="btn btn-secondary btn-lg btn-block">Block level button</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Active state
Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. **There's no need to add a class to `<button>`s as they use a pseudo-class**. However, you can still force the same active appearance with `.active` (and include the <code>aria-pressed="true"</code> attribute) should you need to replicate the state programmatically.
-{% capture example %}
+{{< example >}}
<a href="#" class="btn btn-primary btn-lg active" role="button" aria-pressed="true">Primary link</a>
<a href="#" class="btn btn-secondary btn-lg active" role="button" aria-pressed="true">Link</a>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Disabled state
Make buttons look inactive by adding the `disabled` boolean attribute to any `<button>` element.
-{% capture example %}
+{{< example >}}
<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>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Disabled buttons using the `<a>` element behave a bit different:
- Some future-friendly styles are included to disable all `pointer-events` on anchor buttons. In browsers which support that property, you won't see the disabled cursor at all.
- Disabled buttons should include the `aria-disabled="true"` attribute to indicate the state of the element to assistive technologies.
-{% capture example %}
+{{< example >}}
<a href="#" class="btn btn-primary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Primary link</a>
<a href="#" class="btn btn-secondary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Link</a>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture callout %}
+{{< callout warning >}}
##### 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.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
## Button plugin
Add `data-toggle="button"` to toggle a button's `active` state. If you're pre-toggling a button, you must manually add the `.active` class **and** `aria-pressed="true"` to the `<button>`.
-{% capture example %}
+{{< example >}}
<button type="button" class="btn btn-primary" data-toggle="button" aria-pressed="false" autocomplete="off">
Single toggle
</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Checkbox and radio buttons
Note that pre-checked buttons require you to manually add the `.active` class to the input's `<label>`.
-{% capture example %}
+{{< example >}}
<div class="btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
<input type="checkbox" checked autocomplete="off"> Checked
</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
<input type="radio" name="options" id="option1" autocomplete="off" checked> Active
<input type="radio" name="options" id="option3" autocomplete="off"> Radio
</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Methods
You can create a button instance with the button constructor, for example:
-{% highlight js %}
+{{< highlight js >}}
var button = document.getElementById('myButton')
var bsButton = new bootstrap.Button(button)
-{% endhighlight %}
+{{< /highlight >}}
| Method | Description |
| --------- | ------------------------------------------------------------------------------- |
For example, to toggle all buttons
-{% highlight js %}
+{{< highlight js >}}
var buttons = document.querySelectorAll('.btn')
buttons.forEach(function (button) {
var button = new bootstrap.Button(button)
button.toggle()
})
-{% endhighlight %}
+{{< /highlight >}}
## Example
-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. They have no `margin` by default, so use [spacing utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) as needed.
+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. They have no `margin` by default, so use [spacing utilities](/docs/{{< param docs_version >}}/utilities/spacing/) as needed.
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 its parent element. This is easily customized with our various [sizing options](#sizing).
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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="btn btn-primary">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Content types
The building block of a card is the `.card-body`. Use it whenever you need a padded section within a card.
-{% capture example %}
+{{< example >}}
<div class="card">
<div class="card-body">
This is some text within a card body.
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Titles, text, and links
Subtitles are used by adding a `.card-subtitle` to a `<h*>` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-body` item, the card title and subtitle are aligned nicely.
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<a href="#" class="card-link">Another link</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Images
`.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.
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<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>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### List groups
Create lists of content in a card with a flush list group.
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
<ul class="list-group list-group-flush">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
<div class="card-header">
Featured
<li class="list-group-item">Vestibulum at eros</li>
</ul>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### 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.
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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">Another link</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Header and footer
Add an optional header and/or footer within a card.
-{% capture example %}
+{{< example >}}
<div class="card">
<div class="card-header">
Featured
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Card headers can be styled by adding `.card-header` to `<h*>` elements.
-{% capture example %}
+{{< example >}}
<div class="card">
<h5 class="card-header">Featured</h5>
<div class="card-body">
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="card">
<div class="card-header">
Quote
</blockquote>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="card text-center">
<div class="card-header">
Featured
2 days ago
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Sizing
Using the grid, wrap cards in columns and rows as needed.
-{% capture example %}
+{{< example >}}
<div class="row">
<div class="col-sm-6">
<div class="card">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Using utilities
-Use our handful of [available sizing utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/sizing/) to quickly set a card's width.
+Use our handful of [available sizing utilities](/docs/{{< param docs_version >}}/utilities/sizing/) to quickly set a card's width.
-{% capture example %}
+{{< example >}}
<div class="card w-75">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<a href="#" class="btn btn-primary">Button</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Using custom CSS
Use custom CSS in your stylesheets or as inline styles to set a width.
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## 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 }}/docs/{{ site.docs_version }}/utilities/text/#text-alignment).
+You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes](/docs/{{< param docs_version >}}/utilities/text/#text-alignment).
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Navigation
-Add some navigation to a card's header (or block) with Bootstrap's [nav components]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/navs/).
+Add some navigation to a card's header (or block) with Bootstrap's [nav components](/docs/{{< param docs_version >}}/components/navs/).
-{% capture example %}
+{{< example >}}
<div class="card text-center">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs">
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="card text-center">
<div class="card-header">
<ul class="nav nav-pills card-header-pills">
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Images
Similar to headers and footers, cards can include top and bottom "image caps"—images at the top or bottom of a card.
-{% capture example %}
+{{< example >}}
<div class="card mb-3">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
<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>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-bottom" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-bottom" text="Image cap" >}}
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### 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 additional styles or utilities.
-{% capture example %}
+{{< example >}}
<div class="card bg-dark text-white">
- {% include icons/placeholder.svg width="100%" height="270" class="bd-placeholder-img-lg card-img" text="Card image" %}
+ {{< placeholder width="100%" height="270" class="bd-placeholder-img-lg card-img" text="Card image" >}}
<div class="card-img-overlay">
<h5 class="card-title">Card title</h5>
<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>
<p class="card-text">Last updated 3 mins ago</p>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture callout %}
+{{< callout info >}}
Note that content should not be larger than the height of the image. If content is larger than the image the content will be displayed outside the image.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
## Horizontal
Using a combination of grid and utility classes, cards can be made horizontal in a mobile-friendly and responsive way. In the example below, we remove the grid gutters with `.no-gutters` and use `.col-md-*` classes to make the card horizontal at the `md` breakpoint. Further adjustments may be needed depending on your card content.
-{% capture example %}
+{{< example >}}
<div class="card mb-3" style="max-width: 540px;">
<div class="row no-gutters">
<div class="col-md-4">
- {% include icons/placeholder.svg width="100%" height="250" class="" text="Image" %}
+ {{< placeholder width="100%" height="250" class="" text="Image" >}}
</div>
<div class="col-md-8">
<div class="card-body">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Card styles
### Background and color
-Use [text and background utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/) to change the appearance of a card.
+Use [text and background utilities](/docs/{{< param docs_version >}}/utilities/colors/) to change the appearance of a card.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<div class="card{% unless color.name == "light" %} text-white{% endunless %} bg-{{ color.name }} mb-3" style="max-width: 18rem;">
+{{< example >}}
+{{< card.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<div class="card{{ if not (eq .name "light") }} text-white{{ end }} bg-{{ .name }} mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
- <h5 class="card-title">{{ color.name | capitalize }} card title</h5>
+ <h5 class="card-title">{{ .name | title }} card title</h5>
<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>
-</div>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+</div>
+{{- end -}}
+{{< /card.inline >}}
+{{< /example >}}
-{% include callout-warning-color-assistive-technologies.md %}
+{{< callout info >}}
+{{< partial "callout-warning-color-assistive-technologies.md" >}}
+{{< /callout >}}
### Border
-Use [border utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/borders/) to change just the `border-color` of a card. Note that you can put `.text-{color}` classes on the parent `.card` or a subset of the card's contents as shown below.
+Use [border utilities](/docs/{{< param docs_version >}}/utilities/borders/) to change just the `border-color` of a card. Note that you can put `.text-{color}` classes on the parent `.card` or a subset of the card's contents as shown below.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<div class="card border-{{ color.name }} mb-3" style="max-width: 18rem;">
+{{< example >}}
+{{< card.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<div class="card border-{{ .name }} mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
- <div class="card-body{% unless color.name == "light" %} text-{{ color.name }}{% endunless %}">
- <h5 class="card-title">{{ color.name | capitalize }} card title</h5>
+ <div class="card-body{{ if not (eq .name "light") }} text-{{ .name }}{{ end }}">
+ <h5 class="card-title">{{ .name | title }} card title</h5>
<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>
-</div>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+</div>
+{{- end -}}
+{{< /card.inline >}}
+{{< /example >}}
### Mixins utilities
You can also change the borders on the card header and footer as needed, and even remove their `background-color` with `.bg-transparent`.
-{% capture example %}
+{{< example >}}
<div class="card border-success mb-3" style="max-width: 18rem;">
<div class="card-header bg-transparent border-success">Header</div>
<div class="card-body text-success">
</div>
<div class="card-footer bg-transparent border-success">Footer</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Card layout
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.
-{% capture example %}
+{{< example >}}
<div class="card-group">
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
When using card groups with footers, their content will automatically line up.
-{% capture example %}
+{{< example >}}
<div class="card-group">
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Card decks
Need a set of equal width and height cards that aren't attached to one another? Use card decks.
-{% capture example %}
+{{< example >}}
<div class="card-deck">
<div class="card">
- {% include icons/placeholder.svg width="100%" height="200" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="200" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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 class="card">
- {% include icons/placeholder.svg width="100%" height="200" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="200" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="200" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="200" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Just like with card groups, card footers in decks will automatically line up.
-{% capture example %}
+{{< example >}}
<div class="card-deck">
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<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>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Card columns
**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.
-{% capture example %}
+{{< example >}}
<div class="card-columns">
<div class="card">
- {% include icons/placeholder.svg width="100%" height="160" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="160" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title that wraps to a new line</h5>
<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>
</blockquote>
</div>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="160" class="card-img-top" text="Image cap" %}
+ {{< placeholder width="100%" height="160" class="card-img-top" text="Image cap" >}}
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
<div class="card">
- {% include icons/placeholder.svg width="100%" height="260" class="card-img" text="Card image" %}
+ {{< placeholder width="100%" height="260" class="card-img" text="Card image" >}}
</div>
<div class="card p-3 text-right">
<blockquote class="blockquote mb-0">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% highlight scss %}
+{{< highlight scss >}}
.card-columns {
@include media-breakpoint-only(lg) {
column-count: 4;
column-count: 5;
}
}
-{% endhighlight %}
+{{< /highlight >}}
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.).
-{% include callout-info-prefersreducedmotion.md %}
+{{< callout info >}}
+{{< partial "callout-info-prefersreducedmotion.md" >}}
+{{< /callout >}}
Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards.
-Lastly, if you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+Lastly, if you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util).
## Example
Here's a carousel with slides only. Note the presence of the `.d-block` and `.w-100` on carousel images to prevent browser default image alignment.
-{% capture example %}
+{{< example >}}
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### With controls
Adding in the previous and next controls:
-{% capture example %}
+{{< example >}}
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="sr-only">Next</span>
</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### With indicators
You can also add the indicators to the carousel, alongside the controls, too.
-{% capture example %}
+{{< example >}}
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="sr-only">Next</span>
</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### With captions
-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 }}/docs/{{ site.docs_version }}/utilities/display/). We hide them initially with `.d-none` and bring them back on medium-sized devices with `.d-md-block`.
+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](/docs/{{< param docs_version >}}/utilities/display/). We hide them initially with `.d-none` and bring them back on medium-sized devices with `.d-md-block`.
-{% capture example %}
+{{< example >}}
<div class="bd-example">
<div id="carouselExampleCaptions" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
<div class="carousel-caption d-none d-md-block">
<h5>First slide label</h5>
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
</div>
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}
<div class="carousel-caption d-none d-md-block">
<h5>Second slide label</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}
<div class="carousel-caption d-none d-md-block">
<h5>Third slide label</h5>
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Crossfade
Add `.carousel-fade` to your carousel to animate slides with a fade transition instead of a slide.
-{% capture example %}
+{{< example >}}
<div id="carouselExampleFade" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleFade" role="button" data-slide="prev">
<span class="sr-only">Next</span>
</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Individual `.carousel-item` interval
Add `data-interval=""` to a `.carousel-item` to change the amount of time to delay between automatically cycling to the next item.
-{% capture example %}
+{{< example >}}
<div id="carouselExampleInterval" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active" data-interval="10000">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
</div>
<div class="carousel-item" data-interval="2000">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" %}
+ {{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleInterval" role="button" data-slide="prev">
<span class="sr-only">Next</span>
</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Usage
Call carousel manually with:
-{% highlight js %}
+{{< highlight js >}}
var myCarousel = document.querySelector('#myCarousel')
var carousel = new bootstrap.Carousel(myCarousel)
-{% endhighlight %}
+{{< /highlight >}}
### Options
### Methods
-{% include callout-danger-async-methods.md %}
+{{< callout danger >}}
+{{< partial "callout-danger-async-methods.md" >}}
+{{< /callout >}}
You can create a carousel instance with the carousel constructor, for example, to initialize with additional options and start cycling through items:
-{% highlight js %}
+{{< highlight js >}}
var myCarousel = document.querySelector('#myCarousel')
var carousel = new bootstrap.Carousel(myCarousel, {
interval: 2000,
wrap: false
})
-{% endhighlight %}
+{{< /highlight >}}
| Method | Description |
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('#myCarousel').on('slide.bs.carousel', function () {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
### Change transition duration
The collapse JavaScript plugin is used to show and hide content. Buttons or anchors are used as triggers that are mapped to specific elements you toggle. Collapsing an element will animate the `height` from its current value to `0`. Given how CSS handles animations, you cannot use `padding` on a `.collapse` element. Instead, use the class as an independent wrapping element.
-{% include callout-info-prefersreducedmotion.md %}
+{{< callout info >}}
+{{< partial "callout-info-prefersreducedmotion.md" >}}
+{{< /callout >}}
## Example
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.
-{% capture example %}
+{{< example >}}
<p>
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
Link with href
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Multiple targets
A `<button>` or `<a>` can show and hide multiple elements by referencing them with a selector in its `href` or `data-target` attribute.
Multiple `<button>` or `<a>` can show and hide an element if they each reference it with their `href` or `data-target` attribute
-{% capture example %}
+{{< example >}}
<p>
<a class="btn btn-primary" data-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Toggle first element</a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#multiCollapseExample2" aria-expanded="false" aria-controls="multiCollapseExample2">Toggle second element</button>
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Accordion example
-Using the [card]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/card/) component, you can extend the default collapse behavior to create an accordion. To properly achieve the accordion style, be sure to use `.accordion` as a wrapper.
+Using the [card](/docs/{{< param docs_version >}}/components/card/) component, you can extend the default collapse behavior to create an accordion. To properly achieve the accordion style, be sure to use `.accordion` as a wrapper.
-{% capture example %}
+{{< example >}}
<div class="accordion" id="accordionExample">
<div class="card">
<div class="card-header" id="headingOne">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Accessibility
Enable manually with:
-{% highlight js %}
+{{< highlight js >}}
$('.collapse').collapse()
-{% endhighlight %}
+{{< /highlight >}}
### Options
### Methods
-{% include callout-danger-async-methods.md %}
+{{< callout danger >}}
+{{< partial "callout-danger-async-methods.md" >}}
+{{< /callout >}}
Activates your content as a collapsible element. Accepts an optional options `object`.
You can create a collapse instance with the constructor, for example:
-{% highlight js %}
+{{< highlight js >}}
var myCollapse = document.getElementById('myCollapse')
var bsCollapse = new bootstrap.Collapse(myCollapse, {
toggle: false
})
-{% endhighlight %}
+{{< /highlight >}}
| Method | Description |
| --- | --- |
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('#myCollapsible').on('hidden.bs.collapse', function () {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown JavaScript plugin. They're toggled by clicking, not by hovering; this is [an intentional design decision](http://markdotto.com/2012/02/27/bootstrap-explained-dropdowns/).
-Dropdowns are built on a third party library, [Popper.js](https://popper.js.org/), which provides dynamic positioning and viewport detection. Be sure to include [popper.min.js]({{ site.cdn.popper }}) before Bootstrap's JavaScript or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js. Popper.js isn't used to position dropdowns in navbars though as dynamic positioning isn't required.
+Dropdowns are built on a third party library, [Popper.js](https://popper.js.org/), which provides dynamic positioning and viewport detection. Be sure to include [popper.min.js]({{< param "cdn.popper" >}}) before Bootstrap's JavaScript or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js. Popper.js isn't used to position dropdowns in navbars though as dynamic positioning isn't required.
-If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+If you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util).
## Accessibility
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:
-{% capture example %}
+{{< example >}}
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-expanded="false">
Dropdown button
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
And with `<a>` elements:
-{% capture example %}
+{{< example >}}
<div class="dropdown">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-expanded="false">
Dropdown link
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
The best part is you can do this with any button variant, too:
</div><!-- /btn-group -->
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Example single danger button -->
<div class="btn-group">
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<a class="dropdown-item" href="#">Separated link</a>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Split button
</div><!-- /btn-group -->
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Example split danger button -->
<div class="btn-group">
<button type="button" class="btn btn-danger">Action</button>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
## Sizing
</div><!-- /btn-toolbar -->
</div><!-- /example -->
-{% highlight html %}
+{{< highlight html >}}
<!-- Large button groups (default and split) -->
<div class="btn-group">
<button class="btn btn-secondary btn-lg dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
...
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
## Directions
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Default dropup button -->
<div class="btn-group dropup">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<!-- Dropdown menu links -->
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Dropright
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Default dropright button -->
<div class="btn-group dropright">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<!-- Dropdown menu links -->
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Dropleft
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Default dropleft button -->
<div class="btn-group dropleft">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
Split dropleft
</button>
</div>
-{% endhighlight %}
+{{< /highlight >}}
## Menu items
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.
-{% capture example %}
+{{< example >}}
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-expanded="false">
Dropdown
<button class="dropdown-item" type="button">Something else here</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
You can also create non-interactive dropdown items with `.dropdown-item-text`. Feel free to style further with custom CSS or text utilities.
-{% capture example %}
+{{< example >}}
<div class="dropdown-menu">
<span class="dropdown-item-text">Dropdown item text</span>
<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>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Active
Add `.active` to items in the dropdown to **style them as active**.
-{% capture example %}
+{{< example >}}
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Regular link</a>
<a class="dropdown-item active" href="#">Active link</a>
<a class="dropdown-item" href="#">Another link</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Disabled
Add `.disabled` to items in the dropdown to **style them as disabled**.
-{% capture example %}
+{{< example >}}
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Regular link</a>
<a class="dropdown-item disabled" href="#" tabindex="-1" aria-disabled="true">Disabled link</a>
<a class="dropdown-item" href="#">Another link</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Menu alignment
By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. Add `.dropdown-menu-right` to a `.dropdown-menu` to right align the dropdown menu.
-{% capture callout %}
+{{< callout info >}}
**Heads up!** Dropdowns are positioned thanks to Popper.js (except when they are contained in a navbar).
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
-{% capture example %}
+{{< example >}}
<div class="btn-group">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
Right-aligned menu
<button class="dropdown-item" type="button">Something else here</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Responsive alignment
To align **right** the dropdown menu with the given breakpoint or larger, add `.dropdown-menu{-sm|-md|-lg|-xl}-right`.
-{% capture example %}
+{{< example >}}
<div class="btn-group">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" data-display="static" aria-expanded="false">
Left-aligned but right aligned when large screen
<button class="dropdown-item" type="button">Something else here</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
To align **left** the dropdown menu with the given breakpoint or larger, add `.dropdown-menu-right` and `.dropdown-menu{-sm|-md|-lg|-xl}-left`.
-{% capture example %}
+{{< example >}}
<div class="btn-group">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" data-display="static" aria-expanded="false">
Right-aligned but left aligned when large screen
<button class="dropdown-item" type="button">Something else here</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Note that you don't need to add a `data-display="static"` attribute to dropdown buttons in navbars, since Popper.js isn't used in navbars.
Add a header to label sections of actions in any dropdown menu.
-{% capture example %}
+{{< example >}}
<div class="dropdown-menu">
<h6 class="dropdown-header">Dropdown header</h6>
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Dividers
Separate groups of related menu items with a divider.
-{% capture example %}
+{{< example >}}
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Text
-Place any freeform text within a dropdown menu with text and use [spacing utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/). Note that you'll likely need additional sizing styles to constrain the menu width.
+Place any freeform text within a dropdown menu with text and use [spacing utilities](/docs/{{< param docs_version >}}/utilities/spacing/). Note that you'll likely need additional sizing styles to constrain the menu width.
-{% capture example %}
+{{< example >}}
<div class="dropdown-menu p-4 text-muted" style="max-width: 200px;">
<p>
Some example text that's free-flowing within the dropdown menu.
And this is more example text.
</p>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Forms
-Put a form within a dropdown menu, or make it into a dropdown menu, and use [margin or padding utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) to give it the negative space you require.
+Put a form within a dropdown menu, or make it into a dropdown menu, and use [margin or padding utilities](/docs/{{< param docs_version >}}/utilities/spacing/) to give it the negative space you require.
-{% capture example %}
+{{< example >}}
<div class="dropdown-menu">
<form class="px-4 py-3">
<div class="form-group">
<a class="dropdown-item" href="#">New around here? Sign up</a>
<a class="dropdown-item" href="#">Forgot password?</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<form class="dropdown-menu p-4">
<div class="form-group">
<label for="exampleDropdownFormEmail2">Email address</label>
</div>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Dropdown options
Use `data-offset` or `data-reference` to change the location of the dropdown.
-{% capture example %}
+{{< example >}}
<div class="d-flex">
<div class="dropdown mr-1">
<button type="button" class="btn btn-secondary dropdown-toggle" id="dropdownMenuOffset" data-toggle="dropdown" aria-expanded="false" data-offset="10,20">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Usage
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent list item. The `data-toggle="dropdown"` attribute is relied on for closing dropdown menus at an application level, so it's a good idea to always use it.
-{% capture callout %}
+{{< callout info >}}
On touch-enabled devices, opening a dropdown adds empty (`$.noop`) `mouseover` handlers to the immediate children of the `<body>` element. This admittedly ugly hack is necessary to work around a [quirk in iOS' event delegation](https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html), which would otherwise prevent a tap anywhere outside of the dropdown from triggering the code that closes the dropdown. Once the dropdown is closed, these additional empty `mouseover` handlers are removed.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
### Via data attributes
Add `data-toggle="dropdown"` to a link or button to toggle a dropdown.
-{% highlight html %}
+{{< highlight html >}}
<div class="dropdown">
<button id="dLabel" type="button" data-toggle="dropdown" aria-expanded="false">
Dropdown trigger
...
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Via JavaScript
Call the dropdowns via JavaScript:
-{% highlight js %}
+{{< highlight js >}}
$('.dropdown-toggle').dropdown()
-{% endhighlight %}
+{{< /highlight >}}
-{% capture callout %}
+{{< callout info >}}
##### `data-toggle="dropdown"` still required
Regardless of whether you call your dropdown via JavaScript or instead use the data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
### Options
| `hide.bs.dropdown` | This event is fired immediately when the hide instance method has been called. |
| `hidden.bs.dropdown`| This event is fired when the dropdown has finished being hidden from the user (will wait for CSS transitions, to complete). |
-{% highlight js %}
+{{< highlight js >}}
$('#myDropdown').on('show.bs.dropdown', function () {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
## Overview
-Bootstrap's form controls expand on [our Rebooted form styles]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/reboot/#forms) with classes. Use these classes to opt into their customized displays for a more consistent rendering across browsers and devices.
+Bootstrap's form controls expand on [our Rebooted form styles](/docs/{{< param docs_version >}}/content/reboot/#forms) with classes. Use these classes to opt into their customized displays for a more consistent rendering across browsers and devices.
Be sure to use an appropriate `type` attribute on all inputs (e.g., `email` for email address or `number` for numerical information) to take advantage of newer input controls like email verification, number selection, and more.
Here's a quick example to demonstrate Bootstrap's form styles. Keep reading for documentation on required classes, form layout, and more.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Form controls
Be sure to explore our [custom forms](#custom-forms) to further style `<select>`s.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group">
<label for="exampleFormControlInput1">Email address</label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"></textarea>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
For file inputs, swap the `.form-control` for `.form-control-file`.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group">
<label for="exampleFormControlFile1">Example file input</label>
<input type="file" class="form-control-file" id="exampleFormControlFile1">
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Sizing
Set heights using classes like `.form-control-lg` and `.form-control-sm`.
-{% capture example %}
+{{< example >}}
<input class="form-control form-control-lg" type="text" placeholder=".form-control-lg">
<input class="form-control" type="text" placeholder="Default input">
<input class="form-control form-control-sm" type="text" placeholder=".form-control-sm">
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<select class="form-control form-control-lg">
<option>Large select</option>
</select>
<select class="form-control form-control-sm">
<option>Small select</option>
</select>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Readonly
Add the `readonly` boolean attribute on an input to prevent modification of the input's value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor.
-{% capture example %}
+{{< example >}}
<input class="form-control" type="text" placeholder="Readonly input here..." readonly>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Readonly plain text
If you want to have `<input readonly>` elements in your form styled as plain text, use the `.form-control-plaintext` class to remove the default form field styling and preserve the correct margin and padding.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group row">
<label for="staticEmail" class="col-sm-2 col-form-label">Email</label>
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<form class="form-inline">
<div class="form-group mb-2">
<label for="staticEmail2" class="sr-only">Email</label>
</div>
<button type="submit" class="btn btn-primary mb-2">Confirm identity</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Range Inputs
Set horizontally scrollable range inputs using `.form-control-range`.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group">
<label for="formControlRange">Example Range input</label>
<input type="range" class="form-control-range" id="formControlRange">
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Checkboxes and radios
By default, any number of checkboxes and radios that are immediate sibling will be vertically stacked and appropriately spaced with `.form-check`.
-{% capture example %}
+{{< example >}}
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="defaultCheck1">
<label class="form-check-label" for="defaultCheck1">
Disabled checkbox
</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="form-check">
<input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
<label class="form-check-label" for="exampleRadios1">
Disabled radio
</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Inline
Group checkboxes or radios on the same horizontal row by adding `.form-check-inline` to any `.form-check`.
-{% capture example %}
+{{< example >}}
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1">
<label class="form-check-label" for="inlineCheckbox1">1</label>
<input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3" disabled>
<label class="form-check-label" for="inlineCheckbox3">3 (disabled)</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1">
<label class="form-check-label" for="inlineRadio1">1</label>
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3" disabled>
<label class="form-check-label" for="inlineRadio3">3 (disabled)</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Without labels
Add `.position-static` to inputs within `.form-check` that don't have any label text. Remember to still provide some form of label for assistive technologies (for instance, using `aria-label`).
-{% capture example %}
+{{< example >}}
<div class="form-check">
<input class="form-check-input position-static" type="checkbox" id="blankCheckbox" value="option1" aria-label="...">
</div>
<div class="form-check">
<input class="form-check-input position-static" type="radio" name="blankRadio" id="blankRadio1" value="option1" aria-label="...">
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Layout
The `.form-group` class is the easiest way to add some structure to forms. It provides a flexible class that encourages proper grouping of labels, controls, optional help text, and form validation messaging. By default it only applies `margin-bottom`, but it picks up additional styles in `.form-inline` as needed. Use it with `<fieldset>`s, `<div>`s, or nearly any other element.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group">
<label for="formGroupExampleInput">Example label</label>
<input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Another input placeholder">
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Form grid
More complex forms can be built using our grid classes. Use these for form layouts that require multiple columns, varied widths, and additional alignment options.
-{% capture example %}
+{{< example >}}
<form>
<div class="row">
<div class="col">
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Form row
You may also swap `.row` for `.form-row`, a variation of our standard grid row that overrides the default column gutters for tighter and more compact layouts.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row">
<div class="col">
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
More complex layouts can also be created with the grid system.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row">
<div class="form-group col-md-6">
</div>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Horizontal form
At times, you maybe need to use margin or padding utilities to create that perfect alignment you need. For example, we've removed the `padding-top` on our stacked radio inputs label to better align the text baseline.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group row">
<label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
##### Horizontal form label sizing
Be sure to use `.col-form-label-sm` or `.col-form-label-lg` to your `<label>`s or `<legend>`s to correctly follow the size of `.form-control-lg` and `.form-control-sm`.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-group row">
<label for="colFormLabelSm" class="col-sm-2 col-form-label col-form-label-sm">Email</label>
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Column sizing
As shown in the previous examples, our grid system allows you to place any number of `.col`s within a `.row` or `.form-row`. They'll split the available width equally between them. You may also pick a subset of your columns to take up more or less space, while the remaining `.col`s equally split the rest, with specific column classes like `.col-7`.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row">
<div class="col-7">
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Auto-sizing
The example below uses a flexbox utility to vertically center the contents and changes `.col` to `.col-auto` so that your columns only take up as much space as needed. Put another way, the column sizes itself based on the contents.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row align-items-center">
<div class="col-auto">
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
You can then remix that once again with size-specific column classes.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row align-items-center">
<div class="col-sm-3 my-1">
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
And of course [custom form controls](#custom-forms) are supported.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row align-items-center">
<div class="col-auto my-1">
</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### 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 vary slightly from their default states.
-- Controls are `display: flex`, collapsing any HTML white space and allowing you to provide alignment control with [spacing]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) and [flexbox]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/) utilities.
+- Controls are `display: flex`, collapsing any HTML white space and allowing you to provide alignment control with [spacing](/docs/{{< param docs_version >}}/utilities/spacing/) and [flexbox](/docs/{{< param docs_version >}}/utilities/flex/) utilities.
- Controls and input groups receive `width: auto` to override the Bootstrap default `width: 100%`.
- Controls **only appear inline in viewports that are at least 576px wide** to account for narrow viewports on mobile devices.
-You may need to manually address the width and alignment of individual form controls with [spacing utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/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`.
+You may need to manually address the width and alignment of individual form controls with [spacing utilities](/docs/{{< param docs_version >}}/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`.
-{% capture example %}
+{{< example >}}
<form class="form-inline">
<label class="sr-only" for="inlineFormInputName2">Name</label>
<input type="text" class="form-control mb-2 mr-sm-2" id="inlineFormInputName2" placeholder="Jane Doe">
<button type="submit" class="btn btn-primary mb-2">Submit</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Custom form controls and selects are also supported.
-{% capture example %}
+{{< example >}}
<form class="form-inline">
<label class="my-1 mr-2" for="inlineFormCustomSelectPref">Preference</label>
<select class="custom-select my-1 mr-sm-2" id="inlineFormCustomSelectPref">
<button type="submit" class="btn btn-primary my-1">Submit</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture callout %}
+{{< callout warning >}}
##### Alternatives to hidden labels
+
Assistive technologies such as screen readers will have trouble with your forms if you don't include a label for every input. For these inline forms, you can hide the labels using the `.sr-only` class. There are further alternative methods of providing a label for assistive technologies, such as the `aria-label`, `aria-labelledby` or `title` attribute. If none of these are present, assistive technologies may resort to using the `placeholder` attribute, if present, but note that use of `placeholder` as a replacement for other labelling methods is not advised.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
## Help text
Block-level help text in forms can be created using `.form-text` (previously known as `.help-block` in v3). Inline help text can be flexibly implemented using any inline HTML element and utility classes like `.text-muted`.
-{% capture callout %}
+{{< callout warning >}}
##### Associating help text with form controls
Help text should be explicitly associated with the form control it relates to using the `aria-describedby` attribute. This will ensure that assistive technologies—such as screen readers—will announce this help text when the user focuses or enters the control.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
Help text below inputs can be styled with `.form-text`. This class includes `display: block` and adds some top margin for easy spacing from the inputs above.
-{% capture example %}
+{{< example >}}
<label for="inputPassword5">Password</label>
<input type="password" id="inputPassword5" class="form-control" aria-describedby="passwordHelpBlock">
<small id="passwordHelpBlock" class="form-text text-muted">
Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.
</small>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Inline text can use any typical inline HTML element (be it a `<small>`, `<span>`, or something else) with nothing more than a utility class.
-{% capture example %}
+{{< example >}}
<form class="form-inline">
<div class="form-group">
<label for="inputPassword6">Password</label>
</small>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Disabled forms
Add the `disabled` boolean attribute on an input to prevent user interactions and make it appear lighter.
-{% highlight html %}
+{{< highlight html >}}
<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>
-{% endhighlight %}
+{{< /highlight >}}
Add the `disabled` attribute to a `<fieldset>` to disable all the controls within.
-{% capture example %}
+{{< example >}}
<form>
<fieldset disabled>
<div class="form-group">
<button type="submit" class="btn btn-primary">Submit</button>
</fieldset>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture callout %}
+{{< callout warning >}}
##### Caveat with anchors
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`.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
## Validation
Provide valuable, actionable feedback to your users with HTML5 form validation–[available in all our supported browsers](https://caniuse.com/#feat=form-validation). Choose from the browser default validation feedback, or implement custom messages with our built-in classes and starter JavaScript.
-{% capture callout %}
+{{< callout warning >}}
We currently recommend using custom validation styles, as native browser default validation messages are not consistently exposed to assistive technologies in all browsers (most notably, Chrome on desktop and mobile).
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
### How it works
Custom feedback styles apply custom colors, borders, focus styles, and background icons to better communicate feedback. Background icons for `<select>`s are only available with `.custom-select`, and not `.form-control`.
-{% capture example %}
+{{< example >}}
<form class="needs-validation" novalidate>
<div class="form-row">
<div class="col-md-4 mb-3">
}, false);
})();
</script>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Browser defaults
While these feedback styles cannot be styled with CSS, you can still customize the feedback text through JavaScript.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row">
<div class="col-md-4 mb-3">
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Server side
We recommend using client-side validation, but in case you require server-side validation, you can indicate invalid and valid form fields with `.is-invalid` and `.is-valid`. Note that `.invalid-feedback` is also supported with these classes.
-{% capture example %}
+{{< example >}}
<form>
<div class="form-row">
<div class="col-md-4 mb-3">
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Supported elements
- `.custom-checkbox`s and `.custom-radio`s
- `.custom-file`
-{% capture example %}
+{{< example >}}
<form class="was-validated">
<div class="mb-3">
<label for="validationTextarea">Textarea</label>
<div class="invalid-feedback">Example invalid custom file feedback</div>
</div>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Tooltips
If your form layout allows it, you can swap the `.{valid|invalid}-feedback` classes for `.{valid|invalid}-tooltip` classes to display validation feedback in a styled tooltip. Be sure to have a parent with `position: relative` on it for tooltip positioning. In the example below, our column classes have this already, but your project may require an alternative setup.
-{% capture example %}
+{{< example >}}
<form class="needs-validation" novalidate>
<div class="form-row">
<div class="col-md-4 mb-3">
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Customizing
Please note that we do not recommend customizing these values without also modifying the `form-validation-state` mixin.
-{% highlight scss %}
+{{< highlight scss >}}
// Sass map from `_variables.scss`
// Override this and recompile your Sass to generate different states
$form-validation-states: map-merge(
@each $state, $data in $form-validation-states {
@include form-validation-state($state, map-get($data, color), map-get($data, icon));
}
-{% endhighlight %}
+{{< /highlight >}}
## Custom forms
#### Checkboxes
-{% capture example %}
+{{< example >}}
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">Check this custom checkbox</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Custom checkboxes can also utilize the `:indeterminate` pseudo class when manually set via JavaScript (there is no available HTML attribute for specifying it).
</div>
</div>
-{% highlight js %}
+{{< highlight js >}}
var checkbox = document.querySelector('.your-checkbox')
checkbox.indeterminate = true
-{% endhighlight %}
+{{< /highlight >}}
#### Radios
-{% capture example %}
+{{< example >}}
<div class="custom-control custom-radio">
<input type="radio" id="customRadio1" name="customRadio" class="custom-control-input">
<label class="custom-control-label" for="customRadio1">Toggle this custom radio</label>
<input type="radio" id="customRadio2" name="customRadio" class="custom-control-input">
<label class="custom-control-label" for="customRadio2">Or toggle this other custom radio</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Inline
-{% capture example %}
+{{< example >}}
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="customRadioInline1" name="customRadioInline1" class="custom-control-input">
<label class="custom-control-label" for="customRadioInline1">Toggle this custom radio</label>
<input type="radio" id="customRadioInline2" name="customRadioInline1" class="custom-control-input">
<label class="custom-control-label" for="customRadioInline2">Or toggle this other custom radio</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Disabled
Custom checkboxes and radios can also be disabled. Add the `disabled` boolean attribute to the `<input>` and the custom indicator and label description will be automatically styled.
-{% capture example %}
+{{< example >}}
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheckDisabled1" disabled>
<label class="custom-control-label" for="customCheckDisabled1">Check this custom checkbox</label>
<input type="radio" name="radioDisabled" id="customRadioDisabled2" class="custom-control-input" disabled>
<label class="custom-control-label" for="customRadioDisabled2">Toggle this custom radio</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Switches
A switch has the markup of a custom checkbox but uses the `.custom-switch` class to render a toggle switch. Switches also support the `disabled` attribute.
-{% capture example %}
+{{< example >}}
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="customSwitch1">
<label class="custom-control-label" for="customSwitch1">Toggle this switch element</label>
<input type="checkbox" class="custom-control-input" disabled id="customSwitch2">
<label class="custom-control-label" for="customSwitch2">Disabled switch element</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Select menu
Custom `<select>` menus need only a custom class, `.custom-select` to trigger the custom styles. Custom styles are limited to the `<select>`'s initial appearance and cannot modify the `<option>`s due to browser limitations.
-{% capture example %}
+{{< example >}}
<select class="custom-select">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
You may also choose from small and large custom selects to match our similarly sized text inputs.
-{% capture example %}
+{{< example >}}
<select class="custom-select custom-select-lg mb-3">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
The `multiple` attribute is also supported:
-{% capture example %}
+{{< example >}}
<select class="custom-select" multiple>
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
As is the `size` attribute:
-{% capture example %}
+{{< example >}}
<select class="custom-select" size="3">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Range
Create custom `<input type="range">` controls with `.custom-range`. The track (the background) and thumb (the value) are both styled to appear the same across browsers. As only Firefox supports "filling" their track from the left or right of the thumb as a means to visually indicate progress, we do not currently support it.
-{% capture example %}
+{{< example >}}
<label for="customRange1">Example range</label>
<input type="range" class="custom-range" id="customRange1">
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Range inputs have implicit values for `min` and `max`—`0` and `100`, respectively. You may specify new values for those using the `min` and `max` attributes.
-{% capture example %}
+{{< example >}}
<label for="customRange2">Example range</label>
<input type="range" class="custom-range" min="0" max="5" id="customRange2">
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
By default, range inputs "snap" to integer values. To change this, you can specify a `step` value. In the example below, we double the number of steps by using `step="0.5"`.
-{% capture example %}
+{{< example >}}
<label for="customRange3">Example range</label>
<input type="range" class="custom-range" min="0" max="5" step="0.5" id="customRange3">
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### File browser
-{% capture callout %}
+{{< callout info >}}
The recommended plugin to animate custom file input: [bs-custom-file-input](https://www.npmjs.com/package/bs-custom-file-input), that's what we are using currently here in our docs.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
The file input is the most gnarly of the bunch and requires additional JavaScript if you'd like to hook them up with functional *Choose file...* and selected file name text.
-{% capture example %}
+{{< example >}}
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile">
<label class="custom-file-label" for="customFile">Choose file</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
We hide the default file `<input>` via `opacity` and instead style the `<label>`. The button is generated and positioned with `::after`. Lastly, we declare a `width` and `height` on the `<input>` for proper spacing for surrounding content.
The [`:lang()` pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:lang) is used to allow for translation of the "Browse" text into other languages. Override or add entries to the `$custom-file-text` Sass variable with the relevant [language tag](https://en.wikipedia.org/wiki/IETF_language_tag) and localized strings. The English strings can be customized the same way. For example, here's how one might add a Spanish translation (Spanish's language code is `es`):
-{% highlight scss %}
+{{< highlight scss >}}
$custom-file-text: (
en: "Browse",
es: "Elegir"
);
-{% endhighlight %}
+{{< /highlight >}}
Here's `lang(es)` in action on the custom file input for a Spanish translation:
-{% capture example %}
+{{< example >}}
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFileLang" lang="es">
<label class="custom-file-label" for="customFileLang">Seleccionar Archivo</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
You'll need to set the language of your document (or subtree thereof) correctly in order for the correct text to be shown. This can be done using [the `lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) on the `<html>` element or the [`Content-Language` HTTP header](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12), among other methods.
Bootstrap also provides a way to translate the "Browse" text in HTML with the `data-browse` attribute which can be added to the custom input label (example in Dutch):
-{% capture example %}
+{{< example >}}
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFileLangHTML">
<label class="custom-file-label" for="customFileLangHTML" data-browse="Bestand kiezen">Voeg je document toe</label>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Place one add-on or button on either side of an input. You may also place one on both sides of an input. Remember to place `<label>`s outside the input group.
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">@</span>
</div>
<textarea class="form-control" aria-label="With textarea"></textarea>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Wrapping
Input groups wrap by default via `flex-wrap: wrap` in order to accommodate custom form field validation within an input group. You may disable this with `.flex-nowrap`.
-{% capture example %}
+{{< example >}}
<div class="input-group flex-nowrap">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping">@</span>
</div>
<input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="addon-wrapping">
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Sizing
**Sizing on the individual input group elements isn't supported.**
-{% capture example %}
+{{< example >}}
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-sm">Small</span>
</div>
<input type="text" class="form-control" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-lg">
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Checkboxes and radios
Place any checkbox or radio option within an input group's addon instead of text.
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">
</div>
<input type="text" class="form-control" aria-label="Text input with radio button">
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Multiple inputs
While multiple `<input>`s are supported visually, validation styles are only available for input groups with a single `<input>`.
-{% capture example %}
+{{< example >}}
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">First and last name</span>
<input type="text" aria-label="First name" class="form-control">
<input type="text" aria-label="Last name" class="form-control">
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Multiple addons
Multiple add-ons are supported and can be mixed with checkbox and radio input versions.
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">$</span>
<span class="input-group-text">0.00</span>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Button addons
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<button class="btn btn-outline-secondary" type="button" id="button-addon1">Button</button>
<button class="btn btn-outline-secondary" type="button">Button</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Buttons with dropdowns
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">Dropdown</button>
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Segmented buttons
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<button type="button" class="btn btn-outline-secondary">Action</button>
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Custom forms
### Custom select
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="inputGroupSelect01">Options</label>
<button class="btn btn-outline-secondary" type="button">Button</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Custom file input
-{% capture example %}
+{{< example >}}
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroupFileAddon01">Upload</span>
<button class="btn btn-outline-secondary" type="button" id="inputGroupFileAddon04">Button</button>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Accessibility
A lightweight, flexible component that can optionally extend the entire viewport to showcase key marketing messages on your site.
-{% capture example %}
+{{< example >}}
<div class="jumbotron">
<h1 class="display-4">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>It uses utility classes for typography and spacing to space content out within the larger container.</p>
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
To make the jumbotron full width, and without rounded corners, add the `.jumbotron-fluid` modifier class and add a `.container` or `.container-fluid` within.
-{% capture example %}
+{{< example >}}
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4">Fluid jumbotron</h1>
<p class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.</p>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture example %}
+{{< example >}}
<ul class="list-group">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Active items
Add `.active` to a `.list-group-item` to indicate the current active selection.
-{% capture example %}
+{{< example >}}
<ul class="list-group">
<li class="list-group-item active">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Disabled items
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).
-{% capture example %}
+{{< example >}}
<ul class="list-group">
<li class="list-group-item disabled" aria-disabled="true">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Links and buttons
Be sure to **not use the standard `.btn` classes here**.
-{% capture example %}
+{{< example >}}
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active">
Cras justo odio
<a href="#" class="list-group-item list-group-item-action">Porta ac consectetur ac</a>
<a href="#" class="list-group-item list-group-item-action disabled" tabindex="-1" aria-disabled="true">Vestibulum at eros</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture example %}
+{{< example >}}
<div class="list-group">
<button type="button" class="list-group-item list-group-item-action active">
Cras justo odio
<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>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Flush
Add `.list-group-flush` to remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards).
-{% capture example %}
+{{< example >}}
<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">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Horizontal
**ProTip:** Want equal-width list group items when horizontal? Add `.flex-fill` to each list group item.
-{% for bp in site.data.breakpoints %}
-{% capture example %}
-<ul class="list-group list-group-horizontal{{ bp.abbr }}">
+{{< example >}}
+{{< list-group.inline >}}
+{{- range $.Site.Data.breakpoints }}
+<ul class="list-group list-group-horizontal{{ .abbr }}">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}{% endfor %}
+{{- end -}}
+{{< /list-group.inline >}}
+{{< /example >}}
## Contextual classes
Use contextual classes to style list items with a stateful background and color.
-{% capture example %}
+{{< example >}}
<ul class="list-group">
<li class="list-group-item">Dapibus ac facilisis in</li>
-
- {% for color in site.data.theme-colors %}
- <li class="list-group-item list-group-item-{{ color.name }}">A simple {{ color.name }} list group item</li>{% endfor %}
+{{< list.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+ <li class="list-group-item list-group-item-{{ .name }}">A simple {{ .name }} list group item</li>
+{{- end -}}
+{{< /list.inline >}}
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture example %}
+{{< example >}}
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
-
- {% for color in site.data.theme-colors %}
- <a href="#" class="list-group-item list-group-item-action list-group-item-{{ color.name }}">A simple {{ color.name }} list group item</a>{% endfor %}
+{{< list.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+ <a href="#" class="list-group-item list-group-item-action list-group-item-{{ .name }}">A simple {{ .name }} list group item</a>
+{{- end -}}
+{{< /list.inline >}}
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% include callout-warning-color-assistive-technologies.md %}
+{{< callout info >}}
+{{< partial "callout-warning-color-assistive-technologies.md" >}}
+{{< /callout >}}
## With badges
-Add badges to any list group item to show unread counts, activity, and more with the help of some [utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/).
+Add badges to any list group item to show unread counts, activity, and more with the help of some [utilities](/docs/{{< param docs_version >}}/utilities/flex/).
-{% capture example %}
+{{< example >}}
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Cras justo odio
<span class="badge badge-primary badge-pill">1</span>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Custom content
-Add nearly any HTML within, even for linked list groups like the one below, with the help of [flexbox utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/).
+Add nearly any HTML within, even for linked list groups like the one below, with the help of [flexbox utilities](/docs/{{< param docs_version >}}/utilities/flex/).
-{% capture example %}
+{{< example >}}
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active">
<div class="d-flex w-100 justify-content-between">
<small class="text-muted">Donec id elit non mi porta.</small>
</a>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## JavaScript behavior
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="row">
<div class="col-4">
<div class="list-group" id="list-tab" role="tablist">
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Using data attributes
You can activate a list group navigation without writing any JavaScript by simply specifying `data-toggle="list"` or on an element. Use these data attributes on `.list-group-item`.
<div role="tabpanel">
-{% highlight html %}
+{{< highlight html >}}
<!-- List group -->
<div class="list-group" id="myList" role="tablist">
<a class="list-group-item list-group-item-action active" data-toggle="list" href="#home" role="tab">Home</a>
<div class="tab-pane" id="messages" role="tabpanel">...</div>
<div class="tab-pane" id="settings" role="tabpanel">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
</div>
### Via JavaScript
Enable tabbable list item via JavaScript (each list item needs to be activated individually):
-{% highlight js %}
+{{< highlight js >}}
$('#myList a').on('click', function (e) {
e.preventDefault()
$(this).tab('show')
})
-{% endhighlight %}
+{{< /highlight >}}
You can activate individual list item in several ways:
-{% highlight js %}
+{{< highlight js >}}
$('#myList a[href="#profile"]').tab('show') // Select tab by name
$('#myList a:first-child').tab('show') // Select first tab
$('#myList a:last-child').tab('show') // Select last tab
$('#myList a:nth-child(3)').tab('show') // Select third tab
-{% endhighlight %}
+{{< /highlight >}}
### Fade effect
To make tabs panel 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-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="messages" role="tabpanel">...</div>
<div class="tab-pane fade" id="settings" role="tabpanel">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Methods
Activates a list item element and content container. Tab should have either a `data-target` or an `href` targeting a container node in the DOM.
-{% highlight html %}
+{{< highlight html >}}
<div class="list-group" id="myList" role="tablist">
<a class="list-group-item list-group-item-action active" data-toggle="list" href="#home" role="tab">Home</a>
<a class="list-group-item list-group-item-action" data-toggle="list" href="#profile" role="tab">Profile</a>
$('#myList a:last-child').tab('show')
})
</script>
-{% endhighlight %}
+{{< /highlight >}}
#### .tab('show')
Selects the given list item and shows its associated pane. Any other list item that was previously selected becomes unselected and its associated pane is hidden. **Returns to the caller before the tab pane has actually been shown** (for example, before the `shown.bs.tab` event occurs).
-{% highlight js %}
+{{< highlight js >}}
$('#someListItem').tab('show')
-{% endhighlight %}
+{{< /highlight >}}
### Events
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('a[data-toggle="list"]').on('shown.bs.tab', function (e) {
e.target // newly activated tab
e.relatedTarget // previous active tab
})
-{% endhighlight %}
+{{< /highlight >}}
The [media object](http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/) helps build complex and repetitive components where some media is positioned alongside content that doesn't wrap around said media. Plus, it does this with only two required classes thanks to flexbox.
-Below is an example of a single media object. Only two classes are required—the wrapping `.media` and the `.media-body` around your content. Optional padding and margin can be controlled through [spacing utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/).
+Below is an example of a single media object. Only two classes are required—the wrapping `.media` and the `.media-body` around your content. Optional padding and margin can be controlled through [spacing utilities](/docs/{{< param docs_version >}}/utilities/spacing/).
-{% capture example %}
+{{< example >}}
<div class="media">
- {% include icons/placeholder.svg width="64" height="64" class="mr-3" %}
+ {{< placeholder width="64" height="64" class="mr-3" >}}
<div class="media-body">
<h5 class="mt-0">Media heading</h5>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Nesting
Media objects can be infinitely nested, though we suggest you stop at some point. Place nested `.media` within the `.media-body` of a parent media object.
-{% capture example %}
+{{< example >}}
<div class="media">
- {% include icons/placeholder.svg width="64" height="64" class="mr-3" %}
+ {{< placeholder width="64" height="64" class="mr-3" >}}
<div class="media-body">
<h5 class="mt-0">Media heading</h5>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
<div class="media mt-3">
<a class="mr-3" href="#">
- {% include icons/placeholder.svg width="64" height="64" %}
+ {{< placeholder width="64" height="64" >}}
</a>
<div class="media-body">
<h5 class="mt-0">Media heading</h5>
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Alignment
Media in a media object can be aligned with flexbox utilities to the top (default), middle, or end of your `.media-body` content.
-{% capture example %}
+{{< example >}}
<div class="media">
- {% include icons/placeholder.svg width="64" height="64" class="align-self-start mr-3" %}
+ {{< placeholder width="64" height="64" class="align-self-start mr-3" >}}
<div class="media-body">
<h5 class="mt-0">Top-aligned media</h5>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p>Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="media">
- {% include icons/placeholder.svg width="64" height="64" class="align-self-center mr-3" %}
+ {{< placeholder width="64" height="64" class="align-self-center mr-3" >}}
<div class="media-body">
<h5 class="mt-0">Center-aligned media</h5>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p class="mb-0">Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="media">
- {% include icons/placeholder.svg width="64" height="64" class="align-self-end mr-3" %}
+ {{< placeholder width="64" height="64" class="align-self-end mr-3" >}}
<div class="media-body">
<h5 class="mt-0">Bottom-aligned media</h5>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p class="mb-0">Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Order
Change the order of content in media objects by modifying the HTML itself, or by adding some custom flexbox CSS to set the `order` property (to an integer of your choosing).
-{% capture example %}
+{{< example >}}
<div class="media">
<div class="media-body">
<h5 class="mt-0 mb-1">Media object</h5>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
- {% include icons/placeholder.svg width="64" height="64" class="ml-3" %}
+ {{< placeholder width="64" height="64" class="ml-3" >}}
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Media list
Because the media object has so few structural requirements, you can also use these classes on list HTML elements. On your `<ul>` or `<ol>`, add the `.list-unstyled` to remove any browser default list styles, and then apply `.media` to your `<li>`s. As always, use spacing utilities wherever needed to fine tune.
-{% capture example %}
+{{< example >}}
<ul class="list-unstyled">
<li class="media">
- {% include icons/placeholder.svg width="64" height="64" class="mr-3" %}
+ {{< placeholder width="64" height="64" class="mr-3" >}}
<div class="media-body">
<h5 class="mt-0 mb-1">List-based media object</h5>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</li>
<li class="media my-4">
- {% include icons/placeholder.svg width="64" height="64" class="mr-3" %}
+ {{< placeholder width="64" height="64" class="mr-3" >}}
<div class="media-body">
<h5 class="mt-0 mb-1">List-based media object</h5>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</li>
<li class="media">
- {% include icons/placeholder.svg width="64" height="64" class="mr-3" %}
+ {{< placeholder width="64" height="64" class="mr-3" >}}
<div class="media-body">
<h5 class="mt-0 mb-1">List-based media object</h5>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
- 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.
- Modals use `position: fixed`, which can sometimes be a bit particular about its 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.
-- Once again, due to `position: fixed`, there are some caveats with using modals on mobile devices. [See our browser support docs]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/browsers-devices/#modals-and-dropdowns-on-mobile) for details.
+- Once again, due to `position: fixed`, there are some caveats with using modals on mobile devices. [See our browser support docs](/docs/{{< param docs_version >}}/getting-started/browsers-devices/#modals-and-dropdowns-on-mobile) for details.
- 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 () {
$('#myInput').trigger('focus')
})
-{% endhighlight %}
+{{< /highlight >}}
-{% include callout-info-prefersreducedmotion.md %}
+{{< callout info >}}
+{{< partial "callout-info-prefersreducedmotion.md" >}}
+{{< /callout >}}
Keep reading for demos and usage guidelines.
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Live demo
</button>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Scrolling long content
</button>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong">
Launch demo modal
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
You can also create a scrollable modal that allows scroll the modal body by adding `.modal-dialog-scrollable` to `.modal-dialog`.
</button>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalScrollable">
Launch demo modal
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Vertically centered
</button>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
Launch demo modal
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Tooltips and popovers
-[Tooltips]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/tooltips/) and [popovers]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/popovers/) can be placed within modals as needed. When modals are closed, any tooltips and popovers within are also automatically dismissed.
+[Tooltips](/docs/{{< param docs_version >}}/components/tooltips/) and [popovers](/docs/{{< param docs_version >}}/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">
</button>
</div>
-{% highlight html %}
+{{< 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>
<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 %}
+{{< /highlight >}}
### Using the grid
</button>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="modal-body">
<div class="container-fluid">
<div class="row">
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Varying modal content
Below is a live demo followed by example HTML and JavaScript. For more information, [read the modal events docs](#events) for details on `relatedTarget`.
-{% capture example %}
+{{< 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>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% highlight js %}
+{{< 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
modal.find('.modal-title').text('New message to ' + recipient)
modal.find('.modal-body input').val(recipient)
})
-{% endhighlight %}
+{{< /highlight >}}
### Change animation
For modals that simply appear rather than fade in to view, remove the `.fade` class from your modal markup.
-{% highlight html %}
+{{< highlight html >}}
<div class="modal" tabindex="-1" role="dialog" aria-labelledby="..." aria-hidden="true">
...
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Dynamic heights
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-sm">Small modal</button>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- Extra large modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-xl">Extra large modal</button>
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="modal fade bd-example-modal-xl" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
Activate a modal without writing JavaScript. Set `data-toggle="modal"` on a controller element, like a button, along with a `data-target="#foo"` or `href="#foo"` to target a specific modal to toggle.
-{% highlight html %}
+{{< highlight html >}}
<button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>
-{% endhighlight %}
+{{< /highlight >}}
### Via JavaScript
Call a modal with id `myModal` with a single line of JavaScript:
-{% highlight js %}$('#myModal').modal(options){% endhighlight %}
+{{< highlight js >}}$('#myModal').modal(options){{< /highlight >}}
### Options
### Methods
-{% include callout-danger-async-methods.md %}
+{{< callout danger >}}
+{{< partial "callout-danger-async-methods.md" >}}
+{{< /callout >}}
#### `.modal(options)`
Activates your content as a modal. Accepts an optional options `object`.
-{% highlight js %}
+{{< highlight js >}}
$('#myModal').modal({
keyboard: false
})
-{% endhighlight %}
+{{< /highlight >}}
#### `.modal('toggle')`
Manually toggles a modal. **Returns to the caller before the modal has actually been shown or hidden** (i.e. before the `shown.bs.modal` or `hidden.bs.modal` event occurs).
-{% highlight js %}$('#myModal').modal('toggle'){% endhighlight %}
+{{< highlight js >}}$('#myModal').modal('toggle'){{< /highlight >}}
#### `.modal('show')`
Manually opens a modal. **Returns to the caller before the modal has actually been shown** (i.e. before the `shown.bs.modal` event occurs).
-{% highlight js %}$('#myModal').modal('show'){% endhighlight %}
+{{< highlight js >}}$('#myModal').modal('show'){{< /highlight >}}
#### `.modal('hide')`
Manually hides a modal. **Returns to the caller before the modal has actually been hidden** (i.e. before the `hidden.bs.modal` event occurs).
-{% highlight js %}$('#myModal').modal('hide'){% endhighlight %}
+{{< highlight js >}}$('#myModal').modal('hide'){{< /highlight >}}
#### `.modal('handleUpdate')`
Manually readjust the modal's position if the height of a modal changes while it is open (i.e. in case a scrollbar appears).
-{% highlight js %}$('#myModal').modal('handleUpdate'){% endhighlight %}
+{{< highlight js >}}$('#myModal').modal('handleUpdate'){{< /highlight >}}
#### `.modal('dispose')`
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('#myModal').on('hidden.bs.modal', function (e) {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
- Navbars require a wrapping `.navbar` with `.navbar-expand{-sm|-md|-lg|-xl}` for responsive collapsing and [color scheme](#color-schemes) classes.
- Navbars and their contents are fluid by default. Use [optional containers](#containers) to limit their horizontal width.
-- Use our [spacing]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) and [flex]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/) utility classes for controlling spacing and alignment within navbars.
+- Use our [spacing](/docs/{{< param docs_version >}}/utilities/spacing/) and [flex](/docs/{{< param docs_version >}}/utilities/flex/) utility classes for controlling spacing and alignment within navbars.
- Navbars are responsive by default, but you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin.
-- Navbars are hidden by default when printing. Force them to be printed by adding `.d-print` to the `.navbar`. See the [display]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/) utility class.
+- Navbars are hidden by default when printing. Force them to be printed by adding `.d-print` to the `.navbar`. See the [display](/docs/{{< param docs_version >}}/utilities/display/) utility class.
- 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.
-{% include callout-info-prefersreducedmotion.md %}
+{{< callout info >}}
+{{< partial "callout-info-prefersreducedmotion.md" >}}
+{{< /callout >}}
Read on for an example and list of supported sub-components.
Here's an example of all the sub-components included in a responsive light-themed navbar that automatically collapses at the `lg` (large) breakpoint.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
</form>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-This example uses [color]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/) (`bg-light`) and [spacing]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) (`my-2`, `my-lg-0`, `mr-sm-0`, `my-sm-0`) utility classes.
+This example uses [color](/docs/{{< param docs_version >}}/utilities/colors/) (`bg-light`) and [spacing](/docs/{{< param docs_version >}}/utilities/spacing/) (`my-2`, `my-lg-0`, `mr-sm-0`, `my-sm-0`) utility classes.
### Brand
The `.navbar-brand` can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles.
-{% capture example %}
+{{< example >}}
<!-- As a link -->
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<nav class="navbar navbar-light bg-light">
<span class="navbar-brand mb-0 h1">Navbar</span>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Adding images to the `.navbar-brand` will likely always require custom styles or utilities to properly size. Here are some examples to demonstrate.
-{% capture example %}
+{{< example >}}
<!-- Just an image -->
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">
- <img src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" width="30" height="30" alt="">
+ <img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" width="30" height="30" alt="">
</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<!-- Image and text -->
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">
- <img src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="">
+ <img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="">
Bootstrap
</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Nav
Active states—with `.active`—to indicate the current page can be applied directly to `.nav-link`s or their immediate parent `.nav-item`s.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
</ul>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
And because we use classes for our navs, you can avoid the list-based approach entirely if you like.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
</div>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
</ul>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Forms
Place various form controls and components within a navbar with `.form-inline`.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-light bg-light">
<form class="form-inline">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-Immediate children elements in `.navbar` use flex layout and will default to `justify-content: between`. Use additional [flex utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/) as needed to adjust this behavior.
+Immediate children elements in `.navbar` use flex layout and will default to `justify-content: between`. Use additional [flex utilities](/docs/{{< param docs_version >}}/utilities/flex/) as needed to adjust this behavior.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand">Navbar</a>
<form class="form-inline">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Input groups work, too:
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-light bg-light">
<form class="form-inline">
<div class="input-group">
</div>
</form>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-light bg-light">
<form class="form-inline">
<button class="btn btn-outline-success" type="button">Main button</button>
<button class="btn btn-sm btn-outline-secondary" type="button">Smaller button</button>
</form>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### 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.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-light bg-light">
<span class="navbar-text">
Navbar text with an inline element
</span>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Mix and match with other components and utilities as needed.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar w/ text</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
</span>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Color schemes
</nav>
</div>
-{% highlight html %}
+{{< highlight html >}}
<nav class="navbar navbar-dark bg-dark">
<!-- Navbar content -->
</nav>
<nav class="navbar navbar-light" style="background-color: #e3f2fd;">
<!-- Navbar content -->
</nav>
-{% endhighlight %}
+{{< /highlight >}}
## Containers
Although it's not required, you can wrap a navbar in a `.container` to center it on a page or add one within to only center the contents of a [fixed or static top navbar](#placement).
-{% capture example %}
+{{< example >}}
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
</nav>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
When the container is within your navbar, its horizontal padding is removed at breakpoints lower than your specified `.navbar-expand{-sm|-md|-lg|-xl}` class. This ensures we're not doubling up on padding unnecessarily on lower viewports when your navbar is collapsed.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">Navbar</a>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Placement
-Use our [position utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/position/) to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the `<body>`) to prevent overlap with other elements.
+Use our [position utilities](/docs/{{< param docs_version >}}/utilities/position/) to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the `<body>`) to prevent overlap with other elements.
Also note that **`.sticky-top` uses `position: sticky`, which [isn't fully supported in every browser](https://caniuse.com/#feat=css-sticky)**.
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">Default</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<nav class="navbar fixed-top navbar-light bg-light">
<a class="navbar-brand" href="#">Fixed top</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<nav class="navbar fixed-bottom navbar-light bg-light">
<a class="navbar-brand" href="#">Fixed bottom</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<nav class="navbar sticky-top navbar-light bg-light">
<a class="navbar-brand" href="#">Sticky top</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Responsive behaviors
With no `.navbar-brand` shown in lowest breakpoint:
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<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>
</form>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
With a brand name shown on the left and toggler on the right:
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
</form>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
With a toggler on the left and brand name on the right:
-{% capture example %}
+{{< example >}}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</form>
</div>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### 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!
-{% capture example %}
+{{< example >}}
<div class="pos-f-t">
<div class="collapse" id="navbarToggleExternalContent">
<div class="bg-dark p-4">
</button>
</nav>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture callout %}
+{{< callout info >}}
The base `.nav` component does not include any `.active` state. The following examples include the class, mainly to demonstrate that this particular class does not trigger any special styling.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
-{% capture example %}
+{{< example >}}
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, `<ol>` if the order of your items is important, or roll your own with a `<nav>` element. Because the `.nav` uses `display: flex`, the nav links behave the same as nav items would, but without the extra markup.
-{% capture example %}
+{{< example >}}
<nav class="nav">
<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="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Available styles
### Horizontal alignment
-Change the horizontal alignment of your nav with [flexbox utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/layout/grid/#horizontal-alignment). By default, navs are left-aligned, but you can easily change them to center or right aligned.
+Change the horizontal alignment of your nav with [flexbox utilities](/docs/{{< param docs_version >}}/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`:
-{% capture example %}
+{{< example >}}
<ul class="nav justify-content-center">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Right-aligned with `.justify-content-end`:
-{% capture example %}
+{{< example >}}
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### 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`).
-{% capture example %}
+{{< example >}}
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
As always, vertical navigation is possible without `<ul>`s, too.
-{% capture example %}
+{{< example >}}
<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="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### 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).
-{% capture example %}
+{{< example >}}
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Pills
Take that same HTML, but use `.nav-pills` instead:
-{% capture example %}
+{{< example >}}
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Fill and justify
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.
-{% capture example %}
+{{< example >}}
<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
When using a `<nav>`-based navigation, be sure to include `.nav-item` on the anchors.
-{% capture example %}
+{{< example >}}
<nav class="nav nav-pills nav-fill">
<a class="nav-item nav-link active" href="#">Active</a>
<a class="nav-item nav-link" href="#">Much longer nav link</a>
<a class="nav-item nav-link" href="#">Link</a>
<a class="nav-item nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
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.
-{% capture example %}
+{{< example >}}
<ul class="nav nav-pills nav-justified">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Similar to the `.nav-fill` example using a `<nav>`-based navigation, be sure to include `.nav-item` on the anchors.
-{% capture example %}
+{{< example >}}
<nav class="nav nav-pills nav-justified">
<a class="nav-item nav-link active" href="#">Active</a>
<a class="nav-item nav-link" href="#">Much longer nav link</a>
<a class="nav-item nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Working with flex utilities
-If you need responsive nav variations, consider using a series of [flexbox utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/). 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.
+If you need responsive nav variations, consider using a series of [flexbox utilities](/docs/{{< param docs_version >}}/utilities/flex/). 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.
-{% capture example %}
+{{< example >}}
<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="#">Longer nav 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="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Regarding accessibility
## Using dropdowns
-Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/dropdowns/#usage).
+Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin](/docs/{{< param docs_version >}}/components/dropdowns/#usage).
### Tabs with dropdowns
-{% capture example %}
+{{< example >}}
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Pills with dropdowns
-{% capture example %}
+{{< example >}}
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## JavaScript behavior
Use the tab JavaScript plugin—include it individually or through the compiled `bootstrap.js` file—to extend our navigational tabs and pills to create tabbable panes of local content, even via dropdown menus.
-If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+If you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util).
Dynamic tabbed interfaces, as described in the [<abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr> Authoring Practices](https://www.w3.org/TR/wai-aria-practices/#tabpanel), require `role="tablist"`, `role="tab"`, `role="tabpanel"`, and additional `aria-` attributes in order to convey their structure, functionality and current state to users of assistive technologies (such as screen readers).
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
To help fit your needs, this works with `<ul>`-based markup, as shown above, or with any arbitrary "roll your own" markup. Note that if you're using `<nav>`, you shouldn't add `role="tablist"` directly to it, as this would override the element's native role as a navigation landmark. Instead, switch to an alternative element (in the example below, a simple `<div>`) and wrap the `<nav>` around it.
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Home</a>
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">...</div>
<div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
The tabs plugin also works with pills.
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-home-tab" data-toggle="pill" href="#pills-home" role="tab" aria-controls="pills-home" aria-selected="true">Home</a>
<div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">...</div>
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
And with vertical pills.
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="row">
<div class="col-3">
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
</div>
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Using data attributes
You can activate a tab or pill navigation without writing any JavaScript by simply specifying `data-toggle="tab"` or `data-toggle="pill"` on an element. Use these data attributes on `.nav-tabs` or `.nav-pills`.
-{% highlight html %}
+{{< highlight html >}}
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<div class="tab-pane" id="messages" role="tabpanel" aria-labelledby="messages-tab">...</div>
<div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="settings-tab">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Via JavaScript
Enable tabbable tabs via JavaScript (each tab needs to be activated individually):
-{% highlight js %}
+{{< highlight js >}}
$('#myTab a').on('click', function (e) {
e.preventDefault()
$(this).tab('show')
})
-{% endhighlight %}
+{{< /highlight >}}
You can activate individual tabs in several ways:
-{% highlight js %}
+{{< highlight js >}}
$('#myTab a[href="#profile"]').tab('show') // Select tab by name
$('#myTab li:first-child a').tab('show') // Select first tab
$('#myTab li:last-child a').tab('show') // Select last tab
$('#myTab li:nth-child(3) a').tab('show') // Select third tab
-{% endhighlight %}
+{{< /highlight >}}
### Fade effect
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-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
<div class="tab-pane fade" id="messages" role="tabpanel" aria-labelledby="messages-tab">...</div>
<div class="tab-pane fade" id="settings" role="tabpanel" aria-labelledby="settings-tab">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Methods
-{% include callout-danger-async-methods.md %}
+{{< callout danger >}}
+{{< partial "callout-danger-async-methods.md" >}}
+{{< /callout >}}
#### $().tab
Activates a tab element and content container. Tab should have either a `data-target` or an `href` targeting a container node in the DOM.
-{% highlight html %}
+{{< highlight html >}}
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a>
$('#myTab li:last-child a').tab('show')
})
</script>
-{% endhighlight %}
+{{< /highlight >}}
#### .tab('show')
Selects the given tab and shows its associated pane. Any other tab that was previously selected becomes unselected and its associated pane is hidden. **Returns to the caller before the tab pane has actually been shown** (i.e. before the `shown.bs.tab` event occurs).
-{% highlight js %}
+{{< highlight js >}}
$('#someTab').tab('show')
-{% endhighlight %}
+{{< /highlight >}}
#### .tab('dispose')
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
e.target // newly activated tab
e.relatedTarget // previous active tab
})
-{% endhighlight %}
+{{< /highlight >}}
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"`.
-{% capture example %}
+{{< example >}}
<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="#">Next</a></li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## 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.
-{% capture example %}
+{{< example >}}
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item">
</li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Disabled and active states
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.
-{% capture example %}
+{{< example >}}
<nav aria-label="...">
<ul class="pagination">
<li class="page-item disabled">
</li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
You can optionally swap out active or disabled anchors for `<span>`, or omit the anchor in the case of the prev/next arrows, to remove click functionality and prevent keyboard focus while retaining intended styles.
-{% capture example %}
+{{< example >}}
<nav aria-label="...">
<ul class="pagination">
<li class="page-item disabled">
</li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Sizing
Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for additional sizes.
-{% capture example %}
+{{< example >}}
<nav aria-label="...">
<ul class="pagination pagination-lg">
<li class="page-item active" aria-current="page">
<li class="page-item"><a class="page-link" href="#">3</a></li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<nav aria-label="...">
<ul class="pagination pagination-sm">
<li class="page-item active" aria-current="page">
<li class="page-item"><a class="page-link" href="#">3</a></li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Alignment
-Change the alignment of pagination components with [flexbox utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/).
+Change the alignment of pagination components with [flexbox utilities](/docs/{{< param docs_version >}}/utilities/flex/).
-{% capture example %}
+{{< example >}}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item disabled">
</li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item disabled">
</li>
</ul>
</nav>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Things to know when using the popover plugin:
-- Popovers rely on the 3rd party library [Popper.js](https://popper.js.org/) for positioning. You must include [popper.min.js]({{ site.cdn.popper }}) before bootstrap.js or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js in order for popovers to work!
-- Popovers require the [tooltip plugin]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/tooltips/) as a dependency.
-- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+- Popovers rely on the 3rd party library [Popper.js](https://popper.js.org/) for positioning. You must include [popper.min.js]({{< param "cdn.popper" >}}) before bootstrap.js or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js in order for popovers to work!
+- Popovers require the [tooltip plugin](/docs/{{< param docs_version >}}/components/tooltips/) as a dependency.
+- If you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util).
- Popovers are opt-in for performance reasons, so **you must initialize them yourself**.
- 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).
- Popovers must be hidden before their corresponding elements have been removed from the DOM.
- Popovers can be triggered thanks to an element inside a shadow DOM.
-{% include callout-info-prefersreducedmotion.md %}
+{{< callout info >}}
+{{< partial "callout-info-prefersreducedmotion.md" >}}
+{{< /callout >}}
Keep reading to see how popovers work with some examples.
One way to initialize all popovers on a page would be to select them by their `data-toggle` attribute:
-{% highlight js %}
+{{< highlight js >}}
$(function () {
$('[data-toggle="popover"]').popover()
})
-{% endhighlight %}
+{{< /highlight >}}
## Example: Using the `container` option
When you have some styles on a parent element that interfere with a popover, you'll want to specify a custom `container` so that the popover's HTML appears within that element instead.
-{% highlight js %}
+{{< highlight js >}}
$(function () {
$('.example-popover').popover({
container: 'body'
})
})
-{% endhighlight %}
+{{< /highlight >}}
## Example
-{% capture example %}
+{{< example >}}
<button type="button" class="btn btn-lg btn-danger" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Four directions
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on top
</button>
<button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on left
</button>
-{% endhighlight %}
+{{< /highlight >}}
### Dismiss on next click
Use the `focus` trigger to dismiss popovers on the user's next click of a different element than the toggle element.
-{% capture callout %}
+{{< callout danger >}}
#### 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.
-{% endcapture %}
-{% include callout.html content=callout type="danger" %}
+{{< /callout >}}
-{% capture example %}
+{{< example >}}
<a tabindex="0" class="btn btn-lg btn-danger" role="button" data-toggle="popover" data-trigger="focus" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% highlight js %}
+{{< highlight js >}}
$('.popover-dismiss').popover({
trigger: 'focus'
})
-{% endhighlight %}
+{{< /highlight >}}
### Disabled elements
For disabled popover triggers, you may also prefer `data-trigger="hover"` so that the popover appears as immediate visual feedback to your users as they may not expect to _click_ on a disabled element.
-{% capture example %}
+{{< example >}}
<span class="d-inline-block" data-toggle="popover" data-content="Disabled popover">
<button class="btn btn-primary" style="pointer-events: none;" type="button" disabled>Disabled button</button>
</span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Usage
Enable popovers via JavaScript:
-{% highlight js %}$('#example').popover(options){% endhighlight %}
+{{< highlight js >}}$('#example').popover(options){{< /highlight >}}
### Options
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-animation=""`.
-{% capture callout %}
+{{< callout warning >}}
Note that for security reasons the `sanitize`, `sanitizeFn` and `whiteList` options cannot be supplied using data attributes.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
<table class="table table-bordered table-striped">
<thead>
<td>selector</td>
<td>string | 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="{{ site.repo }}/issues/4215">this</a> and <a href="https://codepen.io/Johann-S/pen/djJYPb">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="{{< param repo >}}/issues/4215">this</a> and <a href="https://codepen.io/Johann-S/pen/djJYPb">an informative example</a>.</td>
</tr>
<tr>
<td>template</td>
<tr>
<td>whiteList</td>
<td>object</td>
- <td><a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#sanitizer">Default value</a></td>
+ <td><a href="/docs/{{< param docs_version >}}/getting-started/javascript/#sanitizer">Default value</a></td>
<td>Object which contains allowed attributes and tags</td>
</tr>
<tr>
</tbody>
</table>
-{% capture callout %}
+{{< callout info >}}
#### Data attributes for individual popovers
Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
### Methods
-{% include callout-danger-async-methods.md %}
+{{< callout danger >}}
+{{< partial "callout-danger-async-methods.md" >}}
+{{< /callout >}}
#### `$().popover(options)`
Reveals an element's popover. **Returns to the caller before the popover has actually been shown** (i.e. before the `shown.bs.popover` event occurs). This is considered a "manual" triggering of the popover. Popovers whose both title and content are zero-length are never displayed.
-{% highlight js %}$('#element').popover('show'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('show'){{< /highlight >}}
#### `.popover('hide')`
Hides an element's popover. **Returns to the caller before the popover has actually been hidden** (i.e. before the `hidden.bs.popover` event occurs). This is considered a "manual" triggering of the popover.
-{% highlight js %}$('#element').popover('hide'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('hide'){{< /highlight >}}
#### `.popover('toggle')`
Toggles an element's popover. **Returns to the caller before the popover has actually been shown or hidden** (i.e. before the `shown.bs.popover` or `hidden.bs.popover` event occurs). This is considered a "manual" triggering of the popover.
-{% highlight js %}$('#element').popover('toggle'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('toggle'){{< /highlight >}}
#### `.popover('dispose')`
Hides and destroys an element's popover. Popovers that use delegation (which are created using [the `selector` option](#options)) cannot be individually destroyed on descendant trigger elements.
-{% highlight js %}$('#element').popover('dispose'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('dispose'){{< /highlight >}}
#### `.popover('enable')`
Gives an element's popover the ability to be shown. **Popovers are enabled by default.**
-{% highlight js %}$('#element').popover('enable'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('enable'){{< /highlight >}}
#### `.popover('disable')`
Removes the ability for an element's popover to be shown. The popover will only be able to be shown if it is re-enabled.
-{% highlight js %}$('#element').popover('disable'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('disable'){{< /highlight >}}
#### `.popover('toggleEnabled')`
Toggles the ability for an element's popover to be shown or hidden.
-{% highlight js %}$('#element').popover('toggleEnabled'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('toggleEnabled'){{< /highlight >}}
#### `.popover('update')`
Updates the position of an element's popover.
-{% highlight js %}$('#element').popover('update'){% endhighlight %}
+{{< highlight js >}}$('#element').popover('update'){{< /highlight >}}
### Events
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('#myPopover').on('hidden.bs.popover', function () {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
Put that all together, and you have the following examples.
-{% capture example %}
+{{< example >}}
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-Bootstrap provides a handful of [utilities for setting width]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/sizing/). Depending on your needs, these may help with quickly configuring progress.
+Bootstrap provides a handful of [utilities for setting width](/docs/{{< param docs_version >}}/utilities/sizing/). Depending on your needs, these may help with quickly configuring progress.
-{% capture example %}
+{{< example >}}
<div class="progress">
<div class="progress-bar w-75" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Labels
Add labels to your progress bars by placing text within the `.progress-bar`.
-{% capture example %}
+{{< example >}}
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">25%</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Height
We only set a `height` value on the `.progress`, so if you change that value the inner `.progress-bar` will automatically resize accordingly.
-{% capture example %}
+{{< example >}}
<div class="progress" style="height: 1px;">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress" style="height: 20px;">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Backgrounds
Use background utility classes to change the appearance of individual progress bars.
-{% capture example %}
+{{< example >}}
<div class="progress">
<div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar bg-danger" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Multiple bars
Include multiple progress bars in a progress component if you need.
-{% capture example %}
+{{< example >}}
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 15%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar bg-success" role="progressbar" style="width: 30%" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar bg-info" role="progressbar" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Striped
Add `.progress-bar-striped` to any `.progress-bar` to apply a stripe via CSS gradient over the progress bar's background color.
-{% capture example %}
+{{< example >}}
<div class="progress">
<div class="progress-bar progress-bar-striped" role="progressbar" style="width: 10%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped bg-danger" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Animated stripes
</button>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
Scrollspy has a few requirements to function properly:
-- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
-- It must be used on a Bootstrap [nav component]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/navs/) or [list group]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/list-group/).
+- If you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util).
+- It must be used on a Bootstrap [nav component](/docs/{{< param docs_version >}}/components/navs/) or [list group](/docs/{{< param docs_version >}}/components/list-group/).
- Scrollspy requires `position: relative;` on the element you're spying on, usually the `<body>`.
- When spying on elements other than the `<body>`, be sure to have a `height` set and `overflow-y: scroll;` applied.
- Anchors (`<a>`) are required and must point to an element with that `id`.
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<nav id="navbar-example2" class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<ul class="nav nav-pills">
<h4 id="three">three</h4>
<p>...</p>
</div>
-{% endhighlight %}
+{{< /highlight >}}
## Example with nested nav
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<nav id="navbar-example3" class="navbar navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<nav class="nav nav-pills flex-column">
<h5 id="item-3-2">Item 3-2</h5>
<p>...</p>
</div>
-{% endhighlight %}
+{{< /highlight >}}
## Example with list-group
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div id="list-example" class="list-group">
<a class="list-group-item list-group-item-action" href="#list-item-1">Item 1</a>
<a class="list-group-item list-group-item-action" href="#list-item-2">Item 2</a>
<h4 id="list-item-4">Item 4</h4>
<p>...</p>
</div>
-{% endhighlight %}
+{{< /highlight >}}
## Usage
To easily add scrollspy behavior to your topbar navigation, add `data-spy="scroll"` to the element you want to spy on (most typically this would be the `<body>`). Then add the `data-target` attribute with the ID or class of the parent element of any Bootstrap `.nav` component.
-{% highlight css %}
+{{< highlight css >}}
body {
position: relative;
}
-{% endhighlight %}
+{{< /highlight >}}
-{% highlight html %}
+{{< highlight html >}}
<body data-spy="scroll" data-target="#navbar-example">
...
<div id="navbar-example">
</div>
...
</body>
-{% endhighlight %}
+{{< /highlight >}}
### Via JavaScript
After adding `position: relative;` in your CSS, call the scrollspy via JavaScript:
-{% highlight js %}
+{{< highlight js >}}
$('body').scrollspy({ target: '#navbar-example' })
-{% endhighlight %}
+{{< /highlight >}}
-{% capture callout %}
+{{< callout danger >}}
#### Resolvable ID targets required
Navbar links must have resolvable id targets. For example, a `<a href="#home">home</a>` must correspond to something in the DOM like `<div id="home"></div>`.
-{% endcapture %}
-{% include callout.html content=callout type="danger" %}
+{{< /callout >}}
-{% capture callout %}
+{{< callout info >}}
#### Non-visible target elements ignored
Target elements that are not visible will be ignored and their corresponding nav items will never be highlighted.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
### Methods
When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:
-{% highlight js %}
+{{< highlight js >}}
$('[data-spy="scroll"]').each(function () {
var $spy = $(this).scrollspy('refresh')
})
-{% endhighlight %}
+{{< /highlight >}}
#### `.scrollspy('dispose')`
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('[data-spy="scroll"]').on('activate.bs.scrollspy', function () {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
Use the border spinners for a lightweight loading indicator.
-{% capture example %}
+{{< example >}}
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Colors
The border spinner uses `currentColor` for its `border-color`, meaning you can customize the color with [text color utilities][color]. You can use any of our text color utilities on the standard spinner.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<div class="spinner-border text-{{ color.name }}" role="status">
+{{< example >}}
+{{< spinner.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<div class="spinner-border text-{{ .name }}" role="status">
<span class="sr-only">Loading...</span>
-</div>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+</div>
+{{- end -}}
+{{< /spinner.inline >}}
+{{< /example >}}
-{% capture callout %}
+{{< callout info >}}
**Why not use `border-color` utilities?** Each border spinner specifies a `transparent` border for at least one side, so `.border-{color}` utilities would override that.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
## Growing spinner
If you don't fancy a border spinner, switch to the grow spinner. While it doesn't technically spin, it does repeatedly grow!
-{% capture example %}
+{{< example >}}
<div class="spinner-grow" role="status">
<span class="sr-only">Loading...</span>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Once again, this spinner is built with `currentColor`, so you can easily change its appearance with [text color utilities][color]. Here it is in blue, along with the supported variants.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<div class="spinner-grow text-{{ color.name }}" role="status">
+{{< example >}}
+{{< spinner.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<div class="spinner-grow text-{{ .name }}" role="status">
<span class="sr-only">Loading...</span>
-</div>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+</div>
+{{- end -}}
+{{< /spinner.inline >}}
+{{< /example >}}
## Alignment
Use [margin utilities][margin] like `.m-5` for easy spacing.
-{% capture example %}
+{{< example >}}
<div class="spinner-border m-5" role="status">
<span class="sr-only">Loading...</span>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Placement
#### Flex
-{% capture example %}
+{{< example >}}
<div class="d-flex justify-content-center">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="d-flex align-items-center">
<strong>Loading...</strong>
<div class="spinner-border ml-auto" role="status" aria-hidden="true"></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Floats
-{% capture example %}
+{{< example >}}
<div class="clearfix">
<div class="spinner-border float-right" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
#### Text align
-{% capture example %}
+{{< example >}}
<div class="text-center">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Size
Add `.spinner-border-sm` and `.spinner-grow-sm` to make a smaller spinner that can quickly be used within other components.
-{% capture example %}
+{{< example >}}
<div class="spinner-border spinner-border-sm" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow spinner-grow-sm" role="status">
<span class="sr-only">Loading...</span>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Or, use custom CSS or inline styles to change the dimensions as needed.
-{% capture example %}
+{{< example >}}
<div class="spinner-border" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Buttons
Use spinners within buttons to indicate an action is currently processing or taking place. You may also swap the text out of the spinner element and utilize button text as needed.
-{% capture example %}
+{{< example >}}
<button class="btn btn-primary" type="button" disabled>
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span class="sr-only">Loading...</span>
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Loading...
</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<button class="btn btn-primary" type="button" disabled>
<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
<span class="sr-only">Loading...</span>
<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
Loading...
</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-[color]: {{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/
-[display]: {{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/
-[flex]: {{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/
-[float]: {{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/float/
-[margin]: {{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/
-[sizing]: {{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/sizing/
-[text]: {{ site.baseurl }}/docs/{{ site.docs_version }}/content/typography/
+[color]: /docs/{{< param docs_version >}}/utilities/colors/
+[display]: /docs/{{< param docs_version >}}/utilities/display/
+[flex]: /docs/{{< param docs_version >}}/utilities/flex/
+[float]: /docs/{{< param docs_version >}}/utilities/float/
+[margin]: /docs/{{< param docs_version >}}/utilities/spacing/
+[sizing]: /docs/{{< param docs_version >}}/utilities/sizing/
+[text]: /docs/{{< param docs_version >}}/content/typography/
Things to know when using the toast plugin:
-- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+- If you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util).
- Toasts are opt-in for performance reasons, so **you must initialize them yourself**.
- **Please note that you are responsible for positioning toasts.**
- Toasts will automatically hide if you do not specify `autohide: false`.
Toasts are as flexible as you need and have very little required markup. At a minimum, we require a single element to contain your "toasted" content and strongly encourage a dismiss button.
-{% capture example %}
+{{< example class="bg-light" >}}
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
Hello, world! This is a toast message.
</div>
</div>
-{% endcapture %}
-{% include example.html content=example class="bg-light" %}
+{{< /example >}}
### Translucent
Toasts are slightly translucent, too, so they blend over whatever they might appear over. For browsers that support the `backdrop-filter` CSS property, we'll also attempt to blur the elements under a toast.
-{% capture example %}
+{{< example class="bg-dark" >}}
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small class="text-muted">11 mins ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
Hello, world! This is a toast message.
</div>
</div>
-{% endcapture %}
-{% include example.html content=example class="bg-dark" %}
+{{< /example >}}
### Stacking
When you have multiple toasts, we default to vertically stacking them in a readable manner.
-{% capture example %}
+{{< example class="bg-light" >}}
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small class="text-muted">just now</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small class="text-muted">2 seconds ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
Heads up, toasts will stack automatically
</div>
</div>
-{% endcapture %}
-{% include example.html content=example class="bg-light" %}
+{{< /example >}}
## Placement
Place toasts with custom CSS as you need them. The top right is often used for notifications, as is the top middle. If you're only ever going to show one toast at a time, put the positioning styles right on the `.toast`.
-{% capture example %}
+{{< example class="bg-dark" >}}
<div aria-live="polite" aria-atomic="true" style="position: relative; min-height: 200px;">
<div class="toast" style="position: absolute; top: 0; right: 0;">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example class="bg-dark" %}
+{{< /example >}}
For systems that generate more notifications, consider using a wrapping element so they can easily stack.
-{% capture example %}
+{{< example class="bg-dark" >}}
<div aria-live="polite" aria-atomic="true" style="position: relative; min-height: 200px;">
<!-- Position it -->
<div style="position: absolute; top: 0; right: 0;">
<!-- Then put toasts within -->
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small class="text-muted">just now</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small class="text-muted">2 seconds ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example class="bg-dark" %}
+{{< /example >}}
You can also get fancy with flexbox utilities to align toasts horizontally and/or vertically.
-{% capture example %}
+{{< example class="bg-dark" >}}
<!-- Flexbox container for aligning the toasts -->
<div aria-live="polite" aria-atomic="true" class="d-flex justify-content-center align-items-center" style="min-height: 200px;">
<!-- Then put toasts within -->
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example class="bg-dark" %}
+{{< /example >}}
## Accessibility
-Toasts are intended to be small interruptions to your visitors or users, so to help those with screen readers and similar assistive technologies, you should wrap your toasts in an [`aria-live` region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions). Changes to live regions (such as injecting/updating a toast component) are automatically announced by screen readers without needing to move the user's focus or otherwise interrupt the user. Additionally, include `aria-atomic="true"` to ensure that the entire toast is always announced as a single (atomic) unit, rather than announcing what was changed (which could lead to problems if you only update part of the toast's content, or if displaying the same toast content at a later point in time). If the information needed is important for the process, e.g. for a list of errors in a form, then use the [alert component]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/alerts/) instead of toast.
+Toasts are intended to be small interruptions to your visitors or users, so to help those with screen readers and similar assistive technologies, you should wrap your toasts in an [`aria-live` region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions). Changes to live regions (such as injecting/updating a toast component) are automatically announced by screen readers without needing to move the user's focus or otherwise interrupt the user. Additionally, include `aria-atomic="true"` to ensure that the entire toast is always announced as a single (atomic) unit, rather than announcing what was changed (which could lead to problems if you only update part of the toast's content, or if displaying the same toast content at a later point in time). If the information needed is important for the process, e.g. for a list of errors in a form, then use the [alert component](/docs/{{< param docs_version >}}/components/alerts/) instead of toast.
Note that the live region needs to be present in the markup *before* the toast is generated or updated. If you dynamically generate both at the same time and inject them into the page, they will generally not be announced by assistive technologies.
As the content you're displaying changes, be sure to update the [`delay` timeout](#options) to ensure people have enough time to read the toast.
-{% highlight html %}
+{{< highlight html >}}
<div class="toast" role="alert" aria-live="polite" aria-atomic="true" data-delay="10000">
<div role="alert" aria-live="assertive" aria-atomic="true">...</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
When using `autohide: false`, you must add a close button to allow users to dismiss the toast.
-{% capture example %}
+{{< example class="bg-light" >}}
<div role="alert" aria-live="assertive" aria-atomic="true" class="toast" data-autohide="false">
<div class="toast-header">
- {% include icons/placeholder.svg width="20" height="20" background="#007aff" class="rounded mr-2" text=" " title=" " %}
+ {{< placeholder width="20" height="20" background="#007aff" class="rounded mr-2" text="false" title="false" >}}
<strong class="mr-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
Hello, world! This is a toast message.
</div>
</div>
-{% endcapture %}
-{% include example.html content=example class="bg-light" %}
+{{< /example >}}
## JavaScript behavior
Initialize toasts via JavaScript:
-{% highlight js %}
+{{< highlight js >}}
$('.toast').toast(option)
-{% endhighlight %}
+{{< /highlight >}}
### Options
### Methods
-{% include callout-danger-async-methods.md %}
+{{< callout danger >}}
+{{< partial "callout-danger-async-methods.md" >}}
+{{< /callout >}}
#### `$().toast(options)`
Reveals an element's toast. **Returns to the caller before the toast has actually been shown** (i.e. before the `shown.bs.toast` event occurs).
You have to manually call this method, instead your toast won't show.
-{% highlight js %}$('#element').toast('show'){% endhighlight %}
+{{< highlight js >}}$('#element').toast('show'){{< /highlight >}}
#### `.toast('hide')`
Hides an element's toast. **Returns to the caller before the toast has actually been hidden** (i.e. before the `hidden.bs.toast` event occurs). You have to manually call this method if you made `autohide` to `false`.
-{% highlight js %}$('#element').toast('hide'){% endhighlight %}
+{{< highlight js >}}$('#element').toast('hide'){{< /highlight >}}
#### `.toast('dispose')`
Hides an element's toast. Your toast will remain on the DOM but won't show anymore.
-{% highlight js %}$('#element').toast('dispose'){% endhighlight %}
+{{< highlight js >}}$('#element').toast('dispose'){{< /highlight >}}
### Events
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('#myToast').on('hidden.bs.toast', function () {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
Things to know when using the tooltip plugin:
-- Tooltips rely on the 3rd party library [Popper.js](https://popper.js.org/) for positioning. You must include [popper.min.js]({{ site.cdn.popper }}) before bootstrap.js or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js in order for tooltips to work!
-- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+- Tooltips rely on the 3rd party library [Popper.js](https://popper.js.org/) for positioning. You must include [popper.min.js]({{< param "cdn.popper" >}}) before bootstrap.js or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js in order for tooltips to work!
+- If you're building our JavaScript from source, it [requires `util.js`](/docs/{{< param docs_version >}}/getting-started/javascript/#util).
- Tooltips are opt-in for performance reasons, so **you must initialize them yourself**.
- 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).
- Tooltips must be hidden before their corresponding elements have been removed from the DOM.
- Tooltips can be triggered thanks to an element inside a shadow DOM.
-{% include callout-info-prefersreducedmotion.md %}
+{{< callout info >}}
+{{< partial "callout-info-prefersreducedmotion.md" >}}
+{{< /callout >}}
Got all that? Great, let's see how they work with some examples.
One way to initialize all tooltips on a page would be to select them by their `data-toggle` attribute:
-{% highlight js %}
+{{< highlight js >}}
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
-{% endhighlight %}
+{{< /highlight >}}
## Examples
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top">
Tooltip on top
</button>
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="left" title="Tooltip on left">
Tooltip on left
</button>
-{% endhighlight %}
+{{< /highlight >}}
And with custom HTML added:
-{% highlight html %}
+{{< 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 %}
+{{< /highlight >}}
## Usage
Trigger the tooltip via JavaScript:
-{% highlight js %}
+{{< highlight js >}}
$('#example').tooltip(options)
-{% endhighlight %}
+{{< /highlight >}}
-{% capture callout %}
+{{< callout warning >}}
##### Overflow `auto` and `scroll`
Tooltip position attempts to automatically change when a parent container has `overflow: auto` or `overflow: scroll` like our `.table-responsive`, but still keeps the original placement's positioning. To resolve, set the `boundary` option to anything other than default value, `'scrollParent'`, such as `'window'`:
-{% highlight js %}
+{{< highlight js >}}
$('#example').tooltip({ boundary: 'window' })
-{% endhighlight %}
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /highlight >}}
+{{< /callout >}}
### Markup
The required markup for a tooltip is only a `data` attribute and `title` on the HTML element you wish to have a tooltip. The generated markup of a tooltip is rather simple, though it does require a position (by default, set to `top` by the plugin).
-{% capture callout %}
+{{< callout warning >}}
##### Making tooltips work for keyboard and assistive technology users
You should only add tooltips to HTML elements that are traditionally keyboard-focusable and interactive (such as links or form controls). Although arbitrary HTML elements (such as `<span>`s) can be made focusable by adding the `tabindex="0"` attribute, this will add potentially annoying and confusing tab stops on non-interactive elements for keyboard users. In addition, most assistive technologies currently do not announce the tooltip in this situation.
Additionally, do not rely solely on `hover` as the trigger for your tooltip, as this will make your tooltips impossible to trigger for keyboard users.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
-{% highlight html %}
+{{< highlight html >}}
<!-- HTML to write -->
<a href="#" data-toggle="tooltip" title="Some tooltip text!">Hover over me</a>
Some tooltip text!
</div>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Disabled elements
Elements with the `disabled` attribute aren't interactive, meaning users cannot focus, hover, or click them to trigger a tooltip (or popover). As a workaround, you'll want to trigger the tooltip from a wrapper `<div>` or `<span>`, ideally made keyboard-focusable using `tabindex="0"`, and override the `pointer-events` on the disabled element.
<div class="tooltip-demo">
-{% capture example %}
+{{< example >}}
<span class="d-inline-block" tabindex="0" data-toggle="tooltip" title="Disabled tooltip">
<button class="btn btn-primary" style="pointer-events: none;" type="button" disabled>Disabled button</button>
</span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Options
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-animation=""`.
-{% capture callout %}
+{{< callout warning >}}
Note that for security reasons the `sanitize`, `sanitizeFn` and `whiteList` options cannot be supplied using data attributes.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
<table class="table table-bordered table-striped">
<thead>
<td>selector</td>
<td>string | false</td>
<td>false</td>
- <td>If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to also apply tooltips to dynamically added DOM elements (<code>jQuery.on</code> support). See <a href="{{ site.repo }}/issues/4215">this</a> and <a href="https://codepen.io/Johann-S/pen/djJYPb">an informative example</a>.</td>
+ <td>If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to also apply tooltips to dynamically added DOM elements (<code>jQuery.on</code> support). See <a href="{{< param repo >}}/issues/4215">this</a> and <a href="https://codepen.io/Johann-S/pen/djJYPb">an informative example</a>.</td>
</tr>
<tr>
<td>template</td>
<tr>
<td>whiteList</td>
<td>object</td>
- <td><a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#sanitizer">Default value</a></td>
+ <td><a href="/docs/{{< param docs_version >}}/getting-started/javascript/#sanitizer">Default value</a></td>
<td>Object which contains allowed attributes and tags</td>
</tr>
<tr>
</tbody>
</table>
-{% capture callout %}
+{{< callout info >}}
#### Data attributes for individual tooltips
Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
### Methods
-{% include callout-danger-async-methods.md %}
+{{< callout danger >}}
+{{< partial "callout-danger-async-methods.md" >}}
+{{< /callout >}}
#### `$().tooltip(options)`
Reveals an element's tooltip. **Returns to the caller before the tooltip has actually been shown** (i.e. before the `shown.bs.tooltip` event occurs). This is considered a "manual" triggering of the tooltip. Tooltips with zero-length titles are never displayed.
-{% highlight js %}$('#element').tooltip('show'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('show'){{< /highlight >}}
#### `.tooltip('hide')`
Hides an element's tooltip. **Returns to the caller before the tooltip has actually been hidden** (i.e. before the `hidden.bs.tooltip` event occurs). This is considered a "manual" triggering of the tooltip.
-{% highlight js %}$('#element').tooltip('hide'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('hide'){{< /highlight >}}
#### `.tooltip('toggle')`
Toggles an element's tooltip. **Returns to the caller before the tooltip has actually been shown or hidden** (i.e. before the `shown.bs.tooltip` or `hidden.bs.tooltip` event occurs). This is considered a "manual" triggering of the tooltip.
-{% highlight js %}$('#element').tooltip('toggle'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('toggle'){{< /highlight >}}
#### `.tooltip('dispose')`
Hides and destroys an element's tooltip. Tooltips that use delegation (which are created using [the `selector` option](#options)) cannot be individually destroyed on descendant trigger elements.
-{% highlight js %}$('#element').tooltip('dispose'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('dispose'){{< /highlight >}}
#### `.tooltip('enable')`
Gives an element's tooltip the ability to be shown. **Tooltips are enabled by default.**
-{% highlight js %}$('#element').tooltip('enable'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('enable'){{< /highlight >}}
#### `.tooltip('disable')`
Removes the ability for an element's tooltip to be shown. The tooltip will only be able to be shown if it is re-enabled.
-{% highlight js %}$('#element').tooltip('disable'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('disable'){{< /highlight >}}
#### `.tooltip('toggleEnabled')`
Toggles the ability for an element's tooltip to be shown or hidden.
-{% highlight js %}$('#element').tooltip('toggleEnabled'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('toggleEnabled'){{< /highlight >}}
#### `.tooltip('update')`
Updates the position of an element's tooltip.
-{% highlight js %}$('#element').tooltip('update'){% endhighlight %}
+{{< highlight js >}}$('#element').tooltip('update'){{< /highlight >}}
### Events
</tbody>
</table>
-{% highlight js %}
+{{< highlight js >}}
$('#myTooltip').on('hidden.bs.tooltip', function () {
// do something...
})
-{% endhighlight %}
+{{< /highlight >}}
Wrap inline snippets of code with `<code>`. Be sure to escape HTML angle brackets.
-{% capture example %}
+{{< example >}}
For example, <code><section></code> should be wrapped as inline.
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Code blocks
Use `<pre>`s for multiple lines of code. Once again, be sure to escape any angle brackets in the code for proper rendering. You may optionally add the `.pre-scrollable` class, which will set a max-height of 340px and provide a y-axis scrollbar.
-{% capture example %}
+{{< example >}}
<pre><code><p>Sample text here...</p>
<p>And another line of sample text here...</p>
</code></pre>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Variables
For indicating variables use the `<var>` tag.
-{% capture example %}
+{{< example >}}
<var>y</var> = <var>m</var><var>x</var> + <var>b</var>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## User input
Use the `<kbd>` to indicate input that is typically entered via keyboard.
-{% capture example %}
+{{< example >}}
To switch directories, type <kbd>cd</kbd> followed by the name of the directory.<br>
To edit settings, press <kbd><kbd>ctrl</kbd> + <kbd>,</kbd></kbd>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Sample output
For indicating sample output from a program use the `<samp>` tag.
-{% capture example %}
+{{< example >}}
<samp>This text is meant to be treated as sample output from a computer program.</samp>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
--- /dev/null
+---
+layout: docs
+title: Figures
+description: Documentation and examples for displaying related images and text with the figure component in Bootstrap.
+group: content
+---
+
+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.
+
+{{< example >}}
+<figure class="figure">
+ {{< placeholder width="400" height="300" class="figure-img img-fluid rounded" >}}
+ <figcaption class="figure-caption">A caption for the above image.</figcaption>
+</figure>
+{{< /example >}}
+
+Aligning the figure's caption is easy with our [text utilities](/docs/{{< param docs_version >}}/utilities/text/#text-alignment).
+
+{{< example >}}
+<figure class="figure">
+ {{< placeholder width="400" height="300" class="figure-img img-fluid rounded" >}}
+ <figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
+</figure>
+{{< /example >}}
--- /dev/null
+---
+layout: docs
+title: Images
+description: Documentation and examples for opting images into responsive behavior (so they never become larger than their parent elements) and add lightweight styles to them—all via classes.
+group: content
+toc: true
+---
+
+## Responsive images
+
+Images in Bootstrap are made responsive with `.img-fluid`. `max-width: 100%;` and `height: auto;` are applied to the image so that it scales with the parent element.
+
+<div class="bd-example">
+ {{< placeholder width="100%" height="250" class="bd-placeholder-img-lg img-fluid" text="Responsive image" >}}
+</div>
+
+{{< highlight html >}}
+<img src="..." class="img-fluid" alt="Responsive image">
+{{< /highlight >}}
+
+## Image thumbnails
+
+In addition to our [border-radius utilities](/docs/{{< param docs_version >}}/utilities/borders/), you can use `.img-thumbnail` to give an image a rounded 1px border appearance.
+
+<div class="bd-example bd-example-images">
+ {{< placeholder width="200" height="200" class="img-thumbnail" title="A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera" >}}
+</div>
+
+{{< highlight html >}}
+<img src="..." alt="..." class="img-thumbnail">
+{{< /highlight >}}
+
+## Aligning images
+
+Align images with the [helper float classes](/docs/{{< param docs_version >}}/utilities/float/) or [text alignment classes](/docs/{{< param docs_version >}}/utilities/text/#text-alignment). `block`-level images can be centered using [the `.mx-auto` margin utility class](/docs/{{< param docs_version >}}/utilities/spacing/#horizontal-centering).
+
+<div class="bd-example bd-example-images">
+ {{< placeholder width="200" height="200" class="rounded float-left" >}}
+ {{< placeholder width="200" height="200" class="rounded float-right" >}}
+</div>
+
+{{< highlight html >}}
+<img src="..." class="rounded float-left" alt="...">
+<img src="..." class="rounded float-right" alt="...">
+{{< /highlight >}}
+
+<div class="bd-example bd-example-images">
+ {{< placeholder width="200" height="200" class="rounded mx-auto d-block" >}}
+</div>
+
+{{< highlight html >}}
+<img src="..." class="rounded mx-auto d-block" alt="...">
+{{< /highlight >}}
+
+<div class="bd-example bd-example-images">
+ <div class="text-center">
+ {{< placeholder width="200" height="200" class="rounded" >}}
+ </div>
+</div>
+
+{{< highlight html >}}
+<div class="text-center">
+ <img src="..." class="rounded" alt="...">
+</div>
+{{< /highlight >}}
+
+
+## Picture
+
+If you are using the `<picture>` element to specify multiple `<source>` elements for a specific `<img>`, make sure to add the `.img-*` classes to the `<img>` and not to the `<picture>` tag.
+
+{{< highlight html >}}
+<picture>
+ <source srcset="..." type="image/svg+xml">
+ <img src="..." class="img-fluid img-thumbnail" alt="...">
+</picture>
+{{< /highlight >}}
title: Reboot
description: Reboot, a collection of element-specific CSS changes in a single file, kickstart Bootstrap to provide an elegant, consistent, and simple baseline to build upon.
group: content
-redirect_from: "/docs/4.3/content/"
+aliases: "/docs/4.3/content/"
toc: true
---
The default web fonts (Helvetica Neue, Helvetica, and Arial) have been dropped in Bootstrap 4 and replaced with a "native font stack" for optimum text rendering on every device and OS. Read more about [native font stacks in this *Smashing Magazine* article](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/).
-{% highlight sass %}
+{{< highlight scss >}}
$font-family-sans-serif:
// Safari for macOS and iOS (San Francisco)
-apple-system,
"Helvetica Neue", Arial, sans-serif,
// Emoji fonts
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
-{% endhighlight %}
+{{< /highlight >}}
This `font-family` is applied to the `<body>` and automatically inherited globally throughout Bootstrap. To switch the global `font-family`, update `$font-family-base` and recompile Bootstrap.
<tbody>
<tr>
<td>
- {{ "`<h1></h1>`" | markdownify }}
+ {{< markdown >}}`<h1></h1>`{{< /markdown >}}
</td>
<td><span class="h1">h1. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h2></h2>`" | markdownify }}
+ {{< markdown >}}`<h2></h2>`{{< /markdown >}}
</td>
<td><span class="h2">h2. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h3></h3>`" | markdownify }}
+ {{< markdown >}}`<h3></h3>`{{< /markdown >}}
</td>
<td><span class="h3">h3. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h4></h4>`" | markdownify }}
+ {{< markdown >}}`<h4></h4>`{{< /markdown >}}
</td>
<td><span class="h4">h4. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h5></h5>`" | markdownify }}
+ {{< markdown >}}`<h5></h5>`{{< /markdown >}}
</td>
<td><span class="h5">h5. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h6></h6>`" | markdownify }}
+ {{< markdown >}}`<h6></h6>`{{< /markdown >}}
</td>
<td><span class="h6">h6. Bootstrap heading</span></td>
</tr>
All lists—`<ul>`, `<ol>`, and `<dl>`—have their `margin-top` removed and a `margin-bottom: 1rem`. Nested lists have no `margin-bottom`.
<div class="bd-example">
-{% capture markdown %}
+{{< markdown >}}
* Lorem ipsum dolor sit amet
* Consectetur adipiscing elit
* Integer molestie lorem at massa
6. Faucibus porta lacus fringilla vel
7. Aenean sit amet erat nunc
8. Eget porttitor lorem
-{% endcapture %}
-{{ markdown | markdownify }}
+{{< /markdown >}}
</div>
For simpler styling, clear hierarchy, and better spacing, description lists have updated `margin`s. `<dd>`s reset `margin-left` to `0` and add `margin-bottom: .5rem`. `<dt>`s are **bolded**.
## Tables
-Tables are slightly adjusted to style `<caption>`s, collapse borders, and ensure consistent `text-align` throughout. Additional changes for borders, padding, and more come with [the `.table` class]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/tables/).
+Tables are slightly adjusted to style `<caption>`s, collapse borders, and ensure consistent `text-align` throughout. Additional changes for borders, padding, and more come with [the `.table` class](/docs/{{< param docs_version >}}/content/tables/).
<div class="bd-example">
<table>
HTML5 adds [a new global attribute named `[hidden]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden), which is styled as `display: none` by default. Borrowing an idea from [PureCSS](https://purecss.io/), we improve upon this default by making `[hidden] { display: none !important; }` to help prevent its `display` from getting accidentally overridden. While `[hidden]` isn't natively supported by IE10, the explicit declaration in our CSS gets around that problem.
-{% highlight html %}
+{{< highlight html >}}
<input type="text" hidden>
-{% endhighlight %}
+{{< /highlight >}}
-{% capture callout %}
+{{< callout warning >}}
##### jQuery incompatibility
`[hidden]` is not compatible with jQuery's `$(...).hide()` and `$(...).show()` methods. Therefore, we don't currently especially endorse `[hidden]` over other techniques for managing the `display` of elements.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
-To merely toggle the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document, use [the `.invisible` class]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/visibility/) instead.
+To merely toggle the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document, use [the `.invisible` class](/docs/{{< param docs_version >}}/utilities/visibility/) instead.
Using the most basic table markup, here's how `.table`-based tables look in Bootstrap. **All table styles are inherited in Bootstrap 4**, meaning any nested tables will be styled in the same manner as the parent.
-{% capture example %}
+{{< example >}}
<table class="table">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
You can also invert the colors—with light text on dark backgrounds—with `.table-dark`.
-{% capture example %}
+{{< example >}}
<table class="table table-dark">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Table head options
Similar to tables and dark tables, use the modifier classes `.thead-light` or `.thead-dark` to make `<thead>`s appear light or dark gray.
-{% capture example %}
+{{< example >}}
<table class="table">
<thead class="thead-dark">
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Striped rows
Use `.table-striped` to add zebra-striping to any table row within the `<tbody>`.
-{% capture example %}
+{{< example >}}
<table class="table table-striped">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<table class="table table-striped table-dark">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Bordered table
Add `.table-bordered` for borders on all sides of the table and cells.
-{% capture example %}
+{{< example >}}
<table class="table table-bordered">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<table class="table table-bordered table-dark">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Borderless table
Add `.table-borderless` for a table without borders.
-{% capture example %}
+{{< example >}}
<table class="table table-borderless">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
`.table-borderless` can also be used on dark tables.
-{% capture example %}
+{{< example >}}
<table class="table table-borderless table-dark">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Hoverable rows
Add `.table-hover` to enable a hover state on table rows within a `<tbody>`.
-{% capture example %}
+{{< example >}}
<table class="table table-hover">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<table class="table table-hover table-dark">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Small table
Add `.table-sm` to make tables more compact by cutting cell padding in half.
-{% capture example %}
+{{< example >}}
<table class="table table-sm">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<table class="table table-sm table-dark">
<thead>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Contextual classes
<td>Cell</td>
</tr>
- {% for color in site.data.theme-colors %}
- <tr class="table-{{ color.name }}">
- <th scope="row">{{ color.name | capitalize }}</th>
+ {{< table.inline >}}
+ {{- range (index $.Site.Data "theme-colors") }}
+ <tr class="table-{{ .name }}">
+ <th scope="row">{{ .name | title }}</th>
<td>Cell</td>
<td>Cell</td>
- </tr>{% endfor %}
+ </tr>
+ {{- end -}}
+ {{< /table.inline >}}
</tbody>
</table>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- On rows -->
<tr class="table-active">...</tr>
-{% for color in site.data.theme-colors %}
-<tr class="table-{{ color.name }}">...</tr>{% endfor %}
+{{< table.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<tr class="table-{{ .name }}">...</tr>
+{{- end -}}
+{{< /table.inline >}}
<!-- On cells (`td` or `th`) -->
<tr>
<td class="table-active">...</td>
- {% for color in site.data.theme-colors %}
- <td class="table-{{ color.name }}">...</td>{% endfor %}
+{{< table.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+ <td class="table-{{ .name }}">...</td>
+{{- end -}}
+{{< /table.inline >}}
</tr>
-{% endhighlight %}
+{{< /highlight >}}
-Regular table background variants are not available with the dark table, however, you may use [text or background utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/) to achieve similar styles.
+Regular table background variants are not available with the dark table, however, you may use [text or background utilities](/docs/{{< param docs_version >}}/utilities/colors/) to achieve similar styles.
<div class="bd-example">
<table class="table table-dark">
</table>
</div>
-{% highlight html %}
+{{< highlight html >}}
<!-- On rows -->
<tr class="bg-primary">...</tr>
<tr class="bg-success">...</tr>
<td class="bg-danger">...</td>
<td class="bg-info">...</td>
</tr>
-{% endhighlight %}
+{{< /highlight >}}
-{% include callout-warning-color-assistive-technologies.md %}
+{{< callout info >}}
+{{< partial "callout-warning-color-assistive-technologies.md" >}}
+{{< /callout >}}
Create responsive tables by wrapping any `.table` with `.table-responsive{-sm|-md|-lg|-xl}`, making the table scroll horizontally at each `max-width` breakpoint of up to (but not including) 576px, 768px, 992px, and 1120px, respectively.
-{% include callout-info-mediaqueries-breakpoints.md %}
+{{< callout info >}}
+{{< partial "callout-info-mediaqueries-breakpoints.md" >}}
+{{< /callout >}}
## Captions
A `<caption>` functions like a heading for a table. It helps users with screen readers to find a table and understand what it's about and decide if they want to read it.
-{% capture example %}
+{{< example >}}
<table class="table">
<caption>List of users</caption>
<thead>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Responsive tables
Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports by wrapping a `.table` with `.table-responsive`. Or, pick a maximum breakpoint with which to have a responsive table up to by using `.table-responsive{-sm|-md|-lg|-xl}`.
-{% capture callout %}
+{{< callout warning >}}
##### Vertical clipping/truncation
Responsive tables make use of `overflow-y: hidden`, which clips off any content that goes beyond the bottom or top edges of the table. In particular, this can clip off dropdown menus and other third-party widgets.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
### Always responsive
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="table-responsive">
<table class="table">
...
</table>
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Breakpoint specific
**These tables may appear broken until their responsive styles apply at specific viewport widths.**
-{% for bp in site.data.breakpoints %}{% unless bp.breakpoint == "xs" %}
+{{< tables.inline >}}
+{{ range $bp := $.Site.Data.breakpoints }}
+{{ if not (eq $bp "xs") }}
<div class="bd-example">
-<div class="table-responsive{{ bp.abbr }}">
- <table class="table">
- <thead>
- <tr>
- <th scope="col">#</th>
- <th scope="col">Heading</th>
- <th scope="col">Heading</th>
- <th scope="col">Heading</th>
- <th scope="col">Heading</th>
- <th scope="col">Heading</th>
- <th scope="col">Heading</th>
- <th scope="col">Heading</th>
- <th scope="col">Heading</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th scope="row">1</th>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- </tr>
- <tr>
- <th scope="row">2</th>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- </tr>
- <tr>
- <th scope="row">3</th>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- <td>Cell</td>
- </tr>
- </tbody>
- </table>
-</div>
+ <div class="table-responsive{{ $bp.abbr }}">
+ <table class="table">
+ <thead>
+ <tr>
+ <th scope="col">#</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row">1</th>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ </tr>
+ <tr>
+ <th scope="row">2</th>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ </tr>
+ <tr>
+ <th scope="row">3</th>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ <td>Cell</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
</div>
-{% highlight html %}
-<div class="table-responsive{{ bp.abbr }}">
+{{ end -}}
+{{- end -}}
+{{< /tables.inline >}}
+
+{{< highlight html >}}
+{{< tables.inline >}}
+{{- range $bp := $.Site.Data.breakpoints -}}
+{{- if not (eq $bp "xs") }}
+<div class="table-responsive{{ $bp.abbr }}">
<table class="table">
...
</table>
</div>
-{% endhighlight %}
-{% endunless %}{% endfor %}
+{{ end -}}
+{{- end -}}
+{{< /tables.inline >}}
+{{< /highlight >}}
## Global settings
-Bootstrap sets basic global display, typography, and link styles. When more control is needed, check out the [textual utility classes]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/text/).
+Bootstrap sets basic global display, typography, and link styles. When more control is needed, check out the [textual utility classes](/docs/{{< param docs_version >}}/utilities/text/).
-- Use a [native font stack]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/reboot/#native-font-stack) that selects the best `font-family` for each OS and device.
+- Use a [native font stack](/docs/{{< param docs_version >}}/content/reboot/#native-font-stack) that selects the best `font-family` for each OS and device.
- For a more inclusive and accessible type scale, we assume the browser default root `font-size` (typically 16px) so visitors can customize their browser defaults as needed.
- Use the `$font-family-base`, `$font-size-base`, and `$line-height-base` attributes as our typographic base applied to the `<body>`.
- Set the global link color via `$link-color` and apply link underlines only on `:hover`.
<tbody>
<tr>
<td>
- {{ "`<h1></h1>`" | markdownify }}
+ {{< markdown >}}`<h1></h1>`{{< /markdown >}}
</td>
<td><span class="h1">h1. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h2></h2>`" | markdownify }}
+ {{< markdown >}}`<h2></h2>`{{< /markdown >}}
</td>
<td><span class="h2">h2. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h3></h3>`" | markdownify }}
+ {{< markdown >}}`<h3></h3>`{{< /markdown >}}
</td>
<td><span class="h3">h3. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h4></h4>`" | markdownify }}
+ {{< markdown >}}`<h4></h4>`{{< /markdown >}}
</td>
<td><span class="h4">h4. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h5></h5>`" | markdownify }}
+ {{< markdown >}}`<h5></h5>`{{< /markdown >}}
</td>
<td><span class="h5">h5. Bootstrap heading</span></td>
</tr>
<tr>
<td>
- {{ "`<h6></h6>`" | markdownify }}
+ {{< markdown >}}`<h6></h6>`{{< /markdown >}}
</td>
<td><span class="h6">h6. Bootstrap heading</span></td>
</tr>
</tbody>
</table>
-{% highlight html %}
+{{< highlight html >}}
<h1>h1. Bootstrap heading</h1>
<h2>h2. Bootstrap heading</h2>
<h3>h3. Bootstrap heading</h3>
<h4>h4. Bootstrap heading</h4>
<h5>h5. Bootstrap heading</h5>
<h6>h6. Bootstrap heading</h6>
-{% endhighlight %}
+{{< /highlight >}}
`.h1` through `.h6` classes are also available, for when you want to match the font styling of a heading but cannot use the associated HTML element.
-{% capture example %}
+{{< example >}}
<p class="h1">h1. Bootstrap heading</p>
<p class="h2">h2. Bootstrap heading</p>
<p class="h3">h3. Bootstrap heading</p>
<p class="h4">h4. Bootstrap heading</p>
<p class="h5">h5. Bootstrap heading</p>
<p class="h6">h6. Bootstrap heading</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Customizing headings
Use the included utility classes to recreate the small secondary heading text from Bootstrap 3.
-{% capture example %}
+{{< example >}}
<h3>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h3>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Display headings
</table>
</div>
-{% highlight html %}
+{{< highlight html >}}
<h1 class="display-1">Display 1</h1>
<h1 class="display-2">Display 2</h1>
<h1 class="display-3">Display 3</h1>
<h1 class="display-4">Display 4</h1>
-{% endhighlight %}
+{{< /highlight >}}
## Lead
Make a paragraph stand out by adding `.lead`.
-{% capture example %}
+{{< example >}}
<p class="lead">
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Inline text elements
Styling for common inline HTML5 elements.
-{% capture example %}
+{{< example >}}
<p>You can use the mark tag to <mark>highlight</mark> text.</p>
<p><del>This line of text is meant to be treated as deleted text.</del></p>
<p><s>This line of text is meant to be treated as no longer accurate.</s></p>
<p><small>This line of text is meant to be treated as fine print.</small></p>
<p><strong>This line rendered as bold text.</strong></p>
<p><em>This line rendered as italicized text.</em></p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
`.mark` and `.small` classes are also available to apply the same styles as `<mark>` and `<small>` while avoiding any unwanted semantic implications that the tags would bring.
## Text utilities
-Change text alignment, transform, style, weight, and color with our [text utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/text/) and [color utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/).
+Change text alignment, transform, style, weight, and color with our [text utilities](/docs/{{< param docs_version >}}/utilities/text/) and [color utilities](/docs/{{< param docs_version >}}/utilities/colors/).
## Abbreviations
Add `.initialism` to an abbreviation for a slightly smaller font-size.
-{% capture example %}
+{{< example >}}
<p><abbr title="attribute">attr</abbr></p>
<p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr></p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Blockquotes
For quoting blocks of content from another source within your document. Wrap `<blockquote class="blockquote">` around any <abbr title="HyperText Markup Language">HTML</abbr> as the quote.
-{% capture example %}
+{{< example >}}
<blockquote class="blockquote">
<p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
</blockquote>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Naming a source
Add a `<footer class="blockquote-footer">` for identifying the source. Wrap the name of the source work in `<cite>`.
-{% capture example %}
+{{< example >}}
<blockquote class="blockquote">
<p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Alignment
Use text utilities as needed to change the alignment of your blockquote.
-{% capture example %}
+{{< example >}}
<blockquote class="blockquote text-center">
<p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<blockquote class="blockquote text-right">
<p class="mb-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Lists
Remove the default `list-style` and left margin on list items (immediate children only). **This only applies to immediate children list items**, meaning you will need to add the class for any nested lists as well.
-{% capture example %}
+{{< example >}}
<ul class="list-unstyled">
<li>Lorem ipsum dolor sit amet</li>
<li>Consectetur adipiscing elit</li>
<li>Aenean sit amet erat nunc</li>
<li>Eget porttitor lorem</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Inline
Remove a list's bullets and apply some light `margin` with a combination of two classes, `.list-inline` and `.list-inline-item`.
-{% capture example %}
+{{< example >}}
<ul class="list-inline">
<li class="list-inline-item">Lorem ipsum</li>
<li class="list-inline-item">Phasellus iaculis</li>
<li class="list-inline-item">Nulla volutpat</li>
</ul>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### Description list alignment
Align terms and descriptions horizontally by using our grid system's predefined classes (or semantic mixins). For longer terms, you can optionally add a `.text-truncate` class to truncate the text with an ellipsis.
-{% capture example %}
+{{< example >}}
<dl class="row">
<dt class="col-sm-3">Description lists</dt>
<dd class="col-sm-9">A description list is perfect for defining terms.</dd>
</dl>
</dd>
</dl>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Responsive font sizes
--- /dev/null
+---
+layout: single
+title: Examples
+description: Quickly get a project started with any of our examples ranging from using parts of the framework to custom components and layouts.
+aliases: "/examples/"
+---
+
+{{< list-examples >}}
---
layout: examples
title: Album example
-extra_css: "album.css"
+extra_css:
+ - "album.css"
---
<header>
<div class="row">
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
- {% include icons/placeholder.svg width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" %}
+ {{< placeholder width="100%" height="225" background="#55595c" color="#eceeef" class="card-img-top" text="Thumbnail" >}}
<div class="card-body">
<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 class="d-flex justify-content-between align-items-center">
<a href="#">Back to top</a>
</p>
<p>Album example is © Bootstrap, but please download and customize it for yourself!</p>
- <p>New to Bootstrap? <a href="{{ site.url }}/">Visit the homepage</a> or read our <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/introduction/">getting started guide</a>.</p>
+ <p>New to Bootstrap? <a href="/">Visit the homepage</a> or read our <a href="/docs/{{< param docs_version >}}/getting-started/introduction/">getting started guide</a>.</p>
</div>
</footer>
<a href="#" class="stretched-link">Continue reading</a>
</div>
<div class="col-auto d-none d-lg-block">
- {% include icons/placeholder.svg width="200" height="250" background="#55595c" color="#eceeef" text="Thumbnail" %}
+ {{< placeholder width="200" height="250" background="#55595c" color="#eceeef" text="Thumbnail" >}}
</div>
</div>
</div>
<a href="#" class="stretched-link">Continue reading</a>
</div>
<div class="col-auto d-none d-lg-block">
- {% include icons/placeholder.svg width="200" height="250" background="#55595c" color="#eceeef" text="Thumbnail" %}
+ {{< placeholder width="200" height="250" background="#55595c" color="#eceeef" text="Thumbnail" >}}
</div>
</div>
</div>
---
layout: examples
title: Carousel Template
-extra_css: "carousel.css"
+extra_css:
+ - "carousel.css"
---
<header>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
- {% include icons/placeholder.svg width="100%" height="100%" background="#777" color="#777" text=" " title=" " %}
+ {{< placeholder width="100%" height="100%" background="#777" color="#777" text="false" title="false" >}}
<div class="container">
<div class="carousel-caption text-left">
<h1>Example headline.</h1>
</div>
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="100%" height="100%" background="#777" color="#777" text=" " title=" " %}
+ {{< placeholder width="100%" height="100%" background="#777" color="#777" text="false" title="false" >}}
<div class="container">
<div class="carousel-caption">
<h1>Another example headline.</h1>
</div>
</div>
<div class="carousel-item">
- {% include icons/placeholder.svg width="100%" height="100%" background="#777" color="#777" text=" " title=" " %}
+ {{< placeholder width="100%" height="100%" background="#777" color="#777" text="false" title="false" >}}
<div class="container">
<div class="carousel-caption text-right">
<h1>One more for good measure.</h1>
<!-- Three columns of text below the carousel -->
<div class="row">
<div class="col-lg-4">
- {% include icons/placeholder.svg width="140" height="140" background="#777" color="#777" class="rounded-circle" %}
+ {{< placeholder width="140" height="140" background="#777" color="#777" class="rounded-circle" >}}
<h2>Heading</h2>
<p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
- {% include icons/placeholder.svg width="140" height="140" background="#777" color="#777" class="rounded-circle" %}
+ {{< placeholder width="140" height="140" background="#777" color="#777" class="rounded-circle" >}}
<h2>Heading</h2>
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
- {% include icons/placeholder.svg width="140" height="140" background="#777" color="#777" class="rounded-circle" %}
+ {{< placeholder width="140" height="140" background="#777" color="#777" class="rounded-circle" >}}
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
<p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
</div>
<div class="col-md-5">
- {% include icons/placeholder.svg width="500" height="500" background="#eee" color="#aaa" class="bd-placeholder-img-lg featurette-image img-fluid mx-auto" %}
+ {{< placeholder width="500" height="500" background="#eee" color="#aaa" class="bd-placeholder-img-lg featurette-image img-fluid mx-auto" >}}
</div>
</div>
<p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
</div>
<div class="col-md-5 order-md-1">
- {% include icons/placeholder.svg width="500" height="500" background="#eee" color="#aaa" class="bd-placeholder-img-lg featurette-image img-fluid mx-auto" %}
+ {{< placeholder width="500" height="500" background="#eee" color="#aaa" class="bd-placeholder-img-lg featurette-image img-fluid mx-auto" >}}
</div>
</div>
<p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
</div>
<div class="col-md-5">
- {% include icons/placeholder.svg width="500" height="500" background="#eee" color="#aaa" class="bd-placeholder-img-lg featurette-image img-fluid mx-auto" %}
+ {{< placeholder width="500" height="500" background="#eee" color="#aaa" class="bd-placeholder-img-lg featurette-image img-fluid mx-auto" >}}
</div>
</div>
<!-- FOOTER -->
<footer class="container">
<p class="float-right"><a href="#">Back to top</a></p>
- <p>© 2017-{{ site.time | date: "%Y" }} Company, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p>
+ <p>© 2017-{{< year >}} Company, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p>
</footer>
</main>
---
layout: examples
title: Checkout example
-extra_css: "form-validation.css"
-extra_js: "form-validation.js"
+extra_css:
+ - "form-validation.css"
+extra_js:
+ - "form-validation.js"
body_class: "bg-light"
---
<div class="container">
<div class="py-5 text-center">
- <img class="d-block mx-auto mb-4" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
+ <img class="d-block mx-auto mb-4" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
<h2>Checkout form</h2>
<p class="lead">Below is an example form built entirely with Bootstrap’s form controls. Each required form group has a validation state that can be triggered by attempting to submit the form without completing it.</p>
</div>
</div>
<footer class="my-5 pt-5 text-muted text-center text-small">
- <p class="mb-1">© 2017-{{ site.time | date: "%Y" }} Company Name</p>
+ <p class="mb-1">© 2017-{{< year >}} Company Name</p>
<ul class="list-inline">
<li class="list-inline-item"><a href="#">Privacy</a></li>
<li class="list-inline-item"><a href="#">Terms</a></li>
---
layout: examples
title: Cover Template
-extra_css: "cover.css"
+extra_css:
+ - "cover.css"
body_class: "text-center"
include_js: false
---
---
layout: examples
title: Dashboard Template
-extra_css: "dashboard.css"
+extra_css:
+ - "dashboard.css"
extra_js:
- "https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.9.0/feather.min.js"
- "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"
---
layout: examples
title: Floating labels example
-extra_css: "floating-labels.css"
+extra_css:
+ - "floating-labels.css"
include_js: false
---
<form class="form-signin">
<div class="text-center mb-4">
- <img class="mb-4" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
+ <img class="mb-4" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
<h1 class="h3 mb-3 font-weight-normal">Floating labels</h1>
<p>Build form controls with floating labels via the <code>:placeholder-shown</code> pseudo-element. <a href="https://caniuse.com/#feat=css-placeholder-shown">Works in latest Chrome, Safari, and Firefox.</a></p>
</div>
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
- <p class="mt-5 mb-3 text-muted text-center">© 2017-{{ site.time | date: "%Y" }}</p>
+ <p class="mt-5 mb-3 text-muted text-center">© 2017-{{< year >}}</p>
</form>
---
layout: examples
title: Grid Template
-extra_css: "grid.css"
+extra_css:
+ - "grid.css"
body_class: "py-4"
include_js: false
---
---
layout: examples
title: Jumbotron Template
-extra_css: "jumbotron.css"
+extra_css:
+ - "jumbotron.css"
---
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
</main>
<footer class="container">
- <p>© Company 2017-{{ site.time | date: "%Y" }}</p>
+ <p>© Company 2017-{{< year >}}</p>
</footer>
<div class="jumbotron mt-3">
<h1>Bottom Navbar example</h1>
<p class="lead">This example is a quick exercise to illustrate how the bottom navbar works.</p>
- <a class="btn btn-lg btn-primary" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/components/navbar/" role="button">View navbar docs »</a>
+ <a class="btn btn-lg btn-primary" href="/docs/{{< param docs_version >}}/components/navbar/" role="button">View navbar docs »</a>
</div>
</div>
<nav class="navbar fixed-bottom navbar-expand-sm navbar-dark bg-dark">
---
layout: examples
title: Fixed top navbar example
-extra_css: "navbar-top-fixed.css"
+extra_css:
+ - "navbar-top-fixed.css"
---
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="jumbotron">
<h1>Navbar example</h1>
<p class="lead">This example is a quick exercise to illustrate how fixed to top navbar works. As you scroll, it will remain fixed to the top of your browser’s viewport.</p>
- <a class="btn btn-lg btn-primary" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/components/navbar/" role="button">View navbar docs »</a>
+ <a class="btn btn-lg btn-primary" href="/docs/{{< param docs_version >}}/components/navbar/" role="button">View navbar docs »</a>
</div>
</main>
---
layout: examples
title: Top navbar example
-extra_css: "navbar-top.css"
+extra_css:
+ - "navbar-top.css"
---
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4">
<div class="jumbotron">
<h1>Navbar example</h1>
<p class="lead">This example is a quick exercise to illustrate how the top-aligned navbar works. As you scroll, this navbar remains in its original position and moves with the rest of the page.</p>
- <a class="btn btn-lg btn-primary" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/components/navbar/" role="button">View navbar docs »</a>
+ <a class="btn btn-lg btn-primary" href="/docs/{{< param docs_version >}}/components/navbar/" role="button">View navbar docs »</a>
</div>
</main>
---
layout: examples
title: Navbar Template
-extra_css: "navbar.css"
+extra_css:
+ - "navbar.css"
---
<nav class="navbar navbar-dark bg-dark">
<div class="jumbotron">
<div class="col-sm-8 mx-auto">
<h1>Navbar examples</h1>
- <p>This example is a quick exercise to illustrate how the navbar and its contents work. Some navbars extend the width of the viewport, others are confined within a <code>.container</code>. For positioning of navbars, checkout the <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/examples/navbar-static/">top</a> and <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/examples/navbar-fixed/">fixed top</a> examples.</p>
+ <p>This example is a quick exercise to illustrate how the navbar and its contents work. Some navbars extend the width of the viewport, others are confined within a <code>.container</code>. For positioning of navbars, checkout the <a href="/docs/{{< param docs_version >}}/examples/navbar-static/">top</a> and <a href="/docs/{{< param docs_version >}}/examples/navbar-fixed/">fixed top</a> examples.</p>
<p>At the smallest breakpoint, the collapse plugin is used to hide the links and show a menu button to toggle the collapsed content.</p>
<p>
- <a class="btn btn-primary" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/components/navbar/" role="button">View navbar docs »</a>
+ <a class="btn btn-primary" href="/docs/{{< param docs_version >}}/components/navbar/" role="button">View navbar docs »</a>
</p>
</div>
</div>
---
layout: examples
title: Offcanvas template
-extra_css: "offcanvas.css"
-extra_js: "offcanvas.js"
+extra_css:
+ - "offcanvas.css"
+extra_js:
+ - "offcanvas.js"
body_class: "bg-light"
---
<main role="main" class="container">
<div class="d-flex align-items-center p-3 my-3 text-white-50 bg-purple rounded shadow-sm">
- <img class="mr-3" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-outline.svg" alt="" width="48" height="48">
+ <img class="mr-3" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="" width="48" height="48">
<div class="lh-100">
<h6 class="mb-0 text-white lh-100">Bootstrap</h6>
<small>Since 2011</small>
<div class="my-3 p-3 bg-white rounded shadow-sm">
<h6 class="border-bottom border-gray pb-2 mb-0">Recent updates</h6>
<div class="media text-muted pt-3">
- {% include icons/placeholder.svg width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" %}
+ {{< placeholder width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" >}}
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<strong class="d-block text-gray-dark">@username</strong>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
</div>
<div class="media text-muted pt-3">
- {% include icons/placeholder.svg width="32" height="32" background="#e83e8c" color="#e83e8c" class="mr-2 rounded" %}
+ {{< placeholder width="32" height="32" background="#e83e8c" color="#e83e8c" class="mr-2 rounded" >}}
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<strong class="d-block text-gray-dark">@username</strong>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
</div>
<div class="media text-muted pt-3">
- {% include icons/placeholder.svg width="32" height="32" background="#6f42c1" color="#6f42c1" class="mr-2 rounded" %}
+ {{< placeholder width="32" height="32" background="#6f42c1" color="#6f42c1" class="mr-2 rounded" >}}
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<strong class="d-block text-gray-dark">@username</strong>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
<div class="my-3 p-3 bg-white rounded shadow-sm">
<h6 class="border-bottom border-gray pb-2 mb-0">Suggestions</h6>
<div class="media text-muted pt-3">
- {% include icons/placeholder.svg width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" %}
+ {{< placeholder width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" >}}
<div class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<div class="d-flex justify-content-between align-items-center w-100">
<strong class="text-gray-dark">Full Name</strong>
</div>
</div>
<div class="media text-muted pt-3">
- {% include icons/placeholder.svg width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" %}
+ {{< placeholder width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" >}}
<div class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<div class="d-flex justify-content-between align-items-center w-100">
<strong class="text-gray-dark">Full Name</strong>
</div>
</div>
<div class="media text-muted pt-3">
- {% include icons/placeholder.svg width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" %}
+ {{< placeholder width="32" height="32" background="#007bff" color="#007bff" class="mr-2 rounded" >}}
<div class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<div class="d-flex justify-content-between align-items-center w-100">
<strong class="text-gray-dark">Full Name</strong>
---
layout: examples
title: Pricing example
-extra_css: "pricing.css"
+extra_css:
+ - "pricing.css"
include_js: false
---
<footer class="pt-4 my-md-5 pt-md-5 border-top">
<div class="row">
<div class="col-12 col-md">
- <img class="mb-2" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" alt="" width="24" height="24">
- <small class="d-block mb-3 text-muted">© 2017-{{ site.time | date: "%Y" }}</small>
+ <img class="mb-2" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="" width="24" height="24">
+ <small class="d-block mb-3 text-muted">© 2017-{{< year >}}</small>
</div>
<div class="col-6 col-md">
<h5>Features</h5>
---
layout: examples
title: Product example
-extra_css: "product.css"
+extra_css:
+ - "product.css"
---
<nav class="site-header sticky-top py-1">
<div class="row">
<div class="col-12 col-md">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="d-block mb-2" role="img" viewBox="0 0 24 24"><title>Product</title><circle cx="12" cy="12" r="10"/><path d="M14.31 8l5.74 9.94M9.69 8h11.48M7.38 12l5.74-9.94M9.69 16L3.95 6.06M14.31 16H2.83m13.79-4l-5.74 9.94"/></svg>
- <small class="d-block mb-3 text-muted">© 2017-{{ site.time | date: "%Y" }}</small>
+ <small class="d-block mb-3 text-muted">© 2017-{{< year >}}</small>
</div>
<div class="col-6 col-md">
<h5>Features</h5>
---
layout: examples
title: Signin Template
-extra_css: "signin.css"
+extra_css:
+ - "signin.css"
body_class: "text-center"
include_js: false
---
<form class="form-signin">
- <img class="mb-4" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
+ <img class="mb-4" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
- <p class="mt-5 mb-3 text-muted">© 2017-{{ site.time | date: "%Y" }}</p>
+ <p class="mt-5 mb-3 text-muted">© 2017-{{< year >}}</p>
</form>
---
layout: examples
title: Starter Template
-extra_css: "starter-template.css"
+extra_css:
+ - "starter-template.css"
---
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
---
layout: examples
title: Sticky Footer Navbar Template
-extra_css: "sticky-footer-navbar.css"
+extra_css:
+ - "sticky-footer-navbar.css"
html_class: "h-100"
body_class: "d-flex flex-column h-100"
---
<div class="container">
<h1 class="mt-5">Sticky footer with fixed navbar</h1>
<p class="lead">Pin a footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added with <code>padding-top: 60px;</code> on the <code>main > .container</code>.</p>
- <p>Back to <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/examples/sticky-footer/">the default sticky footer</a> minus the navbar.</p>
+ <p>Back to <a href="/docs/{{< param docs_version >}}/examples/sticky-footer/">the default sticky footer</a> minus the navbar.</p>
</div>
</main>
---
layout: examples
title: Sticky Footer Template
-extra_css: "sticky-footer.css"
+extra_css:
+ - "sticky-footer.css"
html_class: "h-100"
body_class: "d-flex flex-column h-100"
include_js: false
<div class="container">
<h1 class="mt-5">Sticky footer</h1>
<p class="lead">Pin a footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p>
- <p>Use <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/examples/sticky-footer-navbar/">the sticky footer with a fixed navbar</a> if need be, too.</p>
+ <p>Use <a href="/docs/{{< param docs_version >}}/examples/sticky-footer-navbar/">the sticky footer with a fixed navbar</a> if need be, too.</p>
</div>
</main>
title: Approach
description: Learn about the guiding principles, strategies, and techniques used to build and maintain Bootstrap so you can more easily customize and extend it yourself.
group: extend
-redirect_from: "/docs/4.3/extend/"
+aliases:
+ - "/docs/4.3/extend/"
---
While the getting started pages provide an introductory tour of the project and what it offers, this document focuses on _why_ we do the things we do in Bootstrap. It explains our philosophy to building on the web so that others can learn from us, contribute with us, and help us improve.
-See something that doesn't sound right, or perhaps could be done better? [Open an issue]({{ site.repo }}/issues/new)—we'd love to discuss it with you.
+See something that doesn't sound right, or perhaps could be done better? [Open an issue]({{< param repo >}}/issues/new)—we'd love to discuss it with you.
## Summary
Each overlay component increases it's `z-index` value slightly in such a way that common UI principles allow user focused or hovered elements to remain in view at all times. For example, a modal is document blocking (e.g., you cannot take any other action save for the modal's action), so we put that above our navbars.
-Learn more about this in our [`z-index` layout page]({{ site.baseurl }}/docs/{{ site.docs_version }}/layout/overview/#z-index).
+Learn more about this in our [`z-index` layout page](/docs/{{< param docs_version >}}/layout/overview/#z-index).
## HTML and CSS over JS
Whenever possible, we prefer to write HTML and CSS over JavaScript. In general, HTML and CSS are more prolific and accessible to more people of all different experience levels. HTML and CSS are also faster in your browser than JavaScript, and your browser generally provides a great deal of functionality for you.
-This principle is our first-class JavaScript API is `data` attributes. You don't need to write nearly any JavaScript to use our JavaScript plugins; instead, write HTML. Read more about this in [our JavaScript overview page]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#data-attributes).
+This principle is our first-class JavaScript API is `data` attributes. You don't need to write nearly any JavaScript to use our JavaScript plugins; instead, write HTML. Read more about this in [our JavaScript overview page](/docs/{{< param docs_version >}}/getting-started/javascript/#data-attributes).
Lastly, our styles build on the fundamental behaviors of common web elements. Whenever possible, we prefer to use what the browser provides. For example, you can put a `.btn` class on nearly any element, but most elements don't provide any semantic value or browser functionality. So instead, we use `<button>`s and `<a>`s.
Content which should be visually hidden, but remain accessible to assistive technologies such as screen readers, can be styled using the `.sr-only` class. This can be useful in situations where additional visual information or cues (such as meaning denoted through the use of color) need to also be conveyed to non-visual users.
-{% highlight html %}
+{{< highlight html >}}
<p class="text-danger">
<span class="sr-only">Danger: </span>
This action is not reversible
</p>
-{% endhighlight %}
+{{< /highlight >}}
For visually hidden interactive controls, such as traditional "skip" links, `.sr-only` can be combined with the `.sr-only-focusable` class. This will ensure that the control becomes visible once focused (for sighted keyboard users).
-{% highlight html %}
+{{< highlight html >}}
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
-{% endhighlight %}
+{{< /highlight >}}
### Reduced motion
We've designed and developed Bootstrap to work in a number of environments. Here are some of the best practices we've gathered from years of working on and using it ourselves.
-{% capture callout %}
+{{< callout info >}}
**Heads up!** This copy is a work in progress.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
### General outline
Alternative browsers which use the latest version of WebKit, Blink, or Gecko, whether directly or via the platform's web view API, are not explicitly supported. However, Bootstrap should (in most cases) display and function correctly in these browsers as well. More specific support information is provided below.
-You can find our supported range of browsers and their versions [in our `.browserslistrc file`]({{ site.repo }}/blob/v{{ site.current_version }}/.browserslistrc):
+You can find our supported range of browsers and their versions [in our `.browserslistrc file`]({{< param repo >}}/blob/v{{< param current_version >}}/.browserslistrc):
-```
+```text
# https://github.com/browserslist/browserslist#readme
>= 1%
Unofficially, Bootstrap should look and behave well enough in Chromium and Chrome for Linux, Firefox for Linux, and Internet Explorer 9, though they are not officially supported.
-For a list of some of the browser bugs that Bootstrap has to grapple with, see our [Wall of browser bugs]({{ site.baseurl }}/docs/{{ site.docs_version }}/browser-bugs/).
+For a list of some of the browser bugs that Bootstrap has to grapple with, see our [Wall of browser bugs](/docs/{{< param docs_version >}}/browser-bugs/).
## Internet Explorer
-Internet Explorer 11 is not supported officially. However, if you build Bootstrap yourself, you can add the needed CSS prefixes and follow the instructions on the [JavaScript page]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#compatibility-with-ie-11). Please note that this might break at any time. **If you require Internet Explorer 10/11 support, use Bootstrap 4.**
+Internet Explorer 11 is not supported officially. However, if you build Bootstrap yourself, you can add the needed CSS prefixes and follow the instructions on the [JavaScript page](/docs/{{< param docs_version >}}/getting-started/javascript/#compatibility-with-ie-11). Please note that this might break at any time. **If you require Internet Explorer 10/11 support, use Bootstrap 4.**
## Modals and dropdowns on mobile
Even in some modern browsers, printing can be quirky.
-As of Safari v8.0, use of the fixed-width `.container` class can cause Safari to use an unusually small font size when printing. See [issue #14868]({{ site.repo }}/issues/14868) and [WebKit bug #138192](https://bugs.webkit.org/show_bug.cgi?id=138192) for more details. One potential workaround is the following CSS:
+As of Safari v8.0, use of the fixed-width `.container` class can cause Safari to use an unusually small font size when printing. See [issue #14868]({{< param repo >}}/issues/14868) and [WebKit bug #138192](https://bugs.webkit.org/show_bug.cgi?id=138192) for more details. One potential workaround is the following CSS:
-{% highlight css %}
+{{< highlight css >}}
@media print {
.container {
width: auto;
}
}
-{% endhighlight %}
+{{< /highlight >}}
## Android stock browser
On `<select>` elements, the Android stock browser will not display the side controls if there is a `border-radius` and/or `border` applied. (See [this StackOverflow question](https://stackoverflow.com/questions/14744437/html-select-box-not-showing-drop-down-arrow-on-android-version-4-0-when-set-with) for details.) Use the snippet of code below to remove the offending CSS and render the `<select>` as an unstyled element on the Android stock browser. The user agent sniffing avoids interference with Chrome, Safari, and Mozilla browsers.
-{% highlight html %}
+{{< highlight html >}}
<script>
$(function () {
var nua = navigator.userAgent
}
})
</script>
-{% endhighlight %}
+{{< /highlight >}}
Want to see an example? [Check out this JS Bin demo](http://jsbin.com/OyaqoDO/2).
## Tooling setup
-Bootstrap uses [npm scripts](https://docs.npmjs.com/misc/scripts) for its build system. Our [package.json]({{ site.repo }}/blob/v{{ site.current_version }}/package.json) includes convenient methods for working with the framework, including compiling code, running tests, and more.
+Bootstrap uses [npm scripts](https://docs.npmjs.com/misc/scripts) for its build system. Our [package.json]({{< param repo >}}/blob/v{{< param current_version >}}/package.json) includes convenient methods for working with the framework, including compiling code, running tests, and more.
To use our build system and run our documentation locally, you'll need a copy of Bootstrap's source files and Node. Follow these steps and you should be ready to rock:
1. [Download and install Node.js](https://nodejs.org/en/download/), which we use to manage our dependencies.
-2. Navigate to the root `/bootstrap` directory and run `npm install` to install our local dependencies listed in [package.json]({{ site.repo }}/blob/v{{ site.current_version }}/package.json).
-3. [Install Ruby][install-ruby], install [Bundler][gembundler] with `gem install bundler`, and finally run `bundle install`. This will install all Ruby dependencies, such as Jekyll and plugins.
- - **Windows users:** Read [this guide](https://jekyllrb.com/docs/windows/) to get Jekyll up and running without problems.
+2. Navigate to the root `/bootstrap` directory and run `npm install` to install our local dependencies listed in [package.json]({{< param repo >}}/blob/v{{< param current_version >}}/package.json).
When completed, you'll be able to run the various commands provided from the command line.
-[install-ruby]: https://www.ruby-lang.org/en/documentation/installation/
-[gembundler]: https://bundler.io/
-
## Using npm scripts
-Our [package.json]({{ site.repo }}/blob/v{{ site.current_version }}/package.json) includes the following commands and tasks:
+Our [package.json]({{< param repo >}}/blob/v{{< param current_version >}}/package.json) includes the following commands and tasks:
| Task | Description |
| --- | --- |
Bootstrap uses [Autoprefixer][autoprefixer] (included in our build process) to automatically add vendor prefixes to some CSS properties at build time. Doing so saves us time and code by allowing us to write key parts of our CSS a single time while eliminating the need for vendor mixins like those found in v3.
-We maintain the list of browsers supported through Autoprefixer in a separate file within our GitHub repository. See [.browserslistrc]({{ site.repo }}/blob/v{{ site.current_version }}/.browserslistrc) for details.
+We maintain the list of browsers supported through Autoprefixer in a separate file within our GitHub repository. See [.browserslistrc]({{< param repo >}}/blob/v{{< param current_version >}}/.browserslistrc) for details.
## Local documentation
-Running our documentation locally requires the use of Jekyll, a decently flexible static site generator that provides us: basic includes, Markdown-based files, templates, and more. Here's how to get it started:
+Running our documentation locally requires the use of Hugo, which gets installed via the [hugo-bin](https://www.npmjs.com/package/hugo-bin) npm package. Hugo is a blazingly fast and quite extensible static site generator that provides us: basic includes, Markdown-based files, templates, and more. Here's how to get it started:
-1. Run through the [tooling setup](#tooling-setup) above to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`.
+1. Run through the [tooling setup](#tooling-setup) above to install all dependencies.
2. From the root `/bootstrap` directory, run `npm run docs-serve` in the command line.
-3. Open `http://localhost:9001` in your browser, and voilà.
+3. Open `http://localhost:9001/` in your browser, and voilà.
-Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/).
+Learn more about using Hugo by reading its [documentation](https://gohugo.io/documentation/).
## Troubleshooting
<!-- NOTE: This info is intentionally duplicated in the README. Copy any changes made here over to the README too, but be sure to keep in mind to add the `dist` folder. -->
-{% highlight plaintext %}
+{{< highlight text >}}
bootstrap/
├── css/
│ ├── bootstrap-grid.css
├── bootstrap.js.map
├── bootstrap.min.js
└── bootstrap.min.js.map
-{% endhighlight %}
+{{< /highlight >}}
This is the most basic form of Bootstrap: precompiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/).
<div><code class="font-weight-normal text-nowrap">bootstrap-grid.css</code></div>
<div><code class="font-weight-normal text-nowrap">bootstrap-grid.min.css</code></div>
</th>
- <td><a class="text-warning" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/layout/grid/">Only grid system</a></td>
+ <td><a class="text-warning" href="/docs/{{< param docs_version >}}/layout/grid/">Only grid system</a></td>
<td class="bg-light text-muted">Not included</td>
<td class="bg-light text-muted">Not included</td>
- <td><a class="text-warning" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/">Only flex utilities</a></td>
+ <td><a class="text-warning" href="/docs/{{< param docs_version >}}/utilities/flex/">Only flex utilities</a></td>
</tr>
<tr>
<th scope="row">
<div><code class="font-weight-normal text-nowrap">bootstrap-reboot.min.css</code></div>
</th>
<td class="bg-light text-muted">Not included</td>
- <td><a class="text-warning" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/content/reboot/">Only Reboot</a></td>
+ <td><a class="text-warning" href="/docs/{{< param docs_version >}}/content/reboot/">Only Reboot</a></td>
<td class="bg-light text-muted">Not included</td>
<td class="bg-light text-muted">Not included</td>
</tr>
The Bootstrap source code download includes the precompiled CSS and JavaScript assets, along with source Sass, JavaScript, and documentation. More specifically, it includes the following and more:
-{% highlight plaintext %}
+{{< highlight text >}}
bootstrap/
├── dist/
│ ├── css/
│ └── js/
├── site/
-│ └──docs/
-│ └── 4.3/
-│ └── examples/
+│ └──content/
+│ └── docs/
+│ └── 4.3/
+│ └── examples/
├── js/
└── scss/
-{% endhighlight %}
+{{< /highlight >}}
The `scss/` and `js/` are the source code for our CSS and JavaScript. The `dist/` folder includes everything listed in the precompiled download section above. The `site/docs/` folder includes the source code for our documentation, and `examples/` of Bootstrap usage. Beyond that, any other included file provides support for packages, license information, and development.
## Compiled CSS and JS
-Download ready-to-use compiled code for **Bootstrap v{{ site.current_version}}** to easily drop into your project, which includes:
+Download ready-to-use compiled code for **Bootstrap v{{< param current_version >}}** to easily drop into your project, which includes:
-- Compiled and minified CSS bundles (see [CSS files comparison]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/contents/#css-files))
+- Compiled and minified CSS bundles (see [CSS files comparison](/docs/{{< param docs_version >}}/getting-started/contents/#css-files))
- Compiled and minified JavaScript plugins
This doesn't include documentation, source files, or any optional JavaScript dependencies like Popper.js.
-<a href="{{ site.download.dist }}" class="btn btn-bd-primary" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download Bootstrap');">Download</a>
+<a href="{{< param "download.dist" >}}" class="btn btn-bd-primary" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download Bootstrap');">Download</a>
## Source files
- Sass compiler (Libsass or Ruby Sass is supported) for compiling your CSS.
- [Autoprefixer](https://github.com/postcss/autoprefixer) for CSS vendor prefixing
-Should you require [build tools]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/build-tools/#tooling-setup), they are included for developing Bootstrap and its docs, but they're likely unsuitable for your own purposes.
+Should you require [build tools](/docs/{{< param docs_version >}}/getting-started/build-tools/#tooling-setup), they are included for developing Bootstrap and its docs, but they're likely unsuitable for your own purposes.
-<a href="{{ site.download.source }}" class="btn btn-bd-primary" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download source');">Download source</a>
+<a href="{{< param "download.source" >}}" class="btn btn-bd-primary" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download source');">Download source</a>
## BootstrapCDN
Skip the download with [BootstrapCDN](https://www.bootstrapcdn.com/) to deliver cached version of Bootstrap's compiled CSS and JS to your project.
-{% highlight html %}
-<link rel="stylesheet" href="{{ site.cdn.css }}" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
-<script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
-{% endhighlight %}
+{{< highlight html >}}
+<link rel="stylesheet" href="{{< param "cdn.css" >}}" integrity="{{< param "cdn.css_hash" >}}" crossorigin="anonymous">
+<script src="{{< param "cdn.js" >}}" integrity="{{< param "cdn.js_hash" >}}" crossorigin="anonymous"></script>
+{{< /highlight >}}
If you're using our compiled JavaScript, don't forget to include Popper.js, via a CDN preferably, before our JS.
-{% highlight html %}
-<script src="{{ site.cdn.popper }}" integrity="{{ site.cdn.popper_hash }}" crossorigin="anonymous"></script>
-{% endhighlight %}
+{{< highlight html >}}
+<script src="{{< param "cdn.popper" >}}" integrity="{{< param "cdn.popper_hash" >}}" crossorigin="anonymous"></script>
+{{< /highlight >}}
## Package managers
Install Bootstrap in your Node.js powered apps with [the npm package](https://www.npmjs.com/package/bootstrap):
-{% highlight sh %}
+{{< highlight sh >}}
npm install bootstrap
-{% endhighlight %}
+{{< /highlight >}}
`const bootstrap = require('bootstrap')` or `import bootstrap from 'bootstrap'` will load all of Bootstrap's plugins onto a `bootstrap` object.
The `bootstrap` module itself exports all of our plugins. You can manually load Bootstrap's plugins individually by loading the `/js/dist/*.js` files under the package's top-level directory.
Install Bootstrap in your Node.js powered apps with [the yarn package](https://yarnpkg.com/en/package/yarn):
-{% highlight sh %}
+{{< highlight sh >}}
yarn add bootstrap
-{% endhighlight %}
+{{< /highlight >}}
### RubyGems
Install Bootstrap in your Ruby apps using [Bundler](https://bundler.io/) (**recommended**) and [RubyGems](https://rubygems.org/) by adding the following line to your [`Gemfile`](https://bundler.io/gemfile.html):
-{% highlight ruby %}
-gem 'bootstrap', '~> {{ site.current_ruby_version }}'
-{% endhighlight %}
+{{< highlight ruby >}}
+gem 'bootstrap', '~> {{< param current_ruby_version >}}'
+{{< /highlight >}}
Alternatively, if you're not using Bundler, you can install the gem by running this command:
-{% highlight sh %}
-gem install bootstrap -v {{ site.current_ruby_version }}
-{% endhighlight %}
+{{< highlight sh >}}
+gem install bootstrap -v {{< param current_ruby_version >}}
+{{< /highlight >}}
[See the gem's README](https://github.com/twbs/bootstrap-rubygem/blob/master/README.md) for further details.
You can also install and manage Bootstrap's Sass and JavaScript using [Composer](https://getcomposer.org/):
-{% highlight sh %}
-composer require twbs/bootstrap:{{ site.current_version }}
-{% endhighlight %}
+{{< highlight sh >}}
+composer require twbs/bootstrap:{{< param current_version >}}
+{{< /highlight >}}
### NuGet
If you develop in .NET, you can also install and manage Bootstrap's [CSS](https://www.nuget.org/packages/bootstrap/) or [Sass](https://www.nuget.org/packages/bootstrap.sass/) and JavaScript using [NuGet](https://www.nuget.org/):
-{% highlight powershell %}
+{{< highlight powershell >}}
Install-Package bootstrap
-{% endhighlight %}
+{{< /highlight >}}
-{% highlight powershell %}
+{{< highlight powershell >}}
Install-Package bootstrap.sass
-{% endhighlight %}
+{{< /highlight >}}
title: Introduction
description: Get started with Bootstrap, the world's most popular framework for building responsive, mobile-first sites, with BootstrapCDN and a template starter page.
group: getting-started
-redirect_from:
+aliases:
- "/docs/"
- "/docs/4.3/"
- "/docs/4.3/getting-started/"
## Quick start
-Looking to quickly add Bootstrap to your project? Use BootstrapCDN, provided for free by the folks at StackPath. Using a package manager or need to download the source files? [Head to the downloads page]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/download/).
+Looking to quickly add Bootstrap to your project? Use BootstrapCDN, provided for free by the folks at StackPath. Using a package manager or need to download the source files? [Head to the downloads page](/docs/{{< param docs_version >}}/getting-started/download/).
### CSS
Copy-paste the stylesheet `<link>` into your `<head>` before all other stylesheets to load our CSS.
-{% highlight html %}
-<link rel="stylesheet" href="{{ site.cdn.css }}" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
-{% endhighlight %}
+{{< highlight html >}}
+<link rel="stylesheet" href="{{< param "cdn.css" >}}" integrity="{{< param "cdn.css_hash" >}}" crossorigin="anonymous">
+{{< /highlight >}}
### JS
Many of our components require the use of JavaScript to function. Specifically, they require our own JavaScript plugins and [Popper.js](https://popper.js.org/). Place the following `<script>`s near the end of your pages, right before the closing `</body>` tag, to enable them. Popper.js must come first, and then our JavaScript plugins.
-{% highlight html %}
-<script src="{{ site.cdn.popper }}" integrity="{{ site.cdn.popper_hash }}" crossorigin="anonymous"></script>
-<script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
-{% endhighlight %}
+{{< highlight html >}}
+<script src="{{< param "cdn.popper" >}}" integrity="{{< param "cdn.popper_hash" >}}" crossorigin="anonymous"></script>
+<script src="{{< param "cdn.js" >}}" integrity="{{< param "cdn.js_hash" >}}" crossorigin="anonymous"></script>
+{{< /highlight >}}
-If you use `<script type="module">`, please refer to our [using Bootstrap as a module]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#using-bootstrap-as-a-module) section.
+If you use `<script type="module">`, please refer to our [using Bootstrap as a module](/docs/{{< param docs_version >}}/getting-started/javascript/#using-bootstrap-as-a-module) section.
Curious which components explicitly require our JavaScript and Popper.js? Click the show components link below. If you're at all unsure about the general page structure, keep reading for an example page template.
-Our `bootstrap.bundle.js` and `bootstrap.bundle.min.js` include [Popper](https://popper.js.org/). For more information about what's included in Bootstrap, please see our [contents]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/contents/#precompiled-bootstrap) section.
+Our `bootstrap.bundle.js` and `bootstrap.bundle.min.js` include [Popper](https://popper.js.org/). For more information about what's included in Bootstrap, please see our [contents](/docs/{{< param docs_version >}}/getting-started/contents/#precompiled-bootstrap) section.
<details>
<summary class="text-primary mb-3">Show components requiring JavaScript</summary>
-{% capture markdown %}
+{{< markdown >}}
- Alerts for dismissing
- Buttons for toggling states and checkbox/radio functionality
- Carousel for all slide behaviors, controls, and indicators
- Navbar for extending our Collapse plugin to implement responsive behavior
- Tooltips and popovers for displaying and positioning (also requires [Popper.js](https://popper.js.org/))
- Scrollspy for scroll behavior and navigation updates
-{% endcapture %}
-{{ markdown | markdownify }}
+{{< /markdown >}}
</details>
## Starter template
Be sure to have your pages set up with the latest design and development standards. That means using an HTML5 doctype and including a viewport meta tag for proper responsive behaviors. Put it all together and your pages should look like this:
-{% highlight html %}
+{{< highlight html >}}
<!doctype html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
- <link rel="stylesheet" href="{{ site.cdn.css }}" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
+ <link rel="stylesheet" href="{{< param "cdn.css" >}}" integrity="{{< param "cdn.css_hash" >}}" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<!-- Optional JavaScript -->
<!-- Popper.js first, then Bootstrap JS -->
- <script src="{{ site.cdn.popper }}" integrity="{{ site.cdn.popper_hash }}" crossorigin="anonymous"></script>
- <script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
+ <script src="{{< param "cdn.popper" >}}" integrity="{{< param "cdn.popper_hash" >}}" crossorigin="anonymous"></script>
+ <script src="{{< param "cdn.js" >}}" integrity="{{< param "cdn.js_hash" >}}" crossorigin="anonymous"></script>
</body>
</html>
-{% endhighlight %}
+{{< /highlight >}}
-That's all you need for overall page requirements. Visit the [Layout docs]({{ site.baseurl }}/docs/{{ site.docs_version }}/layout/overview/) or [our official examples]({{ site.baseurl }}/docs/{{ site.docs_version }}/examples/) to start laying out your site's content and components.
+That's all you need for overall page requirements. Visit the [Layout docs](/docs/{{< param docs_version >}}/layout/overview/) or [our official examples](/docs/{{< param docs_version >}}/examples/) to start laying out your site's content and components.
## Important globals
Bootstrap requires the use of the HTML5 doctype. Without it, you'll see some funky incomplete styling, but including it shouldn't cause any considerable hiccups.
-{% highlight html %}
+{{< highlight html >}}
<!doctype html>
<html lang="en">
...
</html>
-{% endhighlight %}
+{{< /highlight >}}
### Responsive meta tag
Bootstrap is developed *mobile first*, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, **add the responsive viewport meta tag** to your `<head>`.
-{% highlight html %}
+{{< highlight html >}}
<meta name="viewport" content="width=device-width, initial-scale=1">
-{% endhighlight %}
+{{< /highlight >}}
You can see an example of this in action in the [starter template](#starter-template).
On the rare occasion you need to override it, use something like the following:
-{% highlight css %}
+{{< highlight css >}}
.selector-for-some-widget {
box-sizing: content-box;
}
-{% endhighlight %}
+{{< /highlight >}}
With the above snippet, nested elements—including generated content via `::before` and `::after`—will all inherit the specified `box-sizing` for that `.selector-for-some-widget`.
### Reboot
-For improved cross-browser rendering, we use [Reboot]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/reboot/) to correct inconsistencies across browsers and devices while providing slightly more opinionated resets to common HTML elements.
+For improved cross-browser rendering, we use [Reboot](/docs/{{< param docs_version >}}/content/reboot/) to correct inconsistencies across browsers and devices while providing slightly more opinionated resets to common HTML elements.
## Community
Stay up to date on the development of Bootstrap and reach out to the community with these helpful resources.
-- Follow [@getbootstrap on Twitter](https://twitter.com/{{ site.twitter }}).
-- Read and subscribe to [The Official Bootstrap Blog]({{ site.blog }}/).
-- Join [the official Slack room]({{ site.slack }}/).
+- Follow [@getbootstrap on Twitter](https://twitter.com/{{< param twitter >}}).
+- Read and subscribe to [The Official Bootstrap Blog]({{< param blog >}}/).
+- Join [the official Slack room]({{< param slack >}}/).
- 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)).
- Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/search?q=keywords:bootstrap) or similar delivery mechanisms for maximum discoverability.
-You can also follow [@getbootstrap on Twitter](https://twitter.com/{{ site.twitter }}) for the latest gossip and awesome music videos.
+You can also follow [@getbootstrap on Twitter](https://twitter.com/{{< param twitter >}}) for the latest gossip and awesome music videos.
We provide a version of Bootstrap built as `ESM` (`bootstrap.esm.js` and `bootstrap.esm.min.js`) which allows you to use Bootstrap as a module in your browser, if your [targeted browsers support it](https://caniuse.com/#feat=es6-module).
-{% highlight html %}
+{{< highlight html >}}
<script type="module">
import { Toast } from 'bootstrap.esm.min.js'
Array.from(document.querySelectorAll('.toast'))
.forEach(toastNode => new Toast(toastNode))
</script>
-{% endhighlight %}
+{{< /highlight >}}
-{% capture callout %}
+{{< callout warning >}}
## Incompatible plugins
Due to browser limitations, some of our plugins, namely Dropdown, Tooltip and Popover plugins, cannot be used in a `<script>` tag with `module` type because they depend on Popper.js. For more information about the issue see [here](https://developers.google.com/web/fundamentals/primers/modules#specifiers).
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
## Dependencies
However, in some situations it may be desirable to disable this functionality. To disable the data attribute API, unbind all events on the document namespaced with `data-api` like so:
-{% highlight js %}
+{{< highlight js >}}
$(document).off('.data-api')
-{% endhighlight %}
+{{< /highlight >}}
Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:
-{% highlight js %}
+{{< highlight js >}}
$(document).off('.alert.data-api')
-{% endhighlight %}
+{{< /highlight >}}
-{% capture callout %}
+{{< callout warning >}}
## Selectors
Currently to query DOM elements we use the native methods `querySelector` and `querySelectorAll` for performance reasons, so you have to use [valid selectors](https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier).
If you use special selectors, for example: `collapse:Example` be sure to escape them.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
## Events
All infinitive events provide [`preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) functionality. This provides the ability to stop the execution of an action before it starts. Returning false from an event handler will also automatically call `preventDefault()`.
-{% highlight js %}
+{{< highlight js >}}
$('#myModal').on('show.bs.modal', function (e) {
if (!data) {
return e.preventDefault() // stops modal from being shown
}
})
-{% endhighlight %}
+{{< /highlight >}}
## Programmatic API
We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.
-{% highlight js %}
+{{< highlight js >}}
$('.btn.danger').button('toggle').addClass('fat')
-{% endhighlight %}
+{{< /highlight >}}
All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):
-{% highlight js %}
+{{< highlight js >}}
$('#myModal').modal() // initialized with defaults
$('#myModal').modal({ keyboard: false }) // initialized with no keyboard
$('#myModal').modal('show') // initializes and invokes show immediately
-{% endhighlight %}
+{{< /highlight >}}
Each plugin also exposes its raw constructor on a `Constructor` property: `$.fn.popover.Constructor`. If you'd like to get a particular plugin instance, retrieve it directly from an element: `$('[rel="popover"]').data('popover')`.
In order to execute an action once the transition is complete, you can listen to the corresponding event.
-{% highlight js %}
+{{< highlight js >}}
$('#myCollapse').on('shown.bs.collapse', function (e) {
// Action to execute once the collapsible area is expanded
})
-{% endhighlight %}
+{{< /highlight >}}
In addition a method call on a **transitioning component will be ignored**.
-{% highlight js %}
+{{< highlight js >}}
$('#myCarousel').on('slid.bs.carousel', function (e) {
$('#myCarousel').carousel('2') // Will slide to the slide 2 as soon as the transition to slide 1 is finished
})
$('#myCarousel').carousel('1') // Will start sliding to the slide 1 and returns to the caller
$('#myCarousel').carousel('2') // !! Will be ignored, as the transition to the slide 1 is not finished !!
-{% endhighlight %}
+{{< /highlight >}}
### Default settings
You can change the default settings for a plugin by modifying the plugin's `Constructor.Default` object:
-{% highlight js %}
+{{< highlight js >}}
// changes default for the modal plugin's `keyboard` option to false
$.fn.modal.Constructor.Default.keyboard = false
-{% endhighlight %}
+{{< /highlight >}}
## No conflict
Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call `.noConflict` on the plugin you wish to revert the value of.
-{% highlight js %}
+{{< highlight js >}}
var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
-{% endhighlight %}
+{{< /highlight >}}
## Version numbers
The version of each of Bootstrap's plugins can be accessed via the `VERSION` property of the plugin's constructor. For example, for the tooltip plugin:
-{% highlight js %}
-$.fn.tooltip.Constructor.VERSION // => "{{ site.current_version }}"
-{% endhighlight %}
+{{< highlight js >}}
+$.fn.tooltip.Constructor.VERSION // => "{{< param current_version >}}"
+{{< /highlight >}}
## No special fallbacks when JavaScript is disabled
Bootstrap's plugins don't fall back particularly gracefully when JavaScript is disabled. If you care about the user experience in this case, use [`<noscript>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript) to explain the situation (and how to re-enable JavaScript) to your users, and/or add your own custom fallbacks.
-{% capture callout %}
+{{< callout warning >}}
##### Third-party libraries
**Bootstrap does not officially support third-party JavaScript libraries** like Prototype or jQuery UI. Despite `.noConflict` and namespaced events, there may be compatibility problems that you need to fix on your own.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
## Sanitizer
The default `whiteList` value is the following:
-{% highlight js %}
+{{< highlight js >}}
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
var DefaultWhitelist = {
// Global attributes allowed on any supplied element below.
u: [],
ul: []
}
-{% endhighlight %}
+{{< /highlight >}}
If you want to add new values to this default `whiteList` you can do the following:
-{% highlight js %}
+{{< highlight js >}}
var myDefaultWhiteList = $.fn.tooltip.Constructor.Default.whiteList
// To allow table elements
// Be careful about your regular expressions being too lax
var myCustomRegex = /^data-my-app-[\w-]+/
myDefaultWhiteList['*'].push(myCustomRegex)
-{% endhighlight %}
+{{< /highlight >}}
If you want to bypass our sanitizer because you prefer to use a dedicated library, for example [DOMPurify](https://www.npmjs.com/package/dompurify), you should do the following:
-{% highlight js %}
+{{< highlight js >}}
$('#yourTooltip').tooltip({
sanitizeFn: function (content) {
return DOMPurify.sanitize(content)
}
})
-{% endhighlight %}
+{{< /highlight >}}
## Compatibility with IE 11
Bootstrap v5 isn't designed to work with Internet Explorer 11, but you can add the following polyfills to make it work:
-{% highlight html %}
+{{< highlight html >}}
<!-- Polyfill.io will load polyfills your browser needs -->
<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js"></script>
<script>
}
})()
</script>
-{% endhighlight %}
+{{< /highlight >}}
Whenever possible, avoid modifying Bootstrap's core files. For Sass, that means creating your own stylesheet that imports Bootstrap so you can modify and extend it. Assuming you're using a package manager like npm, you'll have a file structure that looks like this:
-{% highlight plaintext %}
+{{< highlight text >}}
your-project/
├── scss
│ └── custom.scss
└── bootstrap
├── js
└── scss
-{% endhighlight %}
+{{< /highlight >}}
If you've downloaded our source files and aren't using a package manager, you'll want to manually setup something similar to that structure, keeping Bootstrap's source files separate from your own.
-{% highlight plaintext %}
+{{< highlight text >}}
your-project/
├── scss
│ └── custom.scss
└── bootstrap/
├── js
└── scss
-{% endhighlight %}
+{{< /highlight >}}
### Importing
In your `custom.scss`, you'll import Bootstrap's source Sass files. You have two options: include all of Bootstrap, or pick the parts you need. We encourage the latter, though be aware there are some requirements and dependencies across our components. You also will need to include some JavaScript for our plugins.
-{% highlight scss %}
+{{< highlight scss >}}
// Custom.scss
// Option A: Include all of Bootstrap
@import "../node_modules/bootstrap/scss/bootstrap";
-{% endhighlight %}
+{{< /highlight >}}
-{% highlight scss %}
+{{< highlight scss >}}
// Custom.scss
// Option B: Include parts of Bootstrap
@import "../node_modules/bootstrap/scss/images";
@import "../node_modules/bootstrap/scss/code";
@import "../node_modules/bootstrap/scss/grid";
-{% endhighlight %}
+{{< /highlight >}}
With that setup in place, you can begin to modify any of the Sass variables and maps in your `custom.scss`. You can also start to add parts of Bootstrap under the `// Optional` section as needed. We suggest using the full import stack from our `bootstrap.scss` file as your starting point.
Here's an example that changes the `background-color` and `color` for the `<body>` when importing and compiling Bootstrap via npm:
-{% highlight scss %}
+{{< highlight scss >}}
// Your variable overrides
$body-bg: #000;
$body-color: #111;
// Bootstrap and its default variables
@import "../node_modules/bootstrap/scss/bootstrap";
-{% endhighlight %}
+{{< /highlight >}}
Repeat as necessary for any variable in Bootstrap, including the global options below.
To modify an existing color in our `$theme-colors` map, add the following to your custom Sass file:
-{% highlight scss %}
+{{< highlight scss >}}
$theme-colors: (
"primary": #0074d9,
"danger": #ff4136
);
-{% endhighlight %}
+{{< /highlight >}}
#### Add to map
To add a new color to `$theme-colors`, add the new key and value:
-{% highlight scss %}
+{{< highlight scss >}}
$theme-colors: (
"custom-color": #900
);
-{% endhighlight %}
+{{< /highlight >}}
#### Remove from map
To remove colors from `$theme-colors`, or any other map, use `map-remove`. Be aware you must insert it between our requirements and options:
-{% highlight scss %}
+{{< highlight scss >}}
// Required
@import "../node_modules/bootstrap/scss/functions";
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/reboot";
@import "../node_modules/bootstrap/scss/type";
...
-{% endhighlight %}
+{{< /highlight >}}
#### Required keys
Bootstrap utilizes several Sass functions, but only a subset are applicable to general theming. We've included three functions for getting values from the color maps:
-{% highlight scss %}
+{{< highlight scss >}}
@function color($key: "blue") {
@return map-get($colors, $key);
}
@function gray($key: "100") {
@return map-get($grays, $key);
}
-{% endhighlight %}
+{{< /highlight >}}
These allow you to pick one color from a Sass map much like how you'd use a color variable from v3.
-{% highlight scss %}
+{{< highlight scss >}}
.custom-element {
color: gray("100");
background-color: theme-color("dark");
}
-{% endhighlight %}
+{{< /highlight >}}
We also have another function for getting a particular _level_ of color from the `$theme-colors` map. Negative level values will lighten the color, while higher levels will darken.
-{% highlight scss %}
+{{< highlight scss >}}
@function theme-color-level($color-name: "primary", $level: 0) {
$color: theme-color($color-name);
$color-base: if($level > 0, #000, #fff);
@return mix($color-base, $color, $level * $theme-color-interval);
}
-{% endhighlight %}
+{{< /highlight >}}
In practice, you'd call the function and pass in two parameters: the name of the color from `$theme-colors` (e.g., primary or danger) and a numeric level.
-{% highlight scss %}
+{{< highlight scss >}}
.custom-element {
color: theme-color-level(primary, -10);
}
-{% endhighlight %}
+{{< /highlight >}}
Additional functions could be added in the future or your own custom Sass to create level functions for additional Sass maps, or even a generic one if you wanted to be more verbose.
For example, to generate color swatches from our `$theme-colors` map:
-{% highlight scss %}
+{{< highlight scss >}}
@each $color, $value in $theme-colors {
.swatch-#{$color} {
color: color-yiq($value);
}
}
-{% endhighlight %}
+{{< /highlight >}}
It can also be used for one-off contrast needs:
-{% highlight scss %}
+{{< highlight scss >}}
.custom-element {
color: color-yiq(#000); // returns `color: #fff`
}
-{% endhighlight %}
+{{< /highlight >}}
You can also specify a base color with our color map functions:
-{% highlight scss %}
+{{< highlight scss >}}
.custom-element {
color: color-yiq(theme-color("dark")); // returns `color: #fff`
}
-{% endhighlight %}
+{{< /highlight >}}
## Sass options
| Variable | Values | Description |
| -------------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------- |
-| `$spacer` | `1rem` (default), or any value > 0 | Specifies the default spacer value to programmatically generate our [spacer utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/). |
+| `$spacer` | `1rem` (default), or any value > 0 | Specifies the default spacer value to programmatically generate our [spacer utilities](/docs/{{< param docs_version >}}/utilities/spacing/). |
| `$enable-rounded` | `true` (default) or `false` | Enables predefined `border-radius` styles on various components. |
| `$enable-shadows` | `true` or `false` (default) | Enables predefined `box-shadow` styles on various components. |
| `$enable-gradients` | `true` or `false` (default) | Enables predefined gradients via `background-image` styles on various components. |
| `$enable-transitions` | `true` (default) or `false` | Enables predefined `transition`s on various components. |
-| `$enable-prefers-reduced-motion-media-query` | `true` (default) or `false` | Enables the [`prefers-reduced-motion` media query]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/accessibility/#reduced-motion), which suppresses certain animations/transitions based on the users' browser/operating system preferences. |
+| `$enable-prefers-reduced-motion-media-query` | `true` (default) or `false` | Enables the [`prefers-reduced-motion` media query](/docs/{{< param docs_version >}}/getting-started/accessibility/#reduced-motion), which suppresses certain animations/transitions based on the users' browser/operating system preferences. |
| `$enable-hover-media-query` | `true` or `false` (default) | **Deprecated** |
| `$enable-grid-classes` | `true` (default) or `false` | Enables the generation of CSS classes for the grid system (e.g., `.container`, `.row`, `.col-md-1`, etc.). |
| `$enable-caret` | `true` (default) or `false` | Enables pseudo element caret on `.dropdown-toggle`. |
| `$enable-pointer-cursor-for-buttons` | `true` (default) or `false` | Add "hand" cursor to non-disabled button elements. |
| `$enable-print-styles` | `true` (default) or `false` | Enables styles for optimizing printing. |
-| `$enable-responsive-font-sizes` | `true` or `false` (default) | Enables [responsive font sizes]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/typography/#responsive-font-sizes). |
+| `$enable-responsive-font-sizes` | `true` or `false` (default) | Enables [responsive font sizes](/docs/{{< param docs_version >}}/content/typography/#responsive-font-sizes). |
| `$enable-validation-icons` | `true` (default) or `false` | Enables `background-image` icons within textual inputs and some custom forms for validation states. |
| `$enable-deprecation-messages` | `true` or `false` (default) | Set to `true` to show warnings when using any of the deprecated mixins and functions that are planned to be removed in `v5`. |
All colors available in Bootstrap 4, are available as Sass variables and a Sass map in `scss/_variables.scss` file. This will be expanded upon in subsequent minor releases to add additional shades, much like the [grayscale palette](#grays) we already include.
<div class="row">
- {% for color in site.data.colors %}
- {% unless color.name == "white" or color.name == "gray" or color.name == "gray-dark" %}
+ {{< theme-colors.inline >}}
+ {{- range $.Site.Data.colors }}
+ {{- if (and (not (eq .name "white")) (not (eq .name "gray")) (not (eq .name "gray-dark"))) }}
<div class="col-md-4">
- <div class="p-3 mb-3 swatch-{{ color.name }}">{{ color.name | capitalize }}</div>
+ <div class="p-3 mb-3 swatch-{{ .name }}">{{ .name | title }}</div>
</div>
- {% endunless %}
- {% endfor %}
+ {{ end -}}
+ {{ end -}}
+ {{< /theme-colors.inline >}}
</div>
Here's how you can use these in your Sass:
-{% highlight scss %}
+{{< highlight scss >}}
// With variable
.alpha { color: $purple; }
// From the Sass map with our `color()` function
.beta { color: color("purple"); }
-{% endhighlight %}
+{{< /highlight >}}
-[Color utility classes]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/) are also available for setting `color` and `background-color`.
+[Color utility classes](/docs/{{< param docs_version >}}/utilities/colors/) are also available for setting `color` and `background-color`.
-{% capture callout %}
+{{< callout info >}}
In the future, we'll aim to provide Sass maps and variables for shades of each color as we've done with the grayscale colors below.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
### Theme colors
We use a subset of all colors to create a smaller color palette for generating color schemes, also available as Sass variables and a Sass map in Bootstraps's `scss/_variables.scss` file.
<div class="row">
- {% for color in site.data.theme-colors %}
+ {{< theme-colors.inline >}}
+ {{- range (index $.Site.Data "theme-colors") }}
<div class="col-md-4">
- <div class="p-3 mb-3 swatch-{{ color.name }}">{{ color.name | capitalize }}</div>
+ <div class="p-3 mb-3 swatch-{{ .name }}">{{ .name | title }}</div>
</div>
- {% endfor %}
+ {{ end -}}
+ {{< /theme-colors.inline >}}
</div>
### Grays
<div class="row mb-3">
<div class="col-md-4">
- {% for color in site.data.grays %}
- <div class="p-3 swatch-{{ color.name }}">{{ color.name | capitalize }}</div>
- {% endfor %}
+ {{< theme-colors.inline >}}
+ {{- range $.Site.Data.grays }}
+ <div class="p-3 swatch-{{ .name }}">{{ .name }}</div>
+ {{ end -}}
+ {{< /theme-colors.inline >}}
</div>
</div>
Within `scss/_variables.scss`, you'll find Bootstrap's color variables and Sass map. Here's an example of the `$colors` Sass map:
-{% highlight scss %}
+{{< highlight scss >}}
$colors: (
"blue": $blue,
"indigo": $indigo,
"gray": $gray-600,
"gray-dark": $gray-800
) !default;
-{% endhighlight %}
+{{< /highlight >}}
Add, remove, or modify values within the map to update how they're used in many other components. Unfortunately at this time, not _every_ component utilizes this Sass map. Future updates will strive to improve upon this. Until then, plan on making use of the `${color}` variables and this Sass map.
Here are two examples of how we loop over the `$theme-colors` map to generate modifiers to the `.alert` component and all our `.bg-*` background utilities.
-{% highlight scss %}
+{{< highlight scss >}}
// Generate alert modifier classes
@each $color, $value in $theme-colors {
.alert-#{$color} {
@each $color, $value in $theme-colors {
@include bg-variant('.bg-#{$color}', $value);
}
-{% endhighlight %}
+{{< /highlight >}}
### Responsive
These Sass loops aren't limited to color maps, either. You can also generate responsive variations of your components or utilities. Take for example our responsive text alignment utilities where we mix an `@each` loop for the `$grid-breakpoints` Sass map with a media query include.
-{% highlight scss %}
+{{< highlight scss >}}
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.text#{$infix}-center { text-align: center !important; }
}
}
-{% endhighlight %}
+{{< /highlight >}}
Should you need to modify your `$grid-breakpoints`, your changes will apply to all the loops iterating over that map.
Here are the variables we include (note that the `:root` is required). They're located in our `_root.scss` file.
-{% highlight css %}
+{{< highlight css >}}
:root {
--blue: #007bff;
--indigo: #6610f2;
--font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
-{% endhighlight %}
+{{< /highlight >}}
### Examples
CSS variables offer similar flexibility to Sass's variables, but without the need for compilation before being served to the browser. For example, here we're resetting our page's font and link styles with CSS variables.
-{% highlight css %}
+{{< highlight css >}}
body {
font: 1rem/1.5 var(--font-family-sans-serif);
}
a {
color: var(--blue);
}
-{% endhighlight %}
+{{< /highlight >}}
### Breakpoint variables
Here's an example of **what's not supported:**
-{% highlight css %}
+{{< highlight css >}}
@media (min-width: var(--breakpoint-sm)) {
...
}
-{% endhighlight %}
+{{< /highlight >}}
And here's an example of **what is supported:**
-{% highlight css %}
+{{< highlight css >}}
@media (min-width: 768px) {
.custom-element {
color: var(--primary);
}
}
-{% endhighlight %}
+{{< /highlight >}}
## Installing Bootstrap
-[Install bootstrap]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/download/#npm) as a Node.js module using npm.
+[Install bootstrap](/docs/{{< param docs_version >}}/getting-started/download/#npm) as a Node.js module using npm.
## Importing JavaScript
-Import [Bootstrap's JavaScript]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/) by adding this line to your app's entry point (usually `index.js` or `app.js`):
+Import [Bootstrap's JavaScript](/docs/{{< param docs_version >}}/getting-started/javascript/) by adding this line to your app's entry point (usually `index.js` or `app.js`):
-{% highlight js %}
+{{< highlight js >}}
import 'bootstrap';
-{% endhighlight %}
+{{< /highlight >}}
Alternatively, you may **import plugins individually** as needed:
-{% highlight js %}
+{{< highlight js >}}
import 'bootstrap/js/dist/alert';
...
-{% endhighlight %}
+{{< /highlight >}}
Bootstrap dependends on [Popper](https://popper.js.org/), which is speicified in the `peerDependencies` property.
This means that you will have to make sure to add both of them to your `package.json` using `npm install popper.js`.
To enjoy the full potential of Bootstrap and customize it to your needs, use the source files as a part of your project's bundling process.
-First, create your own `_custom.scss` and use it to override the [built-in custom variables]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/theming/). Then, use your main Sass file to import your custom variables, followed by Bootstrap:
+First, create your own `_custom.scss` and use it to override the [built-in custom variables](/docs/{{< param docs_version >}}/getting-started/theming/). Then, use your main Sass file to import your custom variables, followed by Bootstrap:
-{% highlight scss %}
+{{< highlight scss >}}
@import "custom";
@import "~bootstrap/scss/bootstrap";
-{% endhighlight %}
+{{< /highlight >}}
For Bootstrap to compile, make sure you install and use the required loaders: [sass-loader](https://github.com/webpack-contrib/sass-loader), [postcss-loader](https://github.com/postcss/postcss-loader) with [Autoprefixer](https://github.com/postcss/autoprefixer#webpack). With minimal setup, your webpack config should include this rule or similar:
-{% highlight js %}
+{{< highlight js >}}
...
{
test: /\.(scss)$/,
}]
},
...
-{% endhighlight %}
+{{< /highlight >}}
### Importing Compiled CSS
Alternatively, you may use Bootstrap's ready-to-use CSS by simply adding this line to your project's entry point:
-{% highlight js %}
+{{< highlight js >}}
import 'bootstrap/dist/css/bootstrap.min.css';
-{% endhighlight %}
+{{< /highlight >}}
In this case you may use your existing rule for `css` without any special modifications to webpack config, except you don't need `sass-loader` just [style-loader](https://github.com/webpack-contrib/style-loader) and [css-loader](https://github.com/webpack-contrib/css-loader).
-{% highlight js %}
+{{< highlight js >}}
...
module: {
rules: [
]
}
...
-{% endhighlight %}
+{{< /highlight >}}
**New to or unfamiliar with flexbox?** [Read this CSS Tricks flexbox guide](https://css-tricks.com/snippets/css/a-guide-to-flexbox/#flexbox-background) for background, terminology, guidelines, and code snippets.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-sm">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
The above example creates three equal-width columns on small, medium, large, and extra large devices using our predefined grid classes. Those columns are centered in the page with the parent `.container`.
- Column classes indicate the number of columns you'd like to use out of the possible 12 per row. So, if you want three equal-width columns across, you can use `.col-4`.
- Column `width`s are set in percentages, so they're always fluid and sized relative to their parent element.
- Columns have horizontal `padding` to create the gutters between individual columns, however, you can remove the `margin` from rows and `padding` from columns with `.no-gutters` on the `.row`.
-- To make the grid responsive, there are five grid breakpoints, one for each [responsive breakpoint]({{ site.baseurl }}/docs/{{ site.docs_version }}/layout/overview/#responsive-breakpoints): all breakpoints (extra small), small, medium, large, and extra large.
+- To make the grid responsive, there are five grid breakpoints, one for each [responsive breakpoint](/docs/{{< param docs_version >}}/layout/overview/#responsive-breakpoints): all breakpoints (extra small), small, medium, large, and extra large.
- Grid breakpoints are based on minimum width media queries, meaning **they apply to that one breakpoint and all those above it** (e.g., `.col-sm-4` applies to small, medium, large, and extra large devices, but not the first `xs` breakpoint).
- You can use predefined grid classes (like `.col-4`) or [Sass mixins](#sass-mixins) for more semantic markup.
For example, here are two grid layouts that apply to every device and viewport, from `xs` to `xl`. Add any number of unit-less classes for each breakpoint you need and every column will be the same width.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
Equal-width columns can be broken into multiple lines, but there was a [Safari flexbox bug](https://github.com/philipwalton/flexbugs#flexbug-11) that prevented this from working without an explicit `flex-basis` or `border`. There are workarounds for older browser versions, but they shouldn't be necessary if you're up-to-date.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col">Column</div>
<div class="col">Column</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Setting one column width
Auto-layout for flexbox grid columns also means you can set the width of one column and have the sibling columns automatically resize around it. You may use predefined grid classes (as shown below), grid mixins, or inline widths. Note that the other columns will resize no matter the width of the center column.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Variable width content
Use `col-{breakpoint}-auto` classes to size columns based on the natural width of their content.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row justify-content-md-center">
<div class="col col-lg-2">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Equal-width multi-row
-Create equal-width columns that span multiple rows by inserting a `.w-100` where you want the columns to break to a new line. Make the breaks responsive by mixing the `.w-100` with some [responsive display utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/).
+Create equal-width columns that span multiple rows by inserting a `.w-100` where you want the columns to break to a new line. Make the breaks responsive by mixing the `.w-100` with some [responsive display utilities](/docs/{{< param docs_version >}}/utilities/display/).
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col">col</div>
<div class="col">col</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
## Responsive classes
For grids that are the same from the smallest of devices to the largest, use the `.col` and `.col-*` classes. Specify a numbered class when you need a particularly sized column; otherwise, feel free to stick to `.col`.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col">col</div>
<div class="col-4">col-4</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Stacked to horizontal
Using a single set of `.col-sm-*` classes, you can create a basic grid system that starts out stacked and becomes horizontal at the small breakpoint (`sm`).
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-sm-8">col-sm-8</div>
<div class="col-sm">col-sm</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Mix and match
Don't want your columns to simply stack in some grid tiers? Use a combination of different classes for each tier as needed. See the example below for a better idea of how it all works.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
<div class="col-6">.col-6</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Gutters
Here's an example of customizing the Bootstrap grid at the large (`lg`) breakpoint and above. We've increased the `.col` padding with `.px-lg-5`, counteracted that with `.mx-lg-n5` on the parent `.row` and then adjusted the `.container` wrapper with `.px-lg-5`.
-{% capture example %}
+{{< example >}}
<div class="container px-lg-5">
<div class="row mx-lg-n5">
<div class="col py-3 px-lg-5 border bg-light">Custom column padding</div>
<div class="col py-3 px-lg-5 border bg-light">Custom column padding</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Alignment
### Vertical alignment
<div class="bd-example-row bd-example-row-flex-cols">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row align-items-start">
<div class="col">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
<div class="bd-example-row bd-example-row-flex-cols">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col align-self-start">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Horizontal alignment
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row justify-content-start">
<div class="col-4">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### No gutters
The gutters between columns in our predefined grid classes can be removed with `.no-gutters`. This removes the negative `margin`s from `.row` and the horizontal `padding` from all immediate children columns.
-Here's the source code for creating these styles. Note that column overrides are scoped to only the first children columns and are targeted via [attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors). While this generates a more specific selector, column padding can still be further customized with [spacing utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/).
+Here's the source code for creating these styles. Note that column overrides are scoped to only the first children columns and are targeted via [attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors). While this generates a more specific selector, column padding can still be further customized with [spacing utilities](/docs/{{< param docs_version >}}/utilities/spacing/).
**Need an edge-to-edge design?** Drop the parent `.container` or `.container-fluid`.
-{% highlight sass %}
+{{< highlight scss >}}
.no-gutters {
margin-right: 0;
margin-left: 0;
padding-left: 0;
}
}
-{% endhighlight %}
+{{< /highlight >}}
In practice, here's how it looks. Note you can continue to use this with all other predefined grid classes (including column widths, responsive tiers, reorders, and more).
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="row no-gutters">
<div class="col-12 col-sm-6 col-md-8">.col-12 .col-sm-6 .col-md-8</div>
<div class="col-6 col-md-4">.col-6 .col-md-4</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Column wrapping
If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-9">.col-9</div>
<div class="col-6">.col-6<br>Subsequent columns continue along the new line.</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Column breaks
Breaking columns to a new line in flexbox requires a small hack: add an element with `width: 100%` wherever you want to wrap your columns to a new line. Normally this is accomplished with multiple `.row`s, but not every implementation method can account for this.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
-You may also apply this break at specific breakpoints with our [responsive display utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/).
+You may also apply this break at specific breakpoints with our [responsive display utilities](/docs/{{< param docs_version >}}/utilities/display/).
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
## Reordering
Use `.order-` classes for controlling the **visual order** of your content. These classes are responsive, so you can set the `order` by breakpoint (e.g., `.order-1.order-md-2`). Includes support for `1` through `12` across all five grid tiers.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
There are also responsive `.order-first` and `.order-last` classes that change the `order` of an element by applying `order: -1` and `order: 13` (`order: $columns + 1`), respectively. These classes can also be intermixed with the numbered `.order-*` classes as needed.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col order-last">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Offsetting columns
-You can offset grid columns in two ways: our responsive `.offset-` grid classes and our [margin utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/). Grid classes are sized to match columns while margins are more useful for quick layouts where the width of the offset is variable.
+You can offset grid columns in two ways: our responsive `.offset-` grid classes and our [margin utilities](/docs/{{< param docs_version >}}/utilities/spacing/). Grid classes are sized to match columns while margins are more useful for quick layouts where the width of the offset is variable.
#### Offset classes
Move columns to the right using `.offset-md-*` classes. These classes increase the left margin of a column by `*` columns. For example, `.offset-md-4` moves `.col-md-4` over four columns.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-6 offset-md-3">.col-md-6 .offset-md-3</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
-In addition to column clearing at responsive breakpoints, you may need to reset offsets. See this in action in [the grid example]({{ site.baseurl }}/docs/{{ site.docs_version }}/examples/grid/).
+In addition to column clearing at responsive breakpoints, you may need to reset offsets. See this in action in [the grid example](/docs/{{< param docs_version >}}/examples/grid/).
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
<div class="col-sm-6 col-md-5 offset-md-2 col-lg-6 offset-lg-0">.col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
#### Margin utilities
With the move to flexbox in v4, you can use margin utilities like `.mr-auto` to force sibling columns away from one another.
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-auto">.col-auto</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
## Nesting
To nest your content with the default grid, add a new `.row` and set of `.col-sm-*` columns within an existing `.col-sm-*` column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns).
<div class="bd-example-row">
-{% capture example %}
+{{< example >}}
<div class="container">
<div class="row">
<div class="col-sm-9">
</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
## Sass mixins
Variables and maps determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.
-{% highlight scss %}
+{{< highlight scss >}}
$grid-columns: 12;
$grid-gutter-width: 30px;
lg: 960px,
xl: 1140px
);
-{% endhighlight %}
+{{< /highlight >}}
### Mixins
Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.
-{% highlight scss %}
+{{< highlight scss >}}
// Creates a wrapper for a series of columns
@include make-row();
// Get fancy by offsetting, or changing the sort order
@include make-col-offset($size, $columns: $grid-columns);
-{% endhighlight %}
+{{< /highlight >}}
### Example usage
You can modify the variables to your own custom values, or just use the mixins with their default values. Here's an example of using the default settings to create a two-column layout with a gap between.
-{% highlight scss %}
+{{< highlight scss >}}
.example-container {
width: 800px;
@include make-container();
@include make-col(4);
}
}
-{% endhighlight %}
+{{< /highlight >}}
-{% capture example %}
+{{< example >}}
<div class="example-container">
<div class="example-row">
<div class="example-content-main">Main content</div>
<div class="example-content-secondary">Secondary content</div>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Customizing the grid
The number of grid columns can be modified via Sass variables. `$grid-columns` is used to generate the widths (in percent) of each individual column while `$grid-gutter-width` sets the width for the column gutters.
-{% highlight scss %}
+{{< highlight scss >}}
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
-{% endhighlight %}
+{{< /highlight >}}
### Grid tiers
Moving beyond the columns themselves, you may also customize the number of grid tiers. If you wanted just four grid tiers, you'd update the `$grid-breakpoints` and `$container-max-widths` to something like this:
-{% highlight scss %}
+{{< highlight scss >}}
$grid-breakpoints: (
xs: 0,
sm: 480px,
md: 720px,
lg: 960px
);
-{% endhighlight %}
+{{< /highlight >}}
When making any changes to the Sass variables or maps, you'll need to save your changes and recompile. Doing so will output a brand new set of predefined grid classes for column widths, offsets, and ordering. Responsive visibility utilities will also be updated to use the custom breakpoints. Make sure to set grid values in `px` (not `rem`, `em`, or `%`).
title: Overview
description: Components and options for laying out your Bootstrap project, including wrapping containers, a powerful grid system, a flexible media object, and responsive utility classes.
group: layout
-redirect_from: "/docs/4.3/layout/"
+aliases: "/docs/4.3/layout/"
toc: true
---
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="container">
<!-- Content here -->
</div>
-{% endhighlight %}
+{{< /highlight >}}
Use `.container-fluid` for a full width container, spanning the entire width of the viewport.
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="container-fluid">
...
</div>
-{% endhighlight %}
+{{< /highlight >}}
## Responsive breakpoints
Bootstrap primarily uses the following media query ranges—or breakpoints—in our source Sass files for our layout, grid system, and components.
-{% highlight scss %}
+{{< highlight scss >}}
// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
-{% endhighlight %}
+{{< /highlight >}}
Since we write our source CSS in Sass, all our media queries are available via Sass mixins:
-{% highlight scss %}
+{{< highlight scss >}}
// No media query necessary for xs breakpoint as it's effectively `@media (min-width: 0) { ... }`
@include media-breakpoint-up(sm) { ... }
@include media-breakpoint-up(md) { ... }
display: block;
}
}
-{% endhighlight %}
+{{< /highlight >}}
We occasionally use media queries that go in the other direction (the given screen size *or smaller*):
-{% highlight scss %}
+{{< highlight scss >}}
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width
-{% endhighlight %}
+{{< /highlight >}}
-{% include callout-info-mediaqueries-breakpoints.md %}
+{{< callout info >}}
+{{< partial "callout-info-mediaqueries-breakpoints.md" >}}
+{{< /callout >}}
Once again, these media queries are also available via Sass mixins:
-{% highlight scss %}
+{{< highlight scss >}}
@include media-breakpoint-down(xs) { ... }
@include media-breakpoint-down(sm) { ... }
@include media-breakpoint-down(md) { ... }
display: block;
}
}
-{% endhighlight %}
+{{< /highlight >}}
There are also media queries and mixins for targeting a single segment of screen sizes using the minimum and maximum breakpoint widths.
-{% highlight scss %}
+{{< highlight scss >}}
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
-{% endhighlight %}
+{{< /highlight >}}
These media queries are also available via Sass mixins:
-{% highlight scss %}
+{{< highlight scss >}}
@include media-breakpoint-only(xs) { ... }
@include media-breakpoint-only(sm) { ... }
@include media-breakpoint-only(md) { ... }
@include media-breakpoint-only(lg) { ... }
@include media-breakpoint-only(xl) { ... }
-{% endhighlight %}
+{{< /highlight >}}
Similarly, media queries may span multiple breakpoint widths:
-{% highlight scss %}
+{{< highlight scss >}}
// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199.98px) { ... }
-{% endhighlight %}
+{{< /highlight >}}
The Sass mixin for targeting the same screen size range would be:
-{% highlight scss %}
+{{< highlight scss >}}
@include media-breakpoint-between(md, xl) { ... }
-{% endhighlight %}
+{{< /highlight >}}
## Z-index
We don't encourage customization of these individual values; should you change one, you likely need to change them all.
-{% highlight scss %}
+{{< highlight scss >}}
$zindex-dropdown: 1000 !default;
$zindex-sticky: 1020 !default;
$zindex-fixed: 1030 !default;
$zindex-modal: 1050 !default;
$zindex-popover: 1060 !default;
$zindex-tooltip: 1070 !default;
-{% endhighlight %}
+{{< /highlight >}}
To handle overlapping borders within components (e.g., buttons and inputs in input groups), we use low single digit `z-index` values of `1`, `2`, and `3` for default, hover, and active states. On hover/focus/active, we bring a particular element to the forefront with a higher `z-index` value to show their border over the sibling elements.
--- /dev/null
+---
+layout: docs
+title: Utilities for layout
+description: For faster mobile-friendly and responsive development, Bootstrap includes dozens of utility classes for showing, hiding, aligning, and spacing content.
+group: layout
+toc: true
+---
+
+## Changing `display`
+
+Use our [display utilities](/docs/{{< param docs_version >}}/utilities/display/) for responsively toggling common values of the `display` property. Mix it with our grid system, content, or components to show or hide them across specific viewports.
+
+## Flexbox options
+
+Bootstrap 4 is built with flexbox, but not every element's `display` has been changed to `display: flex` as this would add many unnecessary overrides and unexpectedly change key browser behaviors. Most of [our components](/docs/{{< param docs_version >}}/components/alerts/) are built with flexbox enabled.
+
+Should you need to add `display: flex` to an element, do so with `.d-flex` or one of the responsive variants (e.g., `.d-sm-flex`). You'll need this class or `display` value to allow the use of our extra [flexbox utilities](/docs/{{< param docs_version >}}/utilities/flex/) for sizing, alignment, spacing, and more.
+
+## Margin and padding
+
+Use the `margin` and `padding` [spacing utilities](/docs/{{< param docs_version >}}/utilities/spacing/) to control how elements and components are spaced and sized. Bootstrap 4 includes a five-level scale for spacing utilities, based on a `1rem` value default `$spacer` variable. Choose values for all viewports (e.g., `.mr-3` for `margin-right: 1rem`), or pick responsive variants to target specific viewports (e.g., `.mr-md-3` for `margin-right: 1rem` starting at the `md` breakpoint).
+
+## Toggle `visibility`
+
+When toggling `display` isn't needed, you can toggle the `visibility` of an element with our [visibility utilities](/docs/{{< param docs_version >}}/utilities/visibility/). Invisible elements will still affect the layout of the page, but are visually hidden from visitors.
title: Migrating to v4
description: Bootstrap 4 is a major rewrite of the entire project. The most notable changes are summarized below, followed by more specific changes to relevant components.
group: migration
-redirect_from: "/migration/"
+aliases: "/migration/"
toc: true
---
- Build system overhauled to use a series of npm scripts instead of Grunt. See `package.json` for all scripts, or our project readme for local development needs.
- Non-responsive usage of Bootstrap is no longer supported.
- Dropped the online Customizer in favor of more extensive setup documentation and customized builds.
-- Added dozens of new [utility classes]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/) for common CSS property-value pairs and margin/padding spacing shortcuts.
+- Added dozens of new [utility classes](/docs/{{< param docs_version >}}/utilities/) for common CSS property-value pairs and margin/padding spacing shortcuts.
### Grid system
### Components
-- **Dropped panels, thumbnails, and wells** for a new all-encompassing component, [cards]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/card/).
+- **Dropped panels, thumbnails, and wells** for a new all-encompassing component, [cards](/docs/{{< param docs_version >}}/components/card/).
- **Dropped the Glyphicons icon font.** If you need icons, some options are:
- the upstream version of [Glyphicons](https://www.glyphicons.com/)
- [Octicons](https://octicons.github.com/)
- [Font Awesome](https://fontawesome.com/)
- - See the [Extend page]({{ site.baseurl }}/docs/{{ site.docs_version }}/extend/icons/) for a list of alternatives. Have additional suggestions? Please open an issue or PR.
+ - See the [Extend page](/docs/{{< param docs_version >}}/extend/icons/) for a list of alternatives. Have additional suggestions? Please open an issue or PR.
- **Dropped the Affix jQuery plugin.**
- We recommend using `position: sticky` instead. [See the HTML5 Please entry](https://html5please.com/#sticky) for details and specific polyfill recommendations. One suggestion is to use an `@supports` rule for implementing it (e.g., `@supports (position: sticky) { ... }`)
- If you were using Affix to apply additional, non-`position` styles, the polyfills might not support your use case. One option for such uses is the third-party [ScrollPos-Styler](https://github.com/acch/scrollpos-styler) library.
### Reboot
-New to Bootstrap 4 is the [Reboot]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/reboot/), a new stylesheet that builds on Normalize with our own somewhat opinionated reset styles. Selectors appearing in this file only use elements—there are no classes here. This isolates our reset styles from our component styles for a more modular approach. Some of the most important resets this includes are the `box-sizing: border-box` change, moving from `em` to `rem` units on many elements, link styles, and many form element resets.
+New to Bootstrap 4 is the [Reboot](/docs/{{< param docs_version >}}/content/reboot/), a new stylesheet that builds on Normalize with our own somewhat opinionated reset styles. Selectors appearing in this file only use elements—there are no classes here. This isolates our reset styles from our component styles for a more modular approach. Some of the most important resets this includes are the `box-sizing: border-box` change, moving from `em` to `rem` units on many elements, link styles, and many form element resets.
### Typography
- Renamed `.btn-default` to `.btn-secondary`.
- Dropped the `.btn-xs` class entirely as `.btn-sm` is proportionally much smaller than v3's.
-- The [stateful button]({{ site.url }}/docs/3.3/javascript/#buttons-stateful) feature of the `button.js` jQuery plugin has been dropped. This includes the `$().button(string)` and `$().button('reset')` methods. We advise using a tiny bit of custom JavaScript instead, which will have the benefit of behaving exactly the way you want it to.
+- The [stateful button]({{< abs.inline >}}{{ printf "%s/docs/3.3/javascript/#buttons-stateful" $.Site.BaseURL }}{{< /abs.inline >}}) feature of the `button.js` jQuery plugin has been dropped. This includes the `$().button(string)` and `$().button('reset')` methods. We advise using a tiny bit of custom JavaScript instead, which will have the benefit of behaving exactly the way you want it to.
- Note that the other features of the plugin (button checkboxes, button radios, single-toggle buttons) have been retained in v4.
- Change buttons' `[disabled]` to `:disabled` as IE9+ supports `:disabled`. However `fieldset[disabled]` is still necessary because [native disabled fieldsets are still buggy in IE11](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset#Browser_compatibility).
- Responsive navbar behaviors are now applied to the `.navbar` class via the **required** `.navbar-expand-{breakpoint}` where you choose where to collapse the navbar. Previously this was a Less variable modification and required recompiling.
- `.navbar-default` is now `.navbar-light`, though `.navbar-dark` remains the same. **One of these is required on each navbar.** However, these classes no longer set `background-color`s; instead they essentially only affect `color`.
-- Navbars now require a background declaration of some kind. Choose from our background utilities (`.bg-*`) or set your own with the light/inverse classes above [for mad customization]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/navbar/#color-schemes).
+- Navbars now require a background declaration of some kind. Choose from our background utilities (`.bg-*`) or set your own with the light/inverse classes above [for mad customization](/docs/{{< param docs_version >}}/components/navbar/#color-schemes).
- Given flexbox styles, navbars can now use flexbox utilities for easy alignment options.
- `.navbar-toggle` is now `.navbar-toggler` and has different styles and inner markup (no more three `<span>`s).
- Dropped the `.navbar-form` class entirely. It's no longer necessary; instead, just use `.form-inline` and apply margin utilities as necessary.
- `.panel-default` removed and no replacement.
- `.panel-group` removed and no replacement. `.card-group` is not a replacement, it is different.
- `.panel-heading` to `.card-header`
-- `.panel-title` to `.card-title`. Depending on the desired look, you may also want to use [heading elements or classes]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/typography/#headings) (e.g. `<h3>`, `.h3`) or bold elements or classes (e.g. `<strong>`, `<b>`, [`.font-weight-bold`]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/text/#font-weight-and-italics)). Note that `.card-title`, while similarly named, produces a different look than `.panel-title`.
+- `.panel-title` to `.card-title`. Depending on the desired look, you may also want to use [heading elements or classes](/docs/{{< param docs_version >}}/content/typography/#headings) (e.g. `<h3>`, `.h3`) or bold elements or classes (e.g. `<strong>`, `<b>`, [`.font-weight-bold`](/docs/{{< param docs_version >}}/utilities/text/#font-weight-and-italics)). Note that `.card-title`, while similarly named, produces a different look than `.panel-title`.
- `.panel-body` to `.card-body`
- `.panel-footer` to `.card-footer`
- `.panel-primary`, `.panel-success`, `.panel-info`, `.panel-warning`, and `.panel-danger` have been dropped for `.bg-`, `.text-`, and `.border` utilities generated from our `$theme-colors` Sass map.
- **Display, hidden, and more:**
- Made display utilities responsive (e.g., `.d-none` and `d-{sm,md,lg,xl}-none`).
- - Dropped the bulk of `.hidden-*` utilities for new [display utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/). For example, instead of `.hidden-sm-up`, use `.d-sm-none`. Renamed the `.hidden-print` utilities to use the display utility naming scheme. More info under the [Responsive utilities](#responsive-utilities) section of this page.
+ - Dropped the bulk of `.hidden-*` utilities for new [display utilities](/docs/{{< param docs_version >}}/utilities/display/). For example, instead of `.hidden-sm-up`, use `.d-sm-none`. Renamed the `.hidden-print` utilities to use the display utility naming scheme. More info under the [Responsive utilities](#responsive-utilities) section of this page.
- Added `.float-{sm,md,lg,xl}-{left,right,none}` classes for responsive floats and removed `.pull-left` and `.pull-right` since they're redundant to `.float-left` and `.float-right`.
- **Type:**
- Added responsive variations to our text alignment classes `.text-{sm,md,lg,xl}-{left,center,right}`.
- **Alignment and spacing:**
- - Added new [responsive margin and padding utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) for all sides, plus vertical and horizontal shorthands.
- - Added boatload of [flexbox utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/).
+ - Added new [responsive margin and padding utilities](/docs/{{< param docs_version >}}/utilities/spacing/) for all sides, plus vertical and horizontal shorthands.
+ - Added boatload of [flexbox utilities](/docs/{{< param docs_version >}}/utilities/flex/).
- Dropped `.center-block` for the new `.mx-auto` class.
- Clearfix updated to drop support for older browser versions.
Our documentation received an upgrade across the board as well. Here's the low down:
- We're still using Jekyll, but we have plugins in the mix:
- - `bugify.rb` is used to efficiently list out the entries on our [browser bugs]({{ site.baseurl }}/docs/{{ site.docs_version }}/browser-bugs/) page.
+ - `bugify.rb` is used to efficiently list out the entries on our [browser bugs](/docs/{{< param docs_version >}}/browser-bugs/) page.
- `example.rb` is a custom fork of the default `highlight.rb` plugin, allowing for easier example-code handling.
- `callout.rb` is a similar custom fork of that, but designed for our special docs callouts.
- [jekyll-toc](https://github.com/toshimaru/jekyll-toc) is used to generate our table of contents.
title: Borders
description: Use border utilities to quickly style the border and border-radius of an element. Great for images, buttons, or any other element.
group: utilities
-redirect_from: "/docs/4.3/utilities/"
+aliases: "/docs/4.3/utilities/"
toc: true
---
### Additive
<div class="bd-example-border-utils">
-{% capture example %}
+{{< example >}}
<span class="border"></span>
<span class="border-top"></span>
<span class="border-right"></span>
<span class="border-bottom"></span>
<span class="border-left"></span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
### Subtractive
<div class="bd-example-border-utils bd-example-border-utils-0">
-{% capture example %}
+{{< example >}}
<span class="border-0"></span>
<span class="border-top-0"></span>
<span class="border-right-0"></span>
<span class="border-bottom-0"></span>
<span class="border-left-0"></span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
## Border color
Change the border color using utilities built on our theme colors.
<div class="bd-example-border-utils">
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<span class="border border-{{ color.name }}"></span>{% endfor %}
+{{< example >}}
+{{< border.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<span class="border border-{{ .name }}"></span>
+{{- end -}}
+{{< /border.inline >}}
<span class="border border-white"></span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
</div>
## Border-radius
Add classes to an element to easily round its corners.
<div class="bd-example bd-example-images">
- {%- include icons/placeholder.svg width="75" height="75" class="rounded" title="Example rounded image" -%}
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-top" title="Example top rounded image" -%}
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-right" title="Example right rounded image" -%}
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-bottom" title="Example bottom rounded image" -%}
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-left" title="Example left rounded image" -%}
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-circle" title="Completely round image" -%}
- {%- include icons/placeholder.svg width="150" height="75" class="rounded-pill" title="Rounded pill image" -%}
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-0" title="Example non-rounded image (overrides rounding applied elsewhere)" -%}
+ {{< placeholder width="75" height="75" class="rounded" title="Example rounded image" >}}
+ {{< placeholder width="75" height="75" class="rounded-top" title="Example top rounded image" >}}
+ {{< placeholder width="75" height="75" class="rounded-right" title="Example right rounded image" >}}
+ {{< placeholder width="75" height="75" class="rounded-bottom" title="Example bottom rounded image" >}}
+ {{< placeholder width="75" height="75" class="rounded-left" title="Example left rounded image" >}}
+ {{< placeholder width="75" height="75" class="rounded-circle" title="Completely round image" >}}
+ {{< placeholder width="150" height="75" class="rounded-pill" title="Rounded pill image" >}}
+ {{< placeholder width="75" height="75" class="rounded-0" title="Example non-rounded image (overrides rounding applied elsewhere)" >}}
</div>
-{% highlight html %}
+{{< highlight html >}}
<img src="..." alt="..." class="rounded">
<img src="..." alt="..." class="rounded-top">
<img src="..." alt="..." class="rounded-right">
<img src="..." alt="..." class="rounded-circle">
<img src="..." alt="..." class="rounded-pill">
<img src="..." alt="..." class="rounded-0">
-{% endhighlight %}
+{{< /highlight >}}
## Sizes
Use `.rounded-lg` or `.rounded-sm` for larger or smaller border-radius.
<div class="bd-example bd-example-images">
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-sm" title="Example small rounded image" -%}
- {%- include icons/placeholder.svg width="75" height="75" class="rounded-lg" title="Example large rounded image" -%}
+ {{< placeholder width="75" height="75" class="rounded-sm" title="Example small rounded image" >}}
+ {{< placeholder width="75" height="75" class="rounded-lg" title="Example large rounded image" >}}
</div>
-{% highlight html %}
+{{< highlight html >}}
<img src="..." alt="..." class="rounded-sm">
<img src="..." alt="..." class="rounded-lg">
-{% endhighlight %}
+{{< /highlight >}}
Easily clear `float`s by adding `.clearfix` **to the parent element**. Can also be used as a mixin.
-{% highlight html %}
+{{< highlight html >}}
<div class="clearfix">...</div>
-{% endhighlight %}
+{{< /highlight >}}
-{% highlight scss %}
+{{< highlight scss >}}
// Mixin itself
@mixin clearfix() {
&::after {
.element {
@include clearfix;
}
-{% endhighlight %}
+{{< /highlight >}}
The following example shows how the clearfix can be used. Without the clearfix the wrapping div would not span around the buttons which would cause a broken layout.
-{% capture example %}
+{{< example >}}
<div class="bg-info clearfix">
<button type="button" class="btn btn-secondary float-left">Example Button floated left</button>
<button type="button" class="btn btn-secondary float-right">Example Button floated right</button>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
**Be sure to include text for screen readers**, as we've done with `aria-label`.
-{% capture example %}
+{{< example >}}
<button type="button" class="close" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Color
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<p class="text-{{ color.name }}{% if color.name == "light" %} bg-dark{% endif %}">.text-{{ color.name }}</p>{% endfor %}
+{{< example >}}
+{{< colors.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<p class="text-{{ .name }}{{ if eq .name "light" }} bg-dark{{ end }}">.text-{{ .name }}</p>
+{{- end -}}
+{{< /colors.inline >}}
<p class="text-body">.text-body</p>
<p class="text-muted">.text-muted</p>
<p class="text-white bg-dark">.text-white</p>
<p class="text-black-50">.text-black-50</p>
<p class="text-white-50 bg-dark">.text-white-50</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Contextual text classes also work well on anchors with the provided hover and focus states. **Note that the `.text-white` and `.text-muted` class has no additional link styling beyond underline.**
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<p><a href="#" class="text-{{ color.name }}{% if color.name == "light" %} bg-dark{% endif %}">{{ color.name | capitalize }} link</a></p>{% endfor %}
+{{< example >}}
+{{< colors.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<p><a href="#" class="text-{{ .name }}{{ if eq .name "light" }} bg-dark{{ end }}">{{ .name | title }} link</a></p>
+{{- end -}}
+{{< /colors.inline >}}
<p><a href="#" class="text-muted">Muted link</a></p>
<p><a href="#" class="text-white bg-dark">White link</a></p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Background color
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. Background utilities **do not set `color`**, so in some cases you'll want to use `.text-*` utilities.
-{% capture example %}
-{% for color in site.data.theme-colors %}
-<div class="p-3 mb-2 bg-{{ color.name }} {% if color.name == "light" or color.name == "warning" %}text-dark{% else %}text-white{% endif %}">.bg-{{ color.name }}</div>{% endfor %}
+{{< example >}}
+{{< colors.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+<div class="p-3 mb-2 bg-{{ .name }} {{ if or (eq .name "light") (eq .name "warning") }}text-dark{{ else }}text-white{{ end }}">.bg-{{ .name }}</div>
+{{- end -}}
+{{< /colors.inline >}}
<div class="p-3 mb-2 bg-white text-dark">.bg-white</div>
<div class="p-3 mb-2 bg-transparent text-dark">.bg-transparent</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Background gradient
-When `$enable-gradients` is set to `true` (default is `false`), you can use `.bg-gradient-` utility classes. [Learn about our Sass options]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/theming/#sass-options) to enable these classes and more.
+When `$enable-gradients` is set to `true` (default is `false`), you can use `.bg-gradient-` utility classes. [Learn about our Sass options](/docs/{{< param docs_version >}}/getting-started/theming/#sass-options) to enable these classes and more.
-{% for color in site.data.theme-colors %}
-- `.bg-gradient-{{ color.name }}`{% endfor %}
+{{< markdown >}}
+{{< colors.inline >}}
+{{- range (index $.Site.Data "theme-colors") }}
+- `.bg-gradient-{{ .name }}`
+{{- end -}}
+{{< /colors.inline >}}
+{{< /markdown >}}
-{% capture callout %}
+{{< 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.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
+{{< /callout >}}
-{% include callout-warning-color-assistive-technologies.md %}
+{{< callout info >}}
+{{< partial "callout-warning-color-assistive-technologies.md" >}}
+{{< /callout >}}
## Notation
-Display utility classes that apply to all [breakpoints]({{ site.baseurl }}/docs/{{ site.docs_version }}/layout/overview/#responsive-breakpoints), from `xs` to `xl`, have no breakpoint abbreviation in them. This is because those classes are applied from `min-width: 0;` and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.
+Display utility classes that apply to all [breakpoints](/docs/{{< param docs_version >}}/layout/overview/#responsive-breakpoints), from `xs` to `xl`, have no breakpoint abbreviation in them. This is because those classes are applied from `min-width: 0;` and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.
As such, the classes are named using the format:
## Examples
-{% capture example %}
+{{< example >}}
<div class="d-inline p-2 bg-primary text-white">d-inline</div>
<div class="d-inline p-2 bg-dark text-white">d-inline</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<span class="d-block p-2 bg-primary text-white">d-block</span>
<span class="d-block p-2 bg-dark text-white">d-block</span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Hiding elements
| Visible only on lg | `.d-none .d-lg-block .d-xl-none` |
| Visible only on xl | `.d-none .d-xl-block` |
-{% capture example %}
+{{< example >}}
<div class="d-lg-none">hide on screens wider than lg</div>
<div class="d-none d-lg-block">hide on screens smaller than lg</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Display in print
The print and display classes can be combined.
-{% capture example %}
+{{< example >}}
<div class="d-print-none">Screen Only (Hide on print only)</div>
<div class="d-none d-print-block">Print Only (Hide on screen only)</div>
<div class="d-none d-lg-block d-print-block">Hide up to large on screen, but always show on print</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Wrap any embed like an `<iframe>` in a parent element with `.embed-responsive` and an aspect ratio. The `.embed-responsive-item` isn't strictly required, but we encourage it.
-{% capture example %}
+{{< example >}}
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Aspect ratios
Aspect ratios can be customized with modifier classes. By default the following ratio classes are provided:
-{% highlight html %}
+{{< highlight html >}}
<!-- 21:9 aspect ratio -->
<div class="embed-responsive embed-responsive-21by9">
<iframe class="embed-responsive-item" src="..."></iframe>
<div class="embed-responsive embed-responsive-1by1">
<iframe class="embed-responsive-item" src="..."></iframe>
</div>
-{% endhighlight %}
+{{< /highlight >}}
Within `_variables.scss`, you can change the aspect ratios you want to use. Here's an example of the `$embed-responsive-aspect-ratios` list:
-{% highlight scss %}
+{{< highlight scss >}}
$embed-responsive-aspect-ratios: (
(21 9),
(16 9),
(4 3),
(1 1)
) !default;
-{% endhighlight %}
+{{< /highlight >}}
Apply `display` utilities to create a flexbox container and transform **direct children elements** into flex items. Flex containers and items are able to be modified further with additional flex properties.
-{% capture example %}
+{{< example >}}
<div class="d-flex p-2 bd-highlight">I'm a flexbox container!</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div class="d-inline-flex p-2 bd-highlight">I'm an inline flexbox container!</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Responsive variations also exist for `.d-flex` and `.d-inline-flex`.
-{% for bp in site.data.breakpoints %}
-- `.d{{ bp.abbr }}-flex`
-- `.d{{ bp.abbr }}-inline-flex`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.d{{ .abbr }}-flex`
+- `.d{{ .abbr }}-inline-flex`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Direction
Use `.flex-row` to set a horizontal direction (the browser default), or `.flex-row-reverse` to start the horizontal direction from the opposite side.
-{% capture example %}
+{{< example >}}
<div class="d-flex flex-row bd-highlight mb-3">
<div class="p-2 bd-highlight">Flex item 1</div>
<div class="p-2 bd-highlight">Flex item 2</div>
<div class="p-2 bd-highlight">Flex item 2</div>
<div class="p-2 bd-highlight">Flex item 3</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Use `.flex-column` to set a vertical direction, or `.flex-column-reverse` to start the vertical direction from the opposite side.
-{% capture example %}
+{{< example >}}
<div class="d-flex flex-column bd-highlight mb-3">
<div class="p-2 bd-highlight">Flex item 1</div>
<div class="p-2 bd-highlight">Flex item 2</div>
<div class="p-2 bd-highlight">Flex item 2</div>
<div class="p-2 bd-highlight">Flex item 3</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Responsive variations also exist for `flex-direction`.
-{% for bp in site.data.breakpoints %}
-- `.flex{{ bp.abbr }}-row`
-- `.flex{{ bp.abbr }}-row-reverse`
-- `.flex{{ bp.abbr }}-column`
-- `.flex{{ bp.abbr }}-column-reverse`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.flex{{ .abbr }}-row`
+- `.flex{{ .abbr }}-row-reverse`
+- `.flex{{ .abbr }}-column`
+- `.flex{{ .abbr }}-column-reverse`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Justify content
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex justify-content-start">...</div>
<div class="d-flex justify-content-end">...</div>
<div class="d-flex justify-content-center">...</div>
<div class="d-flex justify-content-between">...</div>
<div class="d-flex justify-content-around">...</div>
-{% endhighlight %}
+{{< /highlight >}}
Responsive variations also exist for `justify-content`.
-{% for bp in site.data.breakpoints %}
-- `.justify-content{{ bp.abbr }}-start`
-- `.justify-content{{ bp.abbr }}-end`
-- `.justify-content{{ bp.abbr }}-center`
-- `.justify-content{{ bp.abbr }}-between`
-- `.justify-content{{ bp.abbr }}-around`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.justify-content{{ .abbr }}-start`
+- `.justify-content{{ .abbr }}-end`
+- `.justify-content{{ .abbr }}-center`
+- `.justify-content{{ .abbr }}-between`
+- `.justify-content{{ .abbr }}-around`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Align items
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex align-items-start">...</div>
<div class="d-flex align-items-end">...</div>
<div class="d-flex align-items-center">...</div>
<div class="d-flex align-items-baseline">...</div>
<div class="d-flex align-items-stretch">...</div>
-{% endhighlight %}
+{{< /highlight >}}
Responsive variations also exist for `align-items`.
-{% for bp in site.data.breakpoints %}
-- `.align-items{{ bp.abbr }}-start`
-- `.align-items{{ bp.abbr }}-end`
-- `.align-items{{ bp.abbr }}-center`
-- `.align-items{{ bp.abbr }}-baseline`
-- `.align-items{{ bp.abbr }}-stretch`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.align-items{{ .abbr }}-start`
+- `.align-items{{ .abbr }}-end`
+- `.align-items{{ .abbr }}-center`
+- `.align-items{{ .abbr }}-baseline`
+- `.align-items{{ .abbr }}-stretch`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Align self
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="align-self-start">Aligned flex item</div>
<div class="align-self-end">Aligned flex item</div>
<div class="align-self-center">Aligned flex item</div>
<div class="align-self-baseline">Aligned flex item</div>
<div class="align-self-stretch">Aligned flex item</div>
-{% endhighlight %}
+{{< /highlight >}}
Responsive variations also exist for `align-self`.
-{% for bp in site.data.breakpoints %}
-- `.align-self{{ bp.abbr }}-start`
-- `.align-self{{ bp.abbr }}-end`
-- `.align-self{{ bp.abbr }}-center`
-- `.align-self{{ bp.abbr }}-baseline`
-- `.align-self{{ bp.abbr }}-stretch`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.align-self{{ .abbr }}-start`
+- `.align-self{{ .abbr }}-end`
+- `.align-self{{ .abbr }}-center`
+- `.align-self{{ .abbr }}-baseline`
+- `.align-self{{ .abbr }}-stretch`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Fill
Use the `.flex-fill` class on a series of sibling elements to force them into widths equal to their content (or equal widths if their content does not surpass their border-boxes) while taking up all available horizontal space.
-{% capture example %}
+{{< example >}}
<div class="d-flex bd-highlight">
<div class="p-2 flex-fill bd-highlight">Flex item with a lot of content</div>
<div class="p-2 flex-fill bd-highlight">Flex item</div>
<div class="p-2 flex-fill bd-highlight">Flex item</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Responsive variations also exist for `flex-fill`.
-{% for bp in site.data.breakpoints %}
-- `.flex{{ bp.abbr }}-fill`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.flex{{ .abbr }}-fill`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Grow and shrink
Use `.flex-grow-*` utilities to toggle a flex item's ability to grow to fill available space. In the example below, the `.flex-grow-1` elements uses all available space it can, while allowing the remaining two flex items their necessary space.
-{% capture example %}
+{{< example >}}
<div class="d-flex bd-highlight">
<div class="p-2 flex-grow-1 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Third flex item</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Use `.flex-shrink-*` utilities to toggle a flex item's ability to shrink if necessary. In the example below, the second flex item with `.flex-shrink-1` is forced to wrap it's contents to a new line, "shrinking" to allow more space for the previous flex item with `.w-100`.
-{% capture example %}
+{{< example >}}
<div class="d-flex bd-highlight">
<div class="p-2 w-100 bd-highlight">Flex item</div>
<div class="p-2 flex-shrink-1 bd-highlight">Flex item</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Responsive variations also exist for `flex-grow` and `flex-shrink`.
-{% for bp in site.data.breakpoints %}
-- `.flex{{ bp.abbr }}-{grow|shrink}-0`
-- `.flex{{ bp.abbr }}-{grow|shrink}-1`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.flex{{ .abbr }}-{grow|shrink}-0`
+- `.flex{{ .abbr }}-{grow|shrink}-1`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Auto margins
**Unfortunately, IE10 and IE11 do not properly support auto margins on flex items whose parent has a non-default `justify-content` value.** [See this StackOverflow answer](https://stackoverflow.com/a/37535548) for more details.
-{% capture example %}
+{{< example >}}
<div class="d-flex bd-highlight mb-3">
<div class="p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
<div class="ml-auto p-2 bd-highlight">Flex item</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
### With align-items
Vertically move one flex item to the top or bottom of a container by mixing `align-items`, `flex-direction: column`, and `margin-top: auto` or `margin-bottom: auto`.
-{% capture example %}
+{{< example >}}
<div class="d-flex align-items-start flex-column bd-highlight mb-3" style="height: 200px;">
<div class="mb-auto p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
<div class="mt-auto p-2 bd-highlight">Flex item</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Wrap
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex flex-nowrap">
...
</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="bd-example">
<div class="d-flex flex-wrap bd-highlight">
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex flex-wrap">
...
</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="bd-example">
<div class="d-flex flex-wrap-reverse bd-highlight">
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex flex-wrap-reverse">
...
</div>
-{% endhighlight %}
+{{< /highlight >}}
Responsive variations also exist for `flex-wrap`.
-{% for bp in site.data.breakpoints %}
-- `.flex{{ bp.abbr }}-nowrap`
-- `.flex{{ bp.abbr }}-wrap`
-- `.flex{{ bp.abbr }}-wrap-reverse`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.flex{{ .abbr }}-nowrap`
+- `.flex{{ .abbr }}-wrap`
+- `.flex{{ .abbr }}-wrap-reverse`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Order
Change the _visual_ order of specific flex items with a handful of `order` utilities. We only provide options for making an item first or last, as well as a reset to use the DOM order. As `order` takes any integer value (e.g., `5`), add custom CSS for any additional values needed.
-{% capture example %}
+{{< example >}}
<div class="d-flex flex-nowrap bd-highlight">
<div class="order-3 p-2 bd-highlight">First flex item</div>
<div class="order-2 p-2 bd-highlight">Second flex item</div>
<div class="order-1 p-2 bd-highlight">Third flex item</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Responsive variations also exist for `order`.
-{% for bp in site.data.breakpoints %}{% for i in (0..12) %}
-- `.order{{ bp.abbr }}-{{ i }}`{% endfor %}{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $bp := $.Site.Data.breakpoints -}}
+{{- range $i, $num := seq 0 12 }}
+- `.order{{ $bp.abbr }}-{{ $i }}`
+{{- end -}}
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
## Align content
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex align-content-start flex-wrap">
...
</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="bd-example">
<div class="d-flex align-content-end flex-wrap bd-highlight mb-3" style="height: 200px">
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex align-content-end flex-wrap">...</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="bd-example">
<div class="d-flex align-content-center flex-wrap bd-highlight mb-3" style="height: 200px">
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex align-content-center flex-wrap">...</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="bd-example">
<div class="d-flex align-content-between flex-wrap bd-highlight mb-3" style="height: 200px">
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex align-content-between flex-wrap">...</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="bd-example">
<div class="d-flex align-content-around flex-wrap bd-highlight mb-3" style="height: 200px">
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex align-content-around flex-wrap">...</div>
-{% endhighlight %}
+{{< /highlight >}}
<div class="bd-example">
<div class="d-flex align-content-stretch flex-wrap bd-highlight mb-3" style="height: 200px">
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="d-flex align-content-stretch flex-wrap">...</div>
-{% endhighlight %}
+{{< /highlight >}}
Responsive variations also exist for `align-content`.
-{% for bp in site.data.breakpoints %}
-- `.align-content{{ bp.abbr }}-start`
-- `.align-content{{ bp.abbr }}-end`
-- `.align-content{{ bp.abbr }}-center`
-- `.align-content{{ bp.abbr }}-around`
-- `.align-content{{ bp.abbr }}-stretch`{% endfor %}
+{{< markdown >}}
+{{< flex.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.align-content{{ .abbr }}-start`
+- `.align-content{{ .abbr }}-end`
+- `.align-content{{ .abbr }}-center`
+- `.align-content{{ .abbr }}-around`
+- `.align-content{{ .abbr }}-stretch`
+{{- end -}}
+{{< /flex.inline >}}
+{{< /markdown >}}
Toggle a float with a class:
-{% capture example %}
+{{< example >}}
<div class="float-left">Float left on all viewport sizes</div><br>
<div class="float-right">Float right on all viewport sizes</div><br>
<div class="float-none">Don't float on all viewport sizes</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Mixins
Or by Sass mixin:
-{% highlight scss %}
+{{< highlight scss >}}
.element {
@include float-left;
}
.one-more {
@include float-none;
}
-{% endhighlight %}
+{{< /highlight >}}
## Responsive
Responsive variations also exist for each `float` value.
-{% capture example %}
+{{< example >}}
<div class="float-sm-left">Float left on viewports sized SM (small) or wider</div><br>
<div class="float-md-left">Float left on viewports sized MD (medium) or wider</div><br>
<div class="float-lg-left">Float left on viewports sized LG (large) or wider</div><br>
<div class="float-xl-left">Float left on viewports sized XL (extra-large) or wider</div><br>
-{% endcapture %}
-{% include example.html content=example %}
-
-Here are all the support classes;
-
-{% for bp in site.data.breakpoints %}
-- `.float{{ bp.abbr }}-left`
-- `.float{{ bp.abbr }}-right`
-- `.float{{ bp.abbr }}-none`{% endfor %}
+{{< /example >}}
+
+Here are all the support classes:
+
+{{< markdown >}}
+{{< float.inline >}}
+{{- range $.Site.Data.breakpoints }}
+- `.float{{ .abbr }}-left`
+- `.float{{ .abbr }}-right`
+- `.float{{ .abbr }}-none`
+{{- end -}}
+{{< /float.inline >}}
+{{< /markdown >}}
group: utilities
---
-{% capture callout %}
+{{< callout warning >}}
##### Warning
The `text-hide()` class and mixin has been deprecated as of v4.1. It will be removed entirely in v5.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
+{{< /callout >}}
Utilize the `.text-hide` class or mixin to help replace an element's text content with a background image.
-{% highlight html %}
+{{< highlight html >}}
<h1 class="text-hide">Custom heading</h1>
-{% endhighlight %}
+{{< /highlight >}}
-{% highlight scss %}
+{{< highlight scss >}}
// Usage as a mixin
.heading {
@include text-hide;
}
-{% endhighlight %}
+{{< /highlight >}}
Use the `.text-hide` class to maintain the accessibility and SEO benefits of heading tags, but want to utilize a `background-image` instead of text.
<div class="bd-example">
- <h1 class="text-hide" style="background-image: url('{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg'); width: 50px; height: 50px;">Bootstrap</h1>
+ <h1 class="text-hide" style="background-image: url('/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg'); width: 50px; height: 50px;">Bootstrap</h1>
</div>
-{% highlight html %}
+{{< highlight html >}}
<h1 class="text-hide" style="background-image: url('...');">Bootstrap</h1>
-{% endhighlight %}
+{{< /highlight >}}
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="overflow-auto">...</div>
<div class="overflow-hidden">...</div>
-{% endhighlight %}
+{{< /highlight >}}
Using Sass variables, you may customize the overflow utilities by changing the `$overflows` variable in `_variables.scss`.
Quick positioning classes are available, though they are not responsive.
-{% highlight html %}
+{{< highlight html >}}
<div class="position-static">...</div>
<div class="position-relative">...</div>
<div class="position-absolute">...</div>
<div class="position-fixed">...</div>
<div class="position-sticky">...</div>
-{% endhighlight %}
+{{< /highlight >}}
## Fixed top
Position an element at the top of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add additional CSS.
-{% highlight html %}
+{{< highlight html >}}
<div class="fixed-top">...</div>
-{% endhighlight %}
+{{< /highlight >}}
## Fixed bottom
Position an element at the bottom of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add additional CSS.
-{% highlight html %}
+{{< highlight html >}}
<div class="fixed-bottom">...</div>
-{% endhighlight %}
+{{< /highlight >}}
## Sticky top
**IE11 and IE10 will render `position: sticky` as `position: relative`.** As such, we wrap the styles in a `@supports` query, limiting the stickiness to only browsers that can render it properly.
-{% highlight html %}
+{{< highlight html >}}
<div class="sticky-top">...</div>
-{% endhighlight %}
+{{< /highlight >}}
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]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/#accessibility).
-{%- endcomment -%}
-
-{% capture example %}
+{{< example >}}
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% highlight scss %}
+{{< highlight scss >}}
// Usage as a mixin
.skip-navigation {
@include sr-only;
@include sr-only-focusable;
}
-{% endhighlight %}
+{{< /highlight >}}
While shadows on components are disabled by default in Bootstrap and can be enabled via `$enable-shadows`, you can also quickly add or remove a shadow with our `box-shadow` utility classes. Includes support for `.shadow-none` and three default sizes (which have associated variables to match).
-{% capture example %}
+{{< example >}}
<div class="shadow-none p-3 mb-5 bg-light rounded">No shadow</div>
<div class="shadow-sm p-3 mb-5 bg-white rounded">Small shadow</div>
<div class="shadow p-3 mb-5 bg-white rounded">Regular shadow</div>
<div class="shadow-lg p-3 mb-5 bg-white rounded">Larger shadow</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Width and height utilities are generated from the `$sizes` Sass map in `_variables.scss`. Includes support for `25%`, `50%`, `75%`, `100%`, and `auto` by default. Modify those values as you need to generate different utilities here.
-{% capture example %}
+{{< example >}}
<div class="w-25 p-3" style="background-color: #eee;">Width 25%</div>
<div class="w-50 p-3" style="background-color: #eee;">Width 50%</div>
<div class="w-75 p-3" style="background-color: #eee;">Width 75%</div>
<div class="w-100 p-3" style="background-color: #eee;">Width 100%</div>
<div class="w-auto p-3" style="background-color: #eee;">Width auto</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
-{% capture example %}
+{{< example >}}
<div style="height: 100px; background-color: rgba(255,0,0,0.1);">
<div class="h-25 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 25%</div>
<div class="h-50 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 50%</div>
<div class="h-100 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 100%</div>
<div class="h-auto d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height auto</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
You can also use `max-width: 100%;` and `max-height: 100%;` utilities as needed.
-{% capture example %}
-{% include icons/placeholder.svg width="100%" height="100" class="mw-100" text="Max-width 100%" %}
-{% endcapture %}
-{% include example.html content=example %}
+{{< example >}}
+{{< placeholder width="100%" height="100" class="mw-100" text="Max-width 100%" >}}
+{{< /example >}}
-{% capture example %}
-<div style="height: 100px; background-color: rgba(255,0,0,0.1);">
- <div class="mh-100" style="width: 100px; height: 200px; background-color: rgba(0,0,255,0.1);">Max-height 100%</div>
+{{< example >}}
+<div style="height: 100px; background-color: rgba(255,0,0,.1);">
+ <div class="mh-100" style="width: 100px; height: 200px; background-color: rgba(0,0,255,.1);">Max-height 100%</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Relative to the viewport
You can also use utilities to set the width and height relative to the viewport.
-{% highlight html %}
+{{< highlight html >}}
<div class="min-vw-100">Min-width 100vw</div>
<div class="min-vh-100">Min-height 100vh</div>
<div class="vw-100">Width 100vw</div>
<div class="vh-100">Height 100vh</div>
-{% endhighlight %}
+{{< /highlight >}}
Here are some representative examples of these classes:
-{% highlight scss %}
+{{< highlight scss >}}
.mt-0 {
margin-top: 0 !important;
}
.p-3 {
padding: $spacer !important;
}
-{% endhighlight %}
+{{< /highlight >}}
### Horizontal centering
</div>
</div>
-{% highlight html %}
+{{< highlight html >}}
<div class="mx-auto" style="width: 200px;">
Centered element
</div>
-{% endhighlight %}
+{{< /highlight >}}
### Negative margin
The syntax is nearly the same as the default, positive margin utilities, but with the addition of `n` before the requested size. Here's an example class that's the opposite of `.mt-1`:
-{% highlight scss %}
+{{< highlight scss >}}
.mt-n1 {
margin-top: -0.25rem !important;
}
-{% endhighlight %}
+{{< /highlight >}}
Here's an example of customizing the Bootstrap grid at the medium (`md`) breakpoint and above. We've increased the `.col` padding with `.px-md-5` and then counteracted that with `.mx-md-n5` on the parent `.row`.
-{% capture example %}
+{{< example >}}
<div class="row mx-md-n5">
<div class="col px-md-5"><div class="p-3 border bg-light">Custom column padding</div></div>
<div class="col px-md-5"><div class="p-3 border bg-light">Custom column padding</div></div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Multiple links and tap targets are not recommended with stretched links. However, some `position` and `z-index` styles can help should this be required.
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text=" " title="Card image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="false" title="Card image cap" >}}
<div class="card-body">
<h5 class="card-title">Card with stretched link</h5>
<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="btn btn-primary stretched-link">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Media objects do not have `position: relative` by default, so we need to add the `.position-relative` here to prevent the link from stretching outside the media object.
-{% capture example %}
+{{< example >}}
<div class="media position-relative">
- {% include icons/placeholder.svg width="144" height="144" class="mr-3" text=" " title="Generic placeholder image" %}
+ {{< placeholder width="144" height="144" class="mr-3" text="false" title="Generic placeholder image" >}}
<div class="media-body">
<h5 class="mt-0">Media with stretched link</h5>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<a href="#" class="stretched-link">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Columns are `position: relative` by default, so clickable columns only require the `.stretched-link` class on a link. However, stretching a link over an entire `.row` requires `.position-static` on the column and `.position-relative` on the row.
-{% capture example %}
+{{< example >}}
<div class="row no-gutters bg-light position-relative">
<div class="col-md-6 mb-md-0 p-md-4">
- {% include icons/placeholder.svg width="100%" height="200" class="w-100" text=" " title="Generic placeholder image" %}
+ {{< placeholder width="100%" height="200" class="w-100" text="false" title="Generic placeholder image" >}}
</div>
<div class="col-md-6 position-static p-4 pl-md-0">
<h5 class="mt-0">Columns with stretched link</h5>
<a href="#" class="stretched-link">Go somewhere</a>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Identifying the containing block
- A `will-change` value of `transform` or `perspective`
- A `filter` value other than `none` or a `will-change` value of `filter` (only works on Firefox)
-{% capture example %}
+{{< example >}}
<div class="card" style="width: 18rem;">
- {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text=" " title="Card image cap" %}
+ {{< placeholder width="100%" height="180" class="card-img-top" text="false" title="Card image cap" >}}
<div class="card-body">
<h5 class="card-title">Card with stretched links</h5>
<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>
</div>
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Easily realign text to components with text alignment classes.
-{% capture example %}
+{{< example >}}
<p class="text-justify">Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. Praeterea iter est quasdam res quas ex communi. At nos hinc posthac, sitientis piros Afros. Petierunt uti sibi concilium totius Galliae in diem certam indicere. Cras mattis iudicium purus sit amet fermentum.</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
For left, right, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system.
-{% capture example %}
+{{< example >}}
<p class="text-left">Left aligned text on all viewport sizes.</p>
<p class="text-center">Center aligned text on all viewport sizes.</p>
<p class="text-right">Right aligned text on all viewport sizes.</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>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Text wrapping and overflow
Wrap text with a `.text-wrap` class.
-{% capture example %}
+{{< example >}}
<div class="badge badge-primary text-wrap" style="width: 6rem;">
This text should wrap.
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Prevent text from wrapping with a `.text-nowrap` class.
-{% capture example %}
+{{< example >}}
<div class="text-nowrap bd-highlight" style="width: 8rem;">
This text should overflow the parent.
</div>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
For longer content, you can add a `.text-truncate` class to truncate the text with an ellipsis. **Requires `display: inline-block` or `display: block`.**
-{% capture example %}
+{{< example >}}
<!-- Block level -->
<div class="row">
<div class="col-2 text-truncate">
<span class="d-inline-block text-truncate" style="max-width: 150px;">
Praeterea iter est quasdam res quas ex communi.
</span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Word break
Prevent long strings of text from breaking your components' layout by using `.text-break` to set `overflow-wrap: break-word` (and `word-break: break-word` for IE & Edge compatibility).
-{% capture example %}
+{{< example >}}
<p class="text-break">mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Text transform
Transform text in components with text capitalization classes.
-{% capture example %}
+{{< example >}}
<p class="text-lowercase">Lowercased text.</p>
<p class="text-uppercase">Uppercased text.</p>
<p class="text-capitalize">CapiTaliZed text.</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Note how `.text-capitalize` only changes the first letter of each word, leaving the case of any other letters unaffected.
Quickly change the weight (boldness) of text or italicize text.
-{% capture example %}
+{{< example >}}
<p class="font-weight-bold">Bold text.</p>
<p class="font-weight-bolder">Bolder weight text (relative to the parent element).</p>
<p class="font-weight-normal">Normal weight text.</p>
<p class="font-weight-light">Light weight text.</p>
<p class="font-weight-lighter">Lighter weight text (relative to the parent element).</p>
<p class="font-italic">Italic text.</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Monospace
Change a selection to our monospace font stack with `.text-monospace`.
-{% capture example %}
+{{< example >}}
<p class="text-monospace">This is in monospace</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Reset color
Reset a text or link's color with `.text-reset`, so that it inherits the color from its parent.
-{% capture example %}
+{{< example >}}
<p class="text-muted">
Muted text with a <a href="#" class="text-reset">reset link</a>.
</p>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
## Text decoration
Remove a text decoration with a `.text-decoration-none` class.
-{% capture example %}
+{{< example >}}
<a href="#" class="text-decoration-none">Non-underlined link</a>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
With inline elements:
-{% capture example %}
+{{< example >}}
<span class="align-baseline">baseline</span>
<span class="align-top">top</span>
<span class="align-middle">middle</span>
<span class="align-bottom">bottom</span>
<span class="align-text-top">text-top</span>
<span class="align-text-bottom">text-bottom</span>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
With table cells:
-{% capture example %}
+{{< example >}}
<table style="height: 100px;">
<tbody>
<tr>
</tr>
</tbody>
</table>
-{% endcapture %}
-{% include example.html content=example %}
+{{< /example >}}
Apply `.visible` or `.invisible` as needed.
-{% highlight html %}
+{{< highlight html >}}
<div class="visible">...</div>
<div class="invisible">...</div>
-{% endhighlight %}
+{{< /highlight >}}
-{% highlight scss %}
+{{< highlight scss >}}
// Class
.visible {
visibility: visible !important;
.element {
@include invisible(hidden);
}
-{% endhighlight %}
+{{< /highlight >}}
--- /dev/null
+---
+title: Versions
+description: An appendix of hosted documentation for nearly every release of Bootstrap, from v1 through v4.
+---
+
+{{< list-versions >}}
upstream_bug: >
Chromium#419108
origin: >
- Offshoot of Bootstrap#8350 & Chromium#337668
+ Bootstrap#8350, Chromium#337668
-
browser: >
--- /dev/null
+- group: v1.x
+ baseurl: "https://getbootstrap.com"
+ description: "Every minor and patch release from v1 is listed below."
+ versions:
+ - v: "1.0.0"
+ - v: "1.1.0"
+ - v: "1.1.1"
+ - v: "1.2.0"
+ - v: "1.3.0"
+ - v: "1.4.0"
+
+- group: v2.x
+ baseurl: "https://getbootstrap.com"
+ description: "Every minor and patch release from v2 is listed below."
+ versions:
+ - v: "2.0.0"
+ - v: "2.0.1"
+ - v: "2.0.2"
+ - v: "2.0.3"
+ - v: "2.0.4"
+ - v: "2.1.0"
+ - v: "2.1.1"
+ - v: "2.2.0"
+ - v: "2.2.1"
+ - v: "2.2.2"
+ - v: "2.3.0"
+ - v: "2.3.1"
+ - v: "2.3.2"
+
+- group: v3.x
+ baseurl: "https://getbootstrap.com/docs"
+ description: "Our previous major release and its minor versions. Last update was v3.4.1."
+ versions:
+ - v: "3.3"
+ - v: "3.4"
+
+- group: v4.x
+ baseurl: "https://getbootstrap.com/docs"
+ description: "Current major release with two minor releases. Last update was v4.3.1."
+ versions:
+ - v: "4.0"
+ - v: "4.1"
+ - v: "4.2"
+ - v: "4.3"
-- category: Custom components
+- category: Custom Components
description: "Brand new components and templates to help folks quickly get started with Bootstrap and demonstrate best practices for adding onto the framework."
examples:
- name: Album
+++ /dev/null
----
-layout: docs
-title: Team
-description: An overview of the founding team and core contributors to Bootstrap.
-group: about
----
-
-Bootstrap is maintained by the founding team and a small group of invaluable core contributors, with the massive support and involvement of our community.
-
-<div class="list-group mb-3">
- {% for member in site.data.core-team %}
- <a class="list-group-item list-group-item-action d-flex align-items-center" href="https://github.com/{{ member.user }}">
- <img src="https://github.com/{{ member.user }}.png" alt="@{{ member.user }}" width="32" height="32" class="rounded mr-2">
- <span>
- <strong>{{ member.name }}</strong> @{{ member.user }}
- </span>
- </a>
- {% endfor %}
-</div>
-
-Get involved with Bootstrap development by [opening an issue]({{ site.repo }}/issues/new) or submitting a pull request. Read our [contributing guidelines]({{ site.repo }}/blob/v{{ site.current_version }}/.github/CONTRIBUTING.md) for information on how we develop.
+++ /dev/null
----
-layout: docs
-title: Figures
-description: Documentation and examples for displaying related images and text with the figure component in Bootstrap.
-group: content
----
-
-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.
-
-{% capture example %}
-<figure class="figure">
- {% include icons/placeholder.svg width="400" height="300" class="figure-img img-fluid rounded" %}
- <figcaption class="figure-caption">A caption for the above image.</figcaption>
-</figure>
-{% endcapture %}
-{% include example.html content=example %}
-
-Aligning the figure's caption is easy with our [text utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/text/#text-alignment).
-
-{% capture example %}
-<figure class="figure">
- {% include icons/placeholder.svg width="400" height="300" class="figure-img img-fluid rounded" %}
- <figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
-</figure>
-{% endcapture %}
-{% include example.html content=example %}
+++ /dev/null
----
-layout: docs
-title: Images
-description: Documentation and examples for opting images into responsive behavior (so they never become larger than their parent elements) and add lightweight styles to them—all via classes.
-group: content
-toc: true
----
-
-## Responsive images
-
-Images in Bootstrap are made responsive with `.img-fluid`. `max-width: 100%;` and `height: auto;` are applied to the image so that it scales with the parent element.
-
-<div class="bd-example">
- {% include icons/placeholder.svg width="100%" height="250" class="bd-placeholder-img-lg img-fluid" text="Responsive image" %}
-</div>
-
-{% highlight html %}
-<img src="..." class="img-fluid" alt="Responsive image">
-{% endhighlight %}
-
-## Image thumbnails
-
-In addition to our [border-radius utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/borders/), you can use `.img-thumbnail` to give an image a rounded 1px border appearance.
-
-<div class="bd-example bd-example-images">
- {% include icons/placeholder.svg width="200" height="200" class="img-thumbnail" title="A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera" %}
-</div>
-
-{% highlight html %}
-<img src="..." alt="..." class="img-thumbnail">
-{% endhighlight %}
-
-## Aligning images
-
-Align images with the [helper float classes]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/float/) or [text alignment classes]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/text/#text-alignment). `block`-level images can be centered using [the `.mx-auto` margin utility class]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/#horizontal-centering).
-
-<div class="bd-example bd-example-images">
- {% include icons/placeholder.svg width="200" height="200" class="rounded float-left" %}
- {% include icons/placeholder.svg width="200" height="200" class="rounded float-right" %}
-</div>
-
-{% highlight html %}
-<img src="..." class="rounded float-left" alt="...">
-<img src="..." class="rounded float-right" alt="...">
-{% endhighlight %}
-
-<div class="bd-example bd-example-images">
- {% include icons/placeholder.svg width="200" height="200" class="rounded mx-auto d-block" %}
-</div>
-
-{% highlight html %}
-<img src="..." class="rounded mx-auto d-block" alt="...">
-{% endhighlight %}
-
-<div class="bd-example bd-example-images">
- <div class="text-center">
- {% include icons/placeholder.svg width="200" height="200" class="rounded" %}
- </div>
-</div>
-
-{% highlight html %}
-<div class="text-center">
- <img src="..." class="rounded" alt="...">
-</div>
-{% endhighlight %}
-
-
-## Picture
-
-If you are using the `<picture>` element to specify multiple `<source>` elements for a specific `<img>`, make sure to add the `.img-*` classes to the `<img>` and not to the `<picture>` tag.
-
-{% highlight html %}
-<picture>
- <source srcset="..." type="image/svg+xml">
- <img src="..." class="img-fluid img-thumbnail" alt="...">
-</picture>
-{% endhighlight %}
+++ /dev/null
----
-layout: simple
-title: Examples
-description: Quickly get a project started with any of our examples ranging from using parts of the framework to custom components and layouts.
-redirect_from: "/examples/"
----
-
-{% for entry in site.data.examples %}
- <h2>{{ entry.category | capitalize }}</h2>
- <p>{{ entry.description }}</p>
- {% for example in entry.examples %}
- {% if forloop.first %}<div class="row">{% endif %}
- <div class="col-sm-6 col-md-4 col-xl-3 mb-3">
- <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/examples/{{ example.name | slugify }}/">
- <img class="img-thumbnail mb-3" srcset="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/examples/{{ example.name | slugify }}.png,
- {{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/examples/{{ example.name | slugify }}@2x.png 2x"
- src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/examples/{{ example.name | slugify }}.png" alt="{{ example.name }} screenshot" width="480" height="300">
- <h5 class="mb-1">{{ example.name }}</h5>
- </a>
- <p class="text-muted">{{ example.description }}</p>
- </div>
- {% if forloop.last %}</div>{% endif %}
- {% endfor %}
-{% endfor %}
+++ /dev/null
----
-layout: docs
-title: Utilities for layout
-description: For faster mobile-friendly and responsive development, Bootstrap includes dozens of utility classes for showing, hiding, aligning, and spacing content.
-group: layout
-toc: true
----
-
-## Changing `display`
-
-Use our [display utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/) for responsively toggling common values of the `display` property. Mix it with our grid system, content, or components to show or hide them across specific viewports.
-
-## Flexbox options
-
-Bootstrap 4 is built with flexbox, but not every element's `display` has been changed to `display: flex` as this would add many unnecessary overrides and unexpectedly change key browser behaviors. Most of [our components]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/alerts/) are built with flexbox enabled.
-
-Should you need to add `display: flex` to an element, do so with `.d-flex` or one of the responsive variants (e.g., `.d-sm-flex`). You'll need this class or `display` value to allow the use of our extra [flexbox utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/) for sizing, alignment, spacing, and more.
-
-## Margin and padding
-
-Use the `margin` and `padding` [spacing utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) to control how elements and components are spaced and sized. Bootstrap 4 includes a five-level scale for spacing utilities, based on a `1rem` value default `$spacer` variable. Choose values for all viewports (e.g., `.mr-3` for `margin-right: 1rem`), or pick responsive variants to target specific viewports (e.g., `.mr-md-3` for `margin-right: 1rem` starting at the `md` breakpoint).
-
-## Toggle `visibility`
-
-When toggling `display` isn't needed, you can toggle the `visibility` of an element with our [visibility utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/visibility/). Invisible elements will still affect the layout of the page, but are visually hidden from visitors.
+++ /dev/null
----
-layout: simple
-title: Versions
-description: An appendix of hosted documentation for nearly every release of Bootstrap, from v1 through v4.
----
-
-<div class="row">
-{% for release in site.data.docs-versions %}
- <div class="col-md">
- <h2>{{ release.group }}</h2>
- <p>{{ release.description }}</p>
- {% assign versions = release.versions | reverse %}
- {% for version in versions %}
- {% if forloop.first %}<div class="list-group">{% endif %}
- {% if version.v == site.docs_version %}
- <a class="list-group-item list-group-item-action py-2 text-primary d-flex justify-content-between align-items-center" href="{{ release.baseurl }}/{{ version.v }}/">
- {{ version.v }}
- <span class="badge badge-primary">Latest</span>
- </a>
- {% else %}
- <a class="list-group-item list-group-item-action py-2 text-primary" href="{{ release.baseurl }}/{{ version.v }}/">
- {{ version.v }}
- </a>
- {% endif %}
- {% if forloop.last %}</div>{% endif %}
- {% endfor %}
- </div>
-{% endfor %}
-</div>
+++ /dev/null
----
-layout: home
----
-
-<main class="bd-masthead" id="content" role="main">
- <div class="container">
- <div class="row align-items-center">
- <div class="col-6 mx-auto col-md-6 order-md-2">
- {% include icons/bootstrap-stack.svg width="512" height="430" class="img-fluid mb-3 mb-md-0" %}
- </div>
- <div class="col-md-6 order-md-1 text-center text-md-left pr-md-5">
- <h1 class="mb-3 bd-text-purple-bright">Bootstrap</h1>
- <p class="lead">
- Build responsive, mobile-first projects on the web with the world’s most popular front-end component library.
- </p>
- <p class="lead mb-4">
- Bootstrap is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with our Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful plugins built with VanillaJS.
- </p>
- <div class="row mx-n2">
- <div class="col-md px-2">
- <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/introduction/" class="btn btn-lg btn-bd-primary w-100 mb-3" onclick="ga('send', 'event', 'Jumbotron actions', 'Get started', 'Get started');">Get started</a>
- </div>
- <div class="col-md px-2">
- <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/download/" class="btn btn-lg btn-outline-secondary w-100 mb-3" onclick="ga('send', 'event', 'Jumbotron actions', 'Download', 'Download {{ site.current_version }}');">Download</a>
- </div>
- </div>
- <p class="text-muted mb-0">
- Currently v{{ site.current_version }}
- </p>
- </div>
- </div>
- {% include ads.html %}
- </div>
-</main>
-
-<div class="masthead-followup row m-0 border border-white">
- <div class="col-12 col-md-4 p-3 p-md-5 bg-light border border-white">
- <!-- Icon by Bytesize https://github.com/danklammer/bytesize-icons -->
- {% include icons/import.svg width="32" height="32" class="text-primary mb-2" %}
- <h3>Installation</h3>
- <p>Include Bootstrap’s source Sass and JavaScript files via npm, Composer or Meteor. Package managed installs don’t include documentation, but do include our build system and readme.</p>
-
-{% highlight sh %}
-npm install bootstrap
-{% endhighlight %}
-
-{% highlight sh %}
-gem install bootstrap -v {{ site.current_ruby_version }}
-{% endhighlight %}
-
- <hr class="half-rule">
- <a class="btn btn-outline-primary" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/download/">Read installation docs</a>
- </div>
-
- <div class="col-12 col-md-4 p-3 p-md-5 bg-light border border-white">
- <!-- Icon by Bytesize https://github.com/danklammer/bytesize-icons -->
- {% include icons/download.svg width="32" height="32" class="text-primary mb-2" %}
- <h3>BootstrapCDN</h3>
- <p>When you only need to include Bootstrap’s compiled CSS or JS, you can use <a href="https://www.bootstrapcdn.com/">BootstrapCDN</a>.</p>
-
-<h5>CSS only</h5>
-{% highlight html %}
-<link rel="stylesheet" href="{{ site.cdn.css }}" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
-{% endhighlight %}
-
-<h5>JS and Popper.js</h5>
-{% highlight html %}
-<script src="{{ site.cdn.popper }}" integrity="{{ site.cdn.popper_hash }}" crossorigin="anonymous"></script>
-<script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
-{% endhighlight %}
- <hr class="half-rule">
- <a class="btn btn-outline-primary" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/layout/overview/">Explore the docs</a>
- </div>
-
- <div class="col-12 col-md-4 p-3 p-md-5 bg-light border border-white">
- <!-- Icon by Bytesize https://github.com/danklammer/bytesize-icons -->
- {% include icons/lightning.svg width="32" height="32" class="text-primary mb-2" %}
- <h3>Official Themes</h3>
- <p>
- Take Bootstrap 4 to the next level with official premium themes—toolkits built on Bootstrap with new components and plugins, docs, and build tools.
- </p>
- <img class="img-fluid mt-3 mx-auto" srcset="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/bootstrap-themes.png,
- {{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/bootstrap-themes@2x.png 2x"
- src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/bootstrap-themes.png" alt="Bootstrap Themes" width="500" height="200">
- <hr class="half-rule">
- <a href="{{ site.themes }}/" class="btn btn-outline-primary">Browse themes</a>
- </div>
-</div>
--- /dev/null
+<!doctype html>
+<html lang="en">
+ <head>
+ {{ partial "header" . }}
+ </head>
+ <body>
+ {{ partial "skippy" . }}
+
+ {{ partial "docs-navbar" . }}
+
+ <div class="container-fluid">
+ <div class="row flex-xl-nowrap">
+ <div class="col-12 col-md-3 col-xl-2 bd-sidebar">
+ {{ partial "docs-sidebar" . }}
+ </div>
+
+ {{ if (eq .Page.Params.toc true) }}
+ <nav class="d-none d-xl-block col-xl-2 bd-toc" aria-label="Secondary navigation">
+ {{ .TableOfContents }}
+ </nav>
+ {{ end }}
+
+ <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
+ <h1 class="bd-title" id="content">{{ .Title | markdownify }}</h1>
+ <p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p>
+ {{ partial "ads" . }}
+ {{ .Content }}
+ </main>
+ </div>
+ </div>
+
+ {{ partial "scripts" . }}
+ </body>
+</html>
--- /dev/null
+<!doctype html>
+<html lang="en"{{ with .Page.Params.html_class }} class="{{ . }}"{{ end }}>
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="description" content="">
+ <meta name="author" content="{{ .Site.Params.authors }}">
+ <meta name="generator" content="Hugo {{ .Hugo.Version }}">
+ <title>{{ .Page.Title | markdownify }} · {{ .Site.Title | markdownify }}</title>
+
+ <link rel="canonical" href="{{ .Permalink }}">
+
+ {{ partial "stylesheet" . }}
+
+ <style>
+ .bd-placeholder-img {
+ font-size: 1.125rem;
+ text-anchor: middle;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ }
+
+ @media (min-width: 768px) {
+ .bd-placeholder-img-lg {
+ font-size: 3.5rem;
+ }
+ }
+ </style>
+
+ {{ range .Page.Params.extra_css }}
+ {{ "<!-- Custom styles for this template -->" | safeHTML }}
+ <link href="{{ . }}" rel="stylesheet">
+ {{- end }}
+ </head>
+ <body{{ with .Page.Params.body_class }} class="{{ . }}"{{ end }}>
+ {{ .Content }}
+
+ {{ if ne .Page.Params.include_js false }}
+ {{ if eq (getenv "HUGO_ENV") "production" }}
+ <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ .Site.Params.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
+ {{ else }}
+ <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
+ {{ end }}
+
+ {{ range .Page.Params.extra_js }}
+ <script src="{{ . }}"></script>
+ {{- end }}
+ {{ end }}
+ </body>
+</html>
--- /dev/null
+<!doctype html>
+<html lang="en">
+ <head>
+ {{ partial "header" . }}
+ </head>
+ <body>
+ {{ partial "skippy" . }}
+
+ {{ partial "docs-navbar" . }}
+
+ {{ partial "home/masthead" . }}
+ {{ partial "home/masthead-followup" . }}
+
+ {{ .Content }}
+
+ {{ partial "footer" . }}
+ {{ partial "scripts" . }}
+ </body>
+</html>
--- /dev/null
+<!doctype html>
+<html lang="en">
+ <head>
+ {{ partial "header" . }}
+ </head>
+ <body>
+ {{ partial "skippy" . }}
+
+ {{ partial "docs-navbar" . }}
+
+ <header class="d-flex flex-column flex-md-row align-items-md-center p-5 bg-light">
+ <div class="pt-md-3 pb-md-4">
+ <h1 class="bd-title mt-0">{{ .Title | markdownify }}</h1>
+ <p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p>
+ {{ if eq .Title "Examples" }}
+ <a href="{{ .Site.Params.download.source }}" class="btn btn-lg btn-bd-primary" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download');">Download source code</a>
+ {{ end }}
+ </div>
+ {{ partial "ads" . }}
+ </header>
+
+ <main class="bd-content p-5" id="content" role="main">
+ {{ .Content }}
+ </main>
+
+ {{ partial "footer" . }}
+ {{ partial "scripts" . }}
+ </body>
+</html>
--- /dev/null
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>{{ .Permalink }}</title>
+ <link rel="canonical" href="{{ .Permalink }}">
+ <meta name="robots" content="noindex">
+ <meta http-equiv="refresh" content="0; url={{ .Permalink }}">
+ </head>
+</html>
-{% capture callout %}
#### Asynchronous methods and transitions
All API methods are **asynchronous** and start a **transition**. They return to the caller as soon as the transition is started but **before it ends**. In addition, a method call on a **transitioning component will be ignored**.
-[See our JavaScript documentation for more information]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/).
-{% endcapture %}
-{% include callout.html content=callout type="danger" %}
+[See our JavaScript documentation for more information](/docs/{{ .Site.Params.docs_version }}/getting-started/javascript/).
-{% capture callout %}
Note that since browsers do not currently support [range context queries](https://www.w3.org/TR/mediaqueries-4/#range-context), we work around the limitations of [`min-` and `max-` prefixes](https://www.w3.org/TR/mediaqueries-4/#mq-min-max) and viewports with fractional widths (which can occur under certain conditions on high-dpi devices, for instance) by using values with higher precision for these comparisons.
-{% endcapture %}
-{% include callout.html content=callout type="info" %}
--- /dev/null
+The animation effect of this component is dependent on the `prefers-reduced-motion` media query. See the [reduced motion section of our accessibility documentation](/docs/{{ .Site.Params.docs_version }}/getting-started/accessibility/#reduced-motion).
-{% capture callout %}
##### Conveying meaning to assistive technologies
Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the `.sr-only` class.
-{% endcapture %}
-{% include callout.html content=callout type="warning" %}
--- /dev/null
+<header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
+ <a class="navbar-brand mr-0 mr-md-2" href="/" aria-label="Bootstrap">
+ {{ partial "icons/bootstrap.svg" (dict "class" "d-block" "width" "36" "height" "36") }}
+ </a>
+
+ <div class="navbar-nav-scroll">
+ <ul class="navbar-nav bd-navbar-nav flex-row">
+ <li class="nav-item">
+ <a class="nav-link{{ if .IsHome }} active{{ end }}" href="/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Home</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link{{ if eq .Page.Layout "docs" }} active{{ end }}" href="/docs/{{ .Site.Params.docs_version }}/getting-started/introduction/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Docs');">Documentation</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link{{ if eq .Page.Title "Examples" }} active{{ end }}" href="/docs/{{ .Site.Params.docs_version }}/examples/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Examples');">Examples</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="{{ .Site.Params.themes }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');" target="_blank" rel="noopener">Themes</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="{{ .Site.Params.expo }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Expo');" target="_blank" rel="noopener">Expo</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="{{ .Site.Params.blog }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Blog');" target="_blank" rel="noopener">Blog</a>
+ </li>
+ </ul>
+ </div>
+
+ <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
+ <li class="nav-item dropdown">
+ <a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-expanded="false">
+ v{{ .Site.Params.docs_version }}
+ </a>
+ <div class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-versions">
+ <a class="dropdown-item active" href="/docs/{{ .Site.Params.docs_version }}/">Latest (4.3.x)</a>
+ <a class="dropdown-item" href="https://getbootstrap.com/docs/4.2/">v4.2.1</a>
+ <a class="dropdown-item" href="https://getbootstrap.com/docs/4.0/">v4.0.0</a>
+ <div class="dropdown-divider"></div>
+ <a class="dropdown-item" href="https://v4-alpha.getbootstrap.com/">v4 Alpha 6</a>
+ <a class="dropdown-item" href="https://getbootstrap.com/docs/3.4/">v3.4.1</a>
+ <a class="dropdown-item" href="https://getbootstrap.com/docs/3.3/">v3.3.7</a>
+ <a class="dropdown-item" href="https://getbootstrap.com/2.3.2/">v2.3.2</a>
+ <div class="dropdown-divider"></div>
+ <a class="dropdown-item" href="/docs/versions/">All versions</a>
+ </div>
+ </li>
+
+ <li class="nav-item">
+ <a class="nav-link p-2" href="{{ .Site.Params.repo }}" target="_blank" rel="noopener" aria-label="GitHub">
+ {{ partial "icons/github.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+ </a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link p-2" href="https://twitter.com/{{ .Site.Params.twitter }}" target="_blank" rel="noopener" aria-label="Twitter">
+ {{ partial "icons/twitter.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+ </a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link p-2" href="{{ .Site.Params.slack }}/" target="_blank" rel="noopener" aria-label="Slack">
+ {{ partial "icons/slack.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+ </a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link p-2" href="{{ .Site.Params.opencollective }}/" target="_blank" rel="noopener" aria-label="Open Collective">
+ {{ partial "icons/opencollective.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+ </a>
+ </li>
+ </ul>
+
+ <a class="btn btn-bd-download d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3" href="/docs/{{ .Site.Params.docs_version }}/getting-started/download/">Download</a>
+</header>
--- /dev/null
+<form class="bd-search d-flex align-items-center">
+ <input type="search" class="form-control" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off" data-docs-version="{{ .Site.Params.docs_version }}">
+ <button class="btn btn-link bd-search-docs-toggle d-md-none p-0 ml-3" type="button" data-toggle="collapse" data-target="#bd-docs-nav" aria-controls="bd-docs-nav" aria-expanded="false" aria-label="Toggle docs navigation">
+ {{ partial "icons/menu.svg" (dict "width" "30" "height" "30") }}
+ </button>
+</form>
+
+<nav class="collapse bd-links" id="bd-docs-nav" aria-label="Main navigation">
+ {{- $url := split .URL "/" -}}
+ {{- $page_slug := index $url (sub (len $url) 2) -}}
+
+ {{- range $group := .Site.Data.nav -}}
+ {{- $link := $group.title -}}
+ {{- $link_slug := $link | urlize -}}
+
+ {{- if $group.pages -}}
+ {{- $link = index $group.pages 0 -}}
+ {{- $link_slug = $link.title | urlize -}}
+ {{- end -}}
+
+ {{- $group_slug := $group.title | urlize -}}
+ {{- $active_group := eq $.Page.Params.group $group_slug }}
+
+ <div class="bd-toc-item{{ if $active_group }} active{{ end }}">
+ <a class="bd-toc-link" href="/docs/{{ $.Site.Params.docs_version }}/{{ $group_slug }}/{{ if $group.pages }}{{ $link_slug }}/{{ end }}">
+ {{- $group.title -}}
+ </a>
+
+ {{- if and $active_group $group.pages }}
+ <ul class="nav bd-sidenav">
+ {{- range $doc := $group.pages -}}
+ {{- $doc_slug := $doc.title | urlize }}
+ <li{{ if and $active_group (eq $page_slug $doc_slug) }} class="active bd-sidenav-active"{{ end }}>
+ <a href="/docs/{{ $.Site.Params.docs_version }}/{{ $group_slug }}/{{ $doc_slug }}/">
+ {{- $doc.title -}}
+ </a>
+ </li>
+ {{- end }}
+ </ul>
+ {{- end }}
+ </div>
+ {{- end }}
+</nav>
--- /dev/null
+{{ "<!-- Favicons -->" | safeHTML }}
+<link rel="apple-touch-icon" href="/docs/{{ .Site.Params.docs_version }}/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
+<link rel="icon" href="/docs/{{ .Site.Params.docs_version }}/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
+<link rel="icon" href="/docs/{{ .Site.Params.docs_version }}/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
+<link rel="manifest" href="/docs/{{ .Site.Params.docs_version }}/assets/img/favicons/manifest.json">
+<link rel="mask-icon" href="/docs/{{ .Site.Params.docs_version }}/assets/img/favicons/safari-pinned-tab.svg" color="#563d7c">
+<link rel="icon" href="/docs/{{ .Site.Params.docs_version }}/assets/img/favicons/favicon.ico">
+<meta name="msapplication-config" content="/docs/{{ .Site.Params.docs_version }}/assets/img/favicons/browserconfig.xml">
+<meta name="theme-color" content="#563d7c">
--- /dev/null
+<footer class="bd-footer text-muted">
+ <div class="container-fluid p-3 p-md-5">
+ <ul class="bd-footer-links">
+ <li><a href="{{ .Site.Params.repo }}">GitHub</a></li>
+ <li><a href="https://twitter.com/{{ .Site.Params.twitter }}">Twitter</a></li>
+ <li><a href="/docs/{{ .Site.Params.docs_version }}/examples/">Examples</a></li>
+ <li><a href="/docs/{{ .Site.Params.docs_version }}/about/overview/">About</a></li>
+ </ul>
+ <p>Designed and built with all the love in the world by the <a href="/docs/{{ .Site.Params.docs_version }}/about/team/">Bootstrap team</a> with the help of <a href="{{ .Site.Params.repo }}/graphs/contributors">our contributors</a>.</p>
+ <p>Currently v{{ .Site.Params.current_version }}. Code licensed <a href="{{ .Site.Params.repo }}/blob/master/LICENSE" target="_blank" rel="license noopener">MIT</a>, docs <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" rel="license noopener">CC BY 3.0</a>.</p>
+ </div>
+</footer>
--- /dev/null
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="description" content="{{ index .Page.Params "description" | default .Site.Params.description | markdownify }}">
+<meta name="author" content="{{ .Site.Params.authors }}">
+<meta name="generator" content="Hugo {{ .Hugo.Version }}">
+
+<meta name="docsearch:language" content="en">
+<meta name="docsearch:version" content="{{ .Site.Params.docs_version }}">
+
+<title>{{ if .IsHome }}{{ .Site.Title | markdownify }} · {{ .Site.Params.description | markdownify }}{{ else }}{{ .Title | markdownify }} · {{ .Site.Title | markdownify }}{{ end }}</title>
+
+<link rel="canonical" href="{{ .Permalink }}">
+
+{{ partial "stylesheet" . }}
+{{ partial "favicons" . }}
+{{ partial "social" . }}
+{{ partial "analytics" . }}
--- /dev/null
+<div class="masthead-followup row m-0 border border-white">
+ <div class="col-12 col-md-4 p-3 p-md-5 bg-light border border-white">
+ {{ "<!-- Icon by Bytesize https://github.com/danklammer/bytesize-icons -->" | safeHTML }}
+ {{ partial "icons/import.svg" (dict "class" "text-primary mb-2" "width" "32" "height" "32") }}
+ <h3>Installation</h3>
+ <p>Include Bootstrap’s source Sass and JavaScript files via npm, Composer or Meteor. Package managed installs don’t include documentation, but do include our build system and readme.</p>
+
+ {{ highlight "npm install bootstrap" "sh" "" }}
+
+ {{ highlight (printf ("gem install bootstrap -v %s") .Site.Params.current_ruby_version) "sh" "" }}
+
+ <hr class="half-rule">
+ <a class="btn btn-outline-primary" href="/docs/{{ .Site.Params.docs_version }}/getting-started/download/">Read installation docs</a>
+ </div>
+
+ <div class="col-12 col-md-4 p-3 p-md-5 bg-light border border-white">
+ {{ "<!-- Icon by Bytesize https://github.com/danklammer/bytesize-icons -->" | safeHTML }}
+ {{ partial "icons/download.svg" (dict "class" "text-primary mb-2" "width" "32" "height" "32") }}
+ <h3>BootstrapCDN</h3>
+ <p>When you only need to include Bootstrap’s compiled CSS or JS, you can use <a href="https://www.bootstrapcdn.com/">BootstrapCDN</a>.</p>
+
+ <h5>CSS only</h5>
+ {{ highlight (printf (`<link rel="stylesheet" href="%s" integrity="%s" crossorigin="anonymous">`) .Site.Params.cdn.css .Site.Params.cdn.css_hash) "html" "" }}
+
+ <h5>JS and Popper.js</h5>
+ {{ highlight (printf (`<script src="%s" integrity="%s" crossorigin="anonymous"></script>
+<script src="%s" integrity="%s" crossorigin="anonymous"></script>
+`) .Site.Params.cdn.popper .Site.Params.cdn.popper_hash .Site.Params.cdn.js .Site.Params.cdn.js_hash) "html" "" }}
+ <hr class="half-rule">
+ <a class="btn btn-outline-primary" href="/docs/{{ .Site.Params.docs_version }}/layout/overview/">Explore the docs</a>
+ </div>
+
+ <div class="col-12 col-md-4 p-3 p-md-5 bg-light border border-white">
+ {{ "<!-- Icon by Bytesize https://github.com/danklammer/bytesize-icons -->" | safeHTML }}
+ {{ partial "icons/lightning.svg" (dict "class" "text-primary mb-2" "width" "32" "height" "32") }}
+ <h3>Official Themes</h3>
+ <p>
+ Take Bootstrap 4 to the next level with official premium themes—toolkits built on Bootstrap with new components and plugins, docs, and build tools.
+ </p>
+ <img class="img-fluid mt-3 mx-auto" srcset="/docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes.png,
+ /docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes@2x.png 2x"
+ src="/docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes.png" alt="Bootstrap Themes" width="500" height="200">
+ <hr class="half-rule">
+ <a href="{{ .Site.Params.themes }}/" class="btn btn-outline-primary">Browse themes</a>
+ </div>
+</div>
--- /dev/null
+<main class="bd-masthead" id="content" role="main">
+ <div class="container">
+ <div class="row align-items-center">
+ <div class="col-6 mx-auto col-md-6 order-md-2">
+ {{ partial "icons/bootstrap-stack.svg" (dict "class" "img-fluid mb-3 mb-md-0" "width" "512" "height" "430") }}
+ </div>
+ <div class="col-md-6 order-md-1 text-center text-md-left pr-md-5">
+ <h1 class="mb-3 bd-text-purple-bright">Bootstrap</h1>
+ <p class="lead">
+ Build responsive, mobile-first projects on the web with the world’s most popular front-end component library.
+ </p>
+ <p class="lead mb-4">
+ Bootstrap is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with our Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful plugins built with VanillaJS.
+ </p>
+ <div class="row mx-n2">
+ <div class="col-md px-2">
+ <a href="/docs/{{ .Site.Params.docs_version }}/getting-started/introduction/" class="btn btn-lg btn-bd-primary w-100 mb-3" onclick="ga('send', 'event', 'Jumbotron actions', 'Get started', 'Get started');">Get started</a>
+ </div>
+ <div class="col-md px-2">
+ <a href="/docs/{{ .Site.Params.docs_version }}/getting-started/download/" class="btn btn-lg btn-outline-secondary w-100 mb-3" onclick="ga('send', 'event', 'Jumbotron actions', 'Download', 'Download {{ .Site.Params.current_version }}');">Download</a>
+ </div>
+ </div>
+ <p class="text-muted mb-0">
+ Currently v{{ .Site.Params.current_version }}
+ </p>
+ </div>
+ </div>
+ {{ partial "ads.html" . }}
+ </div>
+</main>
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 1024 860" role="img"><title>Bootstrap</title><defs><linearGradient id="c" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#5C24AE"/><stop offset="100%" stop-color="#30135A"/></linearGradient><path id="b" d="M355.967 242.807l-322 216.395c-44.275 29.754-44.275 78.443 0 108.197l322 216.395c44.275 29.754 116.725 29.754 161 0l322-216.395c44.275-29.754 44.275-78.443 0-108.197l-322-216.395c-44.275-29.754-116.725-29.754-161 0z"/><filter id="a" width="108%" height="112%" x="-4%" y="-4.3%" filterUnits="objectBoundingBox"><feOffset dy="10" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="10"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/></filter><linearGradient id="f" x1="50%" x2="50%" y1="-17.303%" y2="100%"><stop offset="0%" stop-color="#7331D4"/><stop offset="100%" stop-color="#461B84"/></linearGradient><path id="e" d="M355.967 132.807l-322 216.395c-44.275 29.754-44.275 78.443 0 108.197l322 216.395c44.275 29.754 116.725 29.754 161 0l322-216.395c44.275-29.754 44.275-78.443 0-108.197l-322-216.395c-44.275-29.754-116.725-29.754-161 0z"/><filter id="d" width="108%" height="112%" x="-4%" y="-4.3%" filterUnits="objectBoundingBox"><feOffset dy="10" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="10"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/></filter><linearGradient id="i" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#905BDD"/><stop offset="100%" stop-color="#5521A0"/></linearGradient><path id="h" d="M355.967 22.807l-322 216.395c-44.275 29.754-44.275 78.443 0 108.197l322 216.395c44.275 29.754 116.725 29.754 161 0l322-216.395c44.275-29.754 44.275-78.443 0-108.197l-322-216.395c-44.275-29.754-116.725-29.754-161 0z"/><filter id="g" width="108%" height="112%" x="-4%" y="-4.3%" filterUnits="objectBoundingBox"><feOffset dy="10" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="10"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/></filter></defs><g fill="none"><g transform="translate(75 23)"><use fill="#000" filter="url(#a)" xlink:href="#b"/><use fill="url(#c)" xlink:href="#b"/></g><g transform="translate(75 23)"><use fill="#000" filter="url(#d)" xlink:href="#e"/><use fill="url(#f)" xlink:href="#e"/></g><g transform="translate(75 23)"><use fill="#000" filter="url(#g)" xlink:href="#h"/><use fill="url(#i)" xlink:href="#h"/></g><path fill="#FFF" d="M558.273 447.667L308.036 279.5l97.982-65.847c42.83-28.784 96.789-31.483 134.245-6.311 26.044 17.502 31.214 46.615 11.444 65.724l1.389.934c38.324-19.932 84.107-18.527 117.396 3.845 44.046 29.6 38.671 68.419-14.561 104.193l-97.658 65.629zM447.112 331.01l49.942-33.562c36.935-24.822 42.31-48.249 15.224-66.451-24.798-16.665-55.49-14.453-85.851 5.95l-59.641 40.081 80.326 53.982zm176.532 35.663c37.63-25.289 42.136-48.832 13.203-68.276-28.932-19.444-64.163-15.614-104.042 11.186l-58.789 39.508 87.92 59.084 61.708-41.502z"/></g></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 612 612" role="img"><title>Bootstrap</title><path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"/><path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }} fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true"{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 32 32"><title>Download</title><path d="M9 22c-9 1-8-10 0-9C6 2 23 2 22 10c10-3 10 13 1 12m-12 4l5 4 5-4m-5-10v14"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 512 499.36" role="img"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }} fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true"{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 32 32"><title>Import</title><path d="M28 22v8H4v-8M16 4v20m-8-8l8 8 8-8"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }} fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true"{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 32 32"><title>Lightning</title><path d="M18 13l8-11L8 13l6 6-8 11 18-11z"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 30 30" role="img"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }} fill="currentColor" fill-rule="evenodd"{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 40 41" role="img"><title>Open Collective</title><path fill-opacity=".4" d="M32.8 21c0 2.4-.8 4.9-2 6.9l5.1 5.1c2.5-3.4 4.1-7.6 4.1-12 0-4.6-1.6-8.8-4-12.2L30.7 14c1.2 2 2 4.3 2 7z"/><path d="M20 33.7a12.8 12.8 0 0 1 0-25.6c2.6 0 5 .7 7 2.1L32 5a20 20 0 1 0 .1 31.9l-5-5.2a13 13 0 0 1-7 2z"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 512 512" role="img"><title>Slack</title><path fill="currentColor" d="M210.787 234.832l68.31-22.883 22.1 65.977-68.309 22.882z"/><path fill="currentColor" d="M490.54 185.6C437.7 9.59 361.6-31.34 185.6 21.46S-31.3 150.4 21.46 326.4 150.4 543.3 326.4 490.54 543.34 361.6 490.54 185.6zM401.7 299.8l-33.15 11.05 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.38-68.36 22.92 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.43-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.5-13.92 2.87-29.06 16.78-33.56l33.12-11.03-22.1-65.9-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.48-13.93 2.89-29.07 16.81-33.58l33.15-11.05-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.46 34.38 68.36-22.92-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.47 34.42 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.87 29.06-16.78 33.56L329.7 194.6l22.1 65.9 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.88 29.07-16.81 33.57z"/></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 512 416.32" role="img"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg>
\ No newline at end of file
--- /dev/null
+{{ if eq (getenv "HUGO_ENV") "production" -}}
+ <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ .Site.Params.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
+{{ else -}}
+ <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
+{{- end }}
+
+{{ if eq .Page.Layout "docs" -}}
+<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
+{{- end }}
+
+{{- if eq (getenv "HUGO_ENV") "production" -}}
+ <script src="/docs/{{ .Site.Params.docs_version }}/assets/js/docs.min.js"></script>
+{{- else -}}
+ <script src="/docs/{{ .Site.Params.docs_version }}/assets/js/vendor/anchor.min.js"></script>
+ <script src="/docs/{{ .Site.Params.docs_version }}/assets/js/vendor/clipboard.min.js"></script>
+ <script src="/docs/{{ .Site.Params.docs_version }}/assets/js/vendor/bs-custom-file-input.min.js"></script>
+ <script src="/docs/{{ .Site.Params.docs_version }}/assets/js/src/application.js"></script>
+ <script src="/docs/{{ .Site.Params.docs_version }}/assets/js/src/search.js"></script>
+{{- end -}}
--- /dev/null
+{{ "<!-- Twitter -->" | safeHTML }}
+<meta name="twitter:card" content="{{ if .IsHome }}summary_large_image{{ else }}summary{{ end }}">
+<meta name="twitter:site" content="@{{ .Site.Params.twitter }}">
+<meta name="twitter:creator" content="@{{ .Site.Params.twitter }}">
+<meta name="twitter:title" content="{{ .Title | markdownify }}">
+<meta name="twitter:description" content="{{ index .Page.Params "description" | default .Site.Params.description | markdownify }}">
+<meta name="twitter:image" content="{{ if .IsHome }}{{ .Site.BaseURL }}{{ .Site.Params.social_logo_path }}{{ else }}{{ .Site.BaseURL }}{{ .Site.Params.social_image_path }}{{ end }}">
+
+{{ "<!-- Facebook -->" | safeHTML }}
+<meta property="og:url" content="{{ .Permalink }}">
+<meta property="og:title" content="{{ .Title | markdownify }}">
+<meta property="og:description" content="{{ index .Page.Params "description" | default .Site.Params.description | markdownify }}">
+<meta property="og:type" content="website">
+<meta property="og:image" content="{{ replace .Site.BaseURL "https://" "http://" }}{{ .Site.Params.social_image_path }}">
+<meta property="og:image:secure_url" content="{{ .Site.BaseURL }}{{ .Site.Params.social_image_path }}">
+<meta property="og:image:type" content="image/png">
+<meta property="og:image:width" content="1200">
+<meta property="og:image:height" content="630">
--- /dev/null
+{{- "<!-- Bootstrap core CSS -->" | safeHTML }}
+{{ if eq (getenv "HUGO_ENV") "production" -}}
+<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.min.css" rel="stylesheet" integrity="{{ .Site.Params.cdn.css_hash }}" crossorigin="anonymous">
+{{- else -}}
+<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.css" rel="stylesheet">
+{{- end }}
+
+{{ if (or (eq .Page.Layout "docs") (ne .Page.Layout "examples")) -}}
+{{- "<!-- Documentation extras -->" | safeHTML }}
+{{ if eq .Page.Layout "docs" -}}
+<link href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" rel="stylesheet">
+{{- end -}}
+{{- if (ne .Page.Layout "examples") }}
+<link href="/docs/{{ .Site.Params.docs_version }}/assets/css/docs.min.css" rel="stylesheet">
+{{- end -}}
+{{- end }}
--- /dev/null
+# www.robotstxt.org
+
+{{ if (eq (getenv "HUGO_ENV") "production") -}}
+# Allow crawling of all content
+{{- end }}
+User-agent: *
+Disallow:{{ if (ne (getenv "HUGO_ENV") "production") }} /{{ end }}
+Sitemap: {{ .Site.BaseURL }}/sitemap.xml
--- /dev/null
+{{- $words := (split .Inner " ") -}}
+
+{{- range $word := $words -}}
+ {{- if (strings.Contains $word "#") -}}
+ {{- $separator := false -}}
+
+ {{- if (strings.Contains $word ",") -}}
+ {{- $separator = true -}}
+ {{- end -}}
+
+ {{- $data := split $word "#" -}}
+ {{- $bug_cat := replace (index $data 0) "\n" "" -}}
+ {{- $bug_id := replace (index $data 1) "\n" "" -}}
+ {{- $bug_id = replace $bug_id "," "" -}}
+
+ {{- if (eq $bug_cat "Bootstrap") -}}
+ <a href="https://github.com/twbs/bootstrap/issues/{{ $bug_id }}">#{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "Edge") -}}
+ <a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/{{ $bug_id }}/">Edge issue #{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "A11yUserVoice") -}}
+ <a href="https://microsoftaccessibility.uservoice.com/forums/307429-microsoft-accessibility-feedback/suggestions/{{ $bug_id }}">Microsoft A11y UserVoice idea #{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "UserVoice") -}}
+ <a href="https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/{{ $bug_id }}">Edge UserVoice idea #{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "Mozilla") -}}
+ <a href="https://bugzilla.mozilla.org/show_bug.cgi?id={{ $bug_id }}">Mozilla bug #{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "Chromium") -}}
+ <a href="https://bugs.chromium.org/p/chromium/issues/detail?id={{ $bug_id }}">Chromium issue #{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "WebKit") -}}
+ <a href="https://bugs.webkit.org/show_bug.cgi?id={{ $bug_id }}">WebKit bug #{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "Safari") -}}
+ <a href="https://openradar.appspot.com/{{ $bug_id }}">Apple Safari Radar #{{ $bug_id }}</a>
+ {{- else if (eq $bug_cat "Normalize") -}}
+ <a href="https://github.com/necolas/normalize.css/issues/{{ $bug_id }}">Normalize #{{ $bug_id }}</a>
+ {{- end -}}
+ {{- if (eq $separator true) }}, {{ end -}}
+
+ {{- else -}}
+ {{- $word -}}
+ {{- end -}}
+{{- end -}}
--- /dev/null
+{{- /*
+ Usage: `callout "type"`,
+ where type is one of info (default), danger, warning
+*/ -}}
+
+{{- $css_class := .Get 0 | default "info" -}}
+
+<div class="bd-callout bd-callout-{{ $css_class }}">
+{{ .Inner | markdownify }}
+</div>
--- /dev/null
+{{- /*
+ Usage: `example [args]`
+
+ `args` are optional and can be one of the following:
+ id: the `div`'s id - default: ""
+ class: any extra class(es) to be added to the `div` - default ""
+ show_preview: if the preview should be output in the HTML - default: `true`
+ show_markup: if the markup should be output in the HTML - default: `true`
+*/ -}}
+
+{{- $show_preview := .Get "show_preview" | default true -}}
+{{- $show_markup := .Get "show_markup" | default true -}}
+{{- $input := .Inner -}}
+
+{{- if eq $show_preview true -}}
+<div{{ with .Get "id" }} id="{{ . }}"{{ end }} class="bd-example{{ with .Get "class" }} {{ . }}{{ end }}">
+ {{- $input -}}
+</div>
+{{- end -}}
+
+{{- if eq $show_markup true -}}
+ {{- $.Scratch.Set "highlight_content" $input -}}
+
+ {{- if (strings.Contains $input `<svg class="bd-placeholder-img`) -}}
+ {{- $.Scratch.Set "highlight_content" "" -}}
+ {{- $image_class := "" -}}
+
+ {{- $modified_content := replace $input `<svg class="bd-placeholder-img` `✂️<svg class="bd-placeholder-img` -}}
+ {{- $modified_content = replace $modified_content "</svg>\n" "</svg>✂️" -}}
+ {{- $modified_content = split $modified_content "✂️" -}}
+
+ {{- if (strings.Contains $input `<svg class="bd-placeholder-img `) -}}
+ {{- $image_class = replace $input "bd-placeholder-img " "bd-placeholder-img ✂️ " -}}
+ {{- $image_class = split (replace $image_class `" width="` `✂️" width="`) "✂️" -}}
+ {{- $image_class = replace (index $image_class 1) "bd-placeholder-img-lg" "" -}}
+ {{- $image_class = trim $image_class " " -}}
+ {{- end -}}
+
+ {{- range $i, $content_chunk := $modified_content -}}
+ {{- if (strings.Contains $content_chunk `<svg class="bd-placeholder-img`) -}}
+ {{- if $image_class -}}
+ {{- $.Scratch.Add "highlight_content" (printf `<img src="..." class="%s" alt="...">` $image_class) -}}
+ {{- else -}}
+ {{- $.Scratch.Add "highlight_content" `<img src="..." alt="...">` -}}
+ {{- end -}}
+ {{- else -}}
+ {{- $.Scratch.Add "highlight_content" $content_chunk -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+
+ {{- highlight (trim ($.Scratch.Get "highlight_content") "\n") "html" "" -}}
+{{- end -}}
--- /dev/null
+{{ range $entry := $.Site.Data.examples -}}
+ <h2>{{ $entry.category }}</h2>
+ <p>{{ $entry.description }}</p>
+
+ {{ range $i, $example := $entry.examples -}}
+ {{- $len := len $entry.examples -}}
+ {{ if (eq $i 0) }}<div class="row">{{ end }}
+ <div class="col-sm-6 col-md-4 col-xl-3 mb-3">
+ <a href="/docs/{{ $.Site.Params.docs_version }}/examples/{{ $example.name | urlize }}/">
+ <img class="img-thumbnail mb-3" srcset="/docs/{{ $.Site.Params.docs_version }}/assets/img/examples/{{ $example.name | urlize }}.png,
+ /docs/{{ $.Site.Params.docs_version }}/assets/img/examples/{{ $example.name | urlize }}@2x.png 2x"
+ src="/docs/{{ $.Site.Params.docs_version }}/assets/img/examples/{{ $example.name | urlize }}.png" alt="{{ $example.name }} screenshot" width="480" height="300">
+ <h5 class="mb-1">{{ $example.name }}</h5>
+ </a>
+ <p class="text-muted">{{ $example.description }}</p>
+ </div>
+ {{ if (eq (add $i 1) $len) }}</div>{{ end }}
+ {{ end -}}
+{{ end -}}
--- /dev/null
+<div class="row">
+ {{- range $release := (index $.Site.Data "docs-versions") }}
+ <div class="col-md">
+ <h2>{{ $release.group }}</h2>
+ <p>{{ $release.description }}</p>
+ {{- $versions := sort $release.versions "v" "desc" -}}
+ {{- range $i, $version := $versions }}
+ {{- $len := len $versions -}}
+ {{ if (eq $i 0) }}<div class="list-group">{{ end }}
+ <a class="list-group-item list-group-item-action py-2 text-primary{{ if (eq $version.v $.Site.Params.docs_version) }} d-flex justify-content-between align-items-center{{ end }}" href="{{ $release.baseurl }}/{{ $version.v }}/">
+ {{ $version.v }}
+ {{ if (eq $version.v $.Site.Params.docs_version) -}}
+ <span class="badge badge-primary">Latest</span>
+ {{- end }}
+ </a>
+ {{ if (eq (add $i 1) $len) }}</div>{{ end }}
+ {{ end -}}
+ </div>
+ {{ end -}}
+</div>
--- /dev/null
+{{- .Inner | markdownify -}}
--- /dev/null
+{{ partial (.Get 0) . }}
--- /dev/null
+{{- /*
+ Usage: `placeholder args`
+
+ args can be one of the following:
+ title: Used in the SVG `title` tag, default "Placeholder"
+ text: The text to show in the image - default: "width x height"
+ class: default: "bd-placeholder-img"
+ color: The text color (foreground) - default: "#dee2e6"
+ background: The background color - default: "#868e96"
+ width: default: 100%
+ height: default: 180px
+*/ -}}
+
+{{- $grays := $.Site.Data.grays -}}
+{{- $title := .Get "title" | default "Placeholder" -}}
+{{- $class := .Get "class" -}}
+{{- $color := .Get "color" | default (index $grays 2).hex -}}
+{{- $background := .Get "background" | default (index $grays 5).hex -}}
+{{- $width := .Get "width" | default "100%" -}}
+{{- $height := .Get "height" | default "180" -}}
+{{- $text := .Get "text" | default (printf "%sx%s" $width $height) -}}
+
+{{- $show_title := not (eq $title "false") -}}
+{{- $show_text := not (eq $text "false") -}}
+
+<svg class="bd-placeholder-img{{ with $class }} {{ . }}{{ end }}" width="{{ $width }}" height="{{ $height }}" xmlns="http://www.w3.org/2000/svg"{{ if (or $show_title $show_text) }} aria-label="{{ if $show_title }}{{ $title }}{{ if $show_text }}: {{ end }}{{ end }}{{ if ($show_text) }}{{ $text }}{{ end }}"{{ end }} preserveAspectRatio="xMidYMid slice" role="img">
+ {{- if $show_title -}}<title>{{ $title }}</title>{{- end -}}
+ <rect width="100%" height="100%" fill="{{ $background }}"/>
+ {{- if $show_text -}}<text x="50%" y="50%" fill="{{ $color }}" dy=".3em">{{ $text }}</text>{{- end -}}
+</svg>
--- /dev/null
+{{- /*
+ Output the current year
+*/ -}}
+
+{{- now.Format "2006" -}}
--- /dev/null
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ {{- range .Data.Pages -}}{{ if ne .Params.sitemap_exclude true }}
+ <url>
+ <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
+ <lastmod>{{ safeHTML (.Lastmod.Format "2006-01-02T15:04:05-07:00") }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
+ <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
+ <priority>{{ .Sitemap.Priority }}</priority>{{ end }}
+ </url>{{ end }}{{ end }}
+</urlset>
+++ /dev/null
----
----
-
-# www.robotstxt.org/
-
-# Allow crawling of all content
-User-agent: *
-Disallow:{% if jekyll.environment != "production" %} /{% endif %}
-Sitemap: {{ site.url }}/sitemap.xml
----
----
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
- <square150x150logo src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/mstile-150x150.png"/>
+ <square150x150logo src="/docs/4.3/assets/img/favicons/mstile-150x150.png"/>
<TileColor>#563d7c</TileColor>
</tile>
</msapplication>
----
----
{
"name": "Bootstrap",
"short_name": "Bootstrap",
"icons": [
{
- "src": "{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/android-chrome-192x192.png",
+ "src": "/docs/4.3/assets/img/favicons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
- "src": "{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/img/favicons/android-chrome-512x512.png",
+ "src": "/docs/4.3/assets/img/favicons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
// Better display for the responsive table on the Wall of Browser Bugs.
.bd-browser-bugs {
- td p {
- margin-bottom: 0;
- }
th:first-child {
width: 18%;
}
@include font-size(.875rem);
}
-.section-nav {
+// stylelint-disable selector-max-id, selector-max-type, selector-max-compound-selectors
+#TableOfContents {
padding-left: 0;
border-left: 1px solid #eee;
- ul {
- padding-left: 1rem;
+ > ul,
+ > ul > li > ul {
+ padding: 0;
}
-}
-.toc-entry {
- display: block;
+ a code {
+ font: inherit;
+ }
- a {
+ li {
display: block;
- padding: .125rem 1.5rem;
- color: #77757a;
- &:hover {
- color: $blue;
- text-decoration: none;
+ ul li ul {
+ padding-left: 1rem;
+ }
+
+ a {
+ display: block;
+ padding: .125rem 1.5rem;
+ color: #77757a;
+
+ &:hover {
+ color: $blue;
+ text-decoration: none;
+ }
}
}
}
+// stylelint-enable selector-max-id, selector-max-type, selector-max-compound-selectors
//
// Left side navigation
// Happy Bootstrapping!
// Load Bootstrap variables and mixins
-@import "../../../../../scss/functions";
-@import "../../../../../scss/variables";
-@import "../../../../../scss/mixins";
+@import "../../../../../../scss/functions";
+@import "../../../../../../scss/variables";
+@import "../../../../../../scss/mixins";
// Load docs components
@import "variables";