From: Mark Otto Date: Mon, 10 Nov 2014 06:02:53 +0000 (-0800) Subject: Merge branch 'master' into derp X-Git-Tag: v4.0.0-alpha~565 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86af1f3;p=thirdparty%2Fbootstrap.git Merge branch 'master' into derp Conflicts: Gruntfile.js _config.yml dist/css/bootstrap-theme.css dist/css/bootstrap-theme.css.map dist/css/bootstrap-theme.min.css dist/css/bootstrap.css dist/css/bootstrap.css.map dist/css/bootstrap.min.css docs/_includes/components/button-groups.html docs/_includes/components/jumbotron.html docs/_includes/components/media.html docs/_includes/components/navs.html docs/_includes/customizer-variables.html docs/_includes/footer.html docs/_includes/getting-started/browser-device-support.html docs/_includes/js/carousel.html docs/_includes/js/dropdowns.html docs/_includes/js/modal.html docs/_includes/js/popovers.html docs/_includes/js/tooltips.html docs/_includes/nav/getting-started.html docs/_includes/nav/javascript.html docs/_layouts/default.html docs/assets/css/docs.min.css docs/assets/css/src/docs.css docs/assets/js/customize.min.js docs/assets/js/docs.min.js docs/assets/js/raw-files.min.js docs/browser-bugs.html docs/dist/css/bootstrap-theme.css docs/dist/css/bootstrap-theme.css.map docs/dist/css/bootstrap-theme.min.css docs/dist/css/bootstrap.css docs/dist/css/bootstrap.css.map docs/dist/css/bootstrap.min.css docs/examples/justified-nav/index.html less/_forms.less less/_tooltip.less less/navs.less less/theme.less --- 86af1f39abbff7ef06b94d23951408ca27f81cdc diff --cc _config.yml index 48ca60cb5e,a936a3dde7..c0e9541b94 --- a/_config.yml +++ b/_config.yml @@@ -13,13 -10,11 +13,12 @@@ source: doc destination: _gh_pages host: 0.0.0.0 port: 9001 - baseurl: / url: http://getbootstrap.com encoding: UTF-8 +exclude: [assets/less/, assets/js/src/] # Custom vars - current_version: 3.2.0 + current_version: 3.3.0 repo: https://github.com/twbs/bootstrap sass_repo: https://github.com/twbs/bootstrap-sass @@@ -32,13 -27,6 +31,12 @@@ blog: http://blog.getbootst expo: http://expo.getbootstrap.com cdn: - css: https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css - css_theme: https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css - js: https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js + css: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css - css_theme: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css + js: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js + jquery: //code.jquery.com/jquery-2.1.1.min.js + +bug: + firefox: https://bugzilla.mozilla.org/show_bug.cgi?id= + webkit: https://bugs.webkit.org/show_bug.cgi?id= + chrome: https://code.google.com/p/chromium/issues/detail?id= + github: https://github.com/twbs/bootstrap/issues/ diff --cc docs/_includes/footer.html index 4b485f8857,24dfd26a51..44644f3229 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@@ -33,21 -33,32 +33,31 @@@ ================================================== --> - {% if jekyll.environment == "development" %} - - + {% if site.github %} + {% else %} - + {% endif %} - {% if jekyll.environment == "development" %} - + + {% if site.github %} + {% else %} - - - + {% for file in site.data.configBridge.paths.docsJs %} + + {% endfor %} {% endif %} + {% if page.slug == "customize" %} - + + {% if site.github %} + + {% else %} + {% for file in site.data.configBridge.paths.customizerJs %} - ++ + {% endfor %} + {% endif %} {% endif %} + diff --cc docs/assets/js/src/application.js index 949e35b7c0,c85c59dae9..9c1ec22c47 --- a/docs/assets/js/src/application.js +++ b/docs/assets/js/src/application.js @@@ -85,9 -109,20 +85,20 @@@ }, 3000) }) + // Modal relatedTarget demo + $('#exampleModal').on('show.bs.modal', function (event) { + var button = $(event.relatedTarget) // Button that triggered the modal + var recipient = button.data('whatever') // Extract info from data-* attributes + // If necessary, you could initiate an AJAX request here (and then do the updating in a callback). + // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead. + var modal = $(this) + modal.find('.modal-title').text('New message to ' + recipient) + modal.find('.modal-body input').val(recipient) + }) + // Activate animated progress bar $('.bs-docs-activate-animated-progressbar').on('click', function () { - $(this).siblings('.progress').find('.progress-bar-striped').toggleClass('active') + $(this).prev('.progress-striped').toggleClass('progress-animated') }) // Config ZeroClipboard diff --cc docs/assets/less/docs.less index 2c19f07ca8,0000000000..3a78f679f0 mode 100644,000000..100644 --- a/docs/assets/less/docs.less +++ b/docs/assets/less/docs.less @@@ -1,1428 -1,0 +1,1434 @@@ +/*! + * Bootstrap Docs (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under the Creative Commons Attribution 3.0 Unported License. For + * details, see http://creativecommons.org/licenses/by/3.0/. + */ + +// Import Bootstrap variables and mixins +@import "../../../less/_variables.less"; +@import "../../../less/_mixins.less"; + +// Import the syntax highlighting +@import "syntax.less"; + +// Local docs variables +@bs-purple: #563d7c; +@bs-purple-light: #cdbfe3; +@bs-yellow: #ffe484; +@bs-danger: #d9534f; +@bs-warning: #f0ad4e; +@bs-info: #5bc0de; + + +// Scaffolding +// +// Update the basics of our documents to prep for docs content. + +body { + position: relative; // For scrollspy? +} + + +// +// Buttons +// + +.btn-outline { + color: @bs-purple; + background-color: transparent; + border-color: @bs-purple; + + &:hover, + &:focus, + &:active { + color: #fff; + background-color:@bs-purple; + border-color: @bs-purple; + } +} + +.btn-outline-inverse { + color: #fff; + background-color: transparent; + border-color: @bs-purple-light; + + &:hover, + &:focus, + &:active { + color: @bs-purple; + text-shadow: none; + background-color: #fff; + border-color: #fff; + } +} + + +// +// Bootstrap "B" icon +// + +.bs-docs-booticon { + display: block; + width: 9rem; + height: 9rem; + font-size: 6.5rem; + font-weight: 500; + line-height: 8.8rem; + color: #fff; + text-align: center; + cursor: default; + background-color: @bs-purple; + border-radius: 15%; + + &.inverse { + color: @bs-purple; + background-color: #fff; + } + &.outline { + background-color: transparent; + border: 1px solid @bs-purple-light; + } +} + + +// +// Main navigation +// + +.bs-docs-nav { + margin-bottom: 0; + background-color: #563d7c; + border-bottom: 0; +} +.bs-home-nav .bs-nav-b { + display: none; +} +.bs-docs-nav .navbar-brand, +.bs-docs-nav .navbar-nav > li > a { + font-weight: 500; + color: #cdbfe3; +} +.bs-docs-nav .navbar-brand { + color: #fff; +} +.bs-docs-nav .navbar-nav > li > a:hover, +.bs-docs-nav .navbar-nav > .active > a, +.bs-docs-nav .navbar-nav > .active > a:hover { + color: #fff; + background-color: #563d7c; +} +.bs-docs-nav .navbar-toggle .icon-bar { + background-color: #fff; +} +.bs-docs-nav .navbar-header .navbar-toggle { + border-color: #322f38; +} +.bs-docs-nav .navbar-header .navbar-toggle:hover, +.bs-docs-nav .navbar-header .navbar-toggle:focus { + background-color: #29262f; + border-color: #29262f; +} + + +// +// Footer +// + +.bs-docs-footer { + margin-top: 6rem; + font-size: 85%; + color: #777; + text-align: center; + border-top: 1px solid #e5e5e5; +} +.bs-docs-footer-links { + padding-left: 0; + margin-top: 20px; + color: #999; +} +.bs-docs-footer-links li { + display: inline; + padding: 0 2px; +} +.bs-docs-footer-links li:first-child { + padding-left: 0; +} + +@media (min-width: 768px) { + .bs-docs-footer p { + margin-bottom: 0; + } + .bs-docs .bs-docs-footer { + text-align: left; + } +} + + +// +// Social buttons +// + +.bs-docs-social { + margin-bottom: 1.5rem; + text-align: center; +} +.bs-docs-social-buttons { + display: inline-block; + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.bs-docs-social-buttons li { + display: inline-block; + padding: .25rem .5rem; + line-height: 1; +} +.bs-docs-social-buttons .twitter-follow-button { + width: 225px !important; +} +.bs-docs-social-buttons .twitter-share-button { + width: 98px !important; +} + +// Style the GitHub buttons via CSS instead of inline attributes +.github-btn { + overflow: hidden; + border: 0; +} + +@media (min-width: 768px) { + .bs-docs .bs-docs-social { + margin-left: -.5rem; + text-align: left; + } +} + + +// +// Homepage +// + +// Masthead (headings and download button) +.bs-docs-masthead { + position: relative; + padding: 2rem 1rem; + color: #cdbfe3; + text-align: center; + text-shadow: 0 1px 0 rgba(0,0,0,.1); + background-color: #6f5499; + #gradient > .vertical(@bs-purple, #6f5499); +} + +.bs-docs-masthead .bs-docs-booticon { + margin: 0 auto 2rem; +} +.bs-docs-masthead h1 { + font-weight: 300; + line-height: 1; + color: #fff; +} +.bs-docs-masthead .lead { + margin: 0 auto 2rem; + font-size: 1.25rem; + color: #fff; +} +.bs-docs-masthead .version { + margin-top: -1rem; + margin-bottom: 2rem; + color: #9783b9; +} +.bs-docs-masthead .btn { + width: 100%; + padding: 1rem 2rem; + font-size: 1.25rem; +} + +@media (min-width: 480px) { + .bs-docs-masthead .btn { + width: auto; + } +} + +@media (min-width: 768px) { + .bs-docs-masthead { + padding: 5rem 0; + } + .bs-docs-masthead h1 { + font-size: 4rem; + } + .bs-docs-masthead .lead { + font-size: 1.5rem; + } +} + +@media (min-width: 992px) { + .bs-docs-masthead .lead { + width: 80%; + font-size: 2rem; + } +} + + +// +// Page headers +// + +.bs-docs-header { + padding-top: 2rem; + padding-bottom: 2rem; + margin-bottom: 2rem; + font-size: 1.25rem; + background-color: @bs-purple; +} +.bs-docs-header h1 { + margin-top: 0; + color: #fff; +} +.bs-docs-header p { + margin-bottom: 0; + font-weight: 300; + line-height: 1.4; + color: rgba(255,255,255,.65); +} +.bs-docs-header .container { + position: relative; +} + +@media (min-width: 768px) { + .bs-docs-header { + font-size: 1.5rem; + text-align: left; + } + .bs-docs-header h1 { + font-size: 4rem; + line-height: 1; + } +} + +@media (min-width: 992px) { + .bs-docs-header { + padding-top: 4rem; + padding-bottom: 4rem; + } + .bs-docs-header h1, + .bs-docs-header p { + margin-right: 380px; + } +} + + +// +// Carbon ads +// + +.carbonad { + width: auto !important; + height: auto !important; + padding: 1.25rem !important; + margin: 2rem -2rem -2rem !important; + overflow: hidden; /* clearfix */ + font-size: .8rem !important; + line-height: 1rem !important; + color: @bs-purple-light !important; + text-align: left; + background: transparent !important; + border: solid #866ab3 !important; + border-width: 1px 0 !important; +} +.carbonad-img { + margin: 0 !important; +} +.carbonad-text, +.carbonad-tag { + display: block !important; + float: none !important; + width: auto !important; + height: auto !important; + margin-left: 145px !important; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important; +} +.carbonad-text { + padding-top: 0 !important; +} +.carbonad-tag { + color: inherit !important; + text-align: left !important; +} +.carbonad-text a, +.carbonad-tag a { + color: #fff !important; +} +.carbonad #azcarbon > img { + display: none; // hide what I assume are tracking images +} + +// In the lighter page headers +// .bs-docs-header .carbonad { +// color: #777; +// background-color: #fff !important; +// border-color: #eee !important; +// } +// .bs-docs-header .carbonad-text a, +// .bs-docs-header .carbonad-tag a { +// color: @bs-purple !important; +// } + +@media (min-width: 480px) { + .carbonad { + width: 330px !important; + margin: 1.5rem auto !important; + border-width: 1px !important; + border-radius: .25rem; + } + .bs-docs-masthead .carbonad { + margin: 3rem auto 0 !important; + } +} + +@media (min-width: 768px) { + .carbonad { + margin-right: 0 !important; + margin-left: 0 !important; + } +} + +@media (min-width: 992px) { + .carbonad { + position: absolute; + top: 2rem; + right: 4rem; + width: 330px !important; + padding: 1rem !important; + margin: 0 !important; + } + .bs-docs-masthead .carbonad { + position: static; + } +} + + +// +// Homepage featurettes +// + +.bs-docs-featurette { + padding-top: 3rem; + padding-bottom: 3rem; + font-size: 1rem; + line-height: 1.5; + color: #555; + text-align: center; + background-color: #fff; + border-bottom: 1px solid #e5e5e5; +} +.bs-docs-featurette + .bs-docs-footer { + margin-top: 0; + border-top: 0; +} + +.bs-docs-featurette-title { + margin-bottom: .5rem; + font-size: 2rem; + font-weight: normal; + color: #333; +} +.half-rule { + width: 6rem; + margin: 2.5rem auto; +} +.bs-docs-featurette h3 { + margin-bottom: .5rem; + font-weight: normal; + color: #333; +} +.bs-docs-featurette-img { + display: block; + margin-bottom: 1.25rem; + color: #333; +} +.bs-docs-featurette-img:hover { + color: @brand-primary; + text-decoration: none; +} +.bs-docs-featurette-img img { + display: block; + margin-bottom: 1rem; +} + +@media (min-width: 480px) { + .bs-docs-featurette .img-responsive { + margin-top: 2rem; + } +} +@media (min-width: 768px) { + .bs-docs-featurette { + padding-top: 6rem; + padding-bottom: 6rem; + } + .bs-docs-featurette-title { + font-size: 2.5rem; + } + .bs-docs-featurette .lead { + max-width: 80%; + margin-right: auto; + margin-left: auto; + } + .bs-docs-featurette .img-responsive { + margin-top: 0; + } +} + + +// +// Featured Expo sites +// + +.bs-docs-featured-sites { + margin-right: -1px; + margin-left: -1px; +} +.bs-docs-featured-sites .col-xs-6 { + padding: 1px; +} +.bs-docs-featured-sites .img-responsive { + margin-top: 0; +} + +@media (min-width: 768px) { + .bs-docs-featured-sites .col-sm-3:first-child img { + border-top-left-radius: .25rem; + border-bottom-left-radius: .25rem; + } + .bs-docs-featured-sites .col-sm-3:last-child img { + border-top-right-radius: .25rem; + border-bottom-right-radius: .25rem; + } +} + + +// +// Examples +// + +.bs-examples .thumbnail { + margin-bottom: .75rem; +} +.bs-examples h4 { + margin-bottom: .25rem; +} +.bs-examples p { + margin-bottom: 1.25rem; +} + +@media (max-width: 480px) { + .bs-examples { + margin-right: -.75rem; + margin-left: -.75rem; + } + .bs-examples > [class^="col-"] { + padding-right: .75rem; + padding-left: .75rem; + } +} + + +// +// Custom container +// + +.bs-docs-container { + position: relative; + max-width: 62rem; + padding: 1rem; + margin-right: auto; + margin-left: auto; + + @media (min-width: 768px) { + padding: 2rem; + } + + @media (min-width: 992px) { + padding: 2rem 4rem; + } +} + + +// +// Side navigation +// + +.bs-docs-sidebar { + padding: 0; + margin-bottom: 0; + background-color: #322f38; +} + +.bs-docs-sidebar .navbar-toggle { + position: absolute; + top: 5px; + right: 0; + z-index: 5; +} +.bs-docs-sidebar .navbar-toggle .icon-bar { + background-color: #fff; +} + +.bs-docs-sidebar .navbar-header { + float: none; + margin-right: -15px; +} + +.bs-docs-sidebar .navbar-collapse { + padding: 0; + border: 0; +} + +@media (min-width: 992px) { + .bs-docs { + padding-left: 240px; + } + .bs-docs-sidebar { + position: fixed; + top: 0; + bottom: 0; + left: 0; + width: 240px; + overflow-x: hidden; + overflow-y: auto; + #gradient > .vertical(#29262f, #322f38); + } + .bs-docs-sidebar .navbar-brand { + margin-bottom: 15px; + } +} + +.bs-docs-sidebar .navbar-brand { + display: block; + float: none; + height: auto; + padding: 2rem 1.25rem; + /*padding: 20px;*/ + font-size: 20px; + font-weight: 500; + line-height: 1; + color: #fff; + /*border-bottom: 1px solid rgba(255,255,255,.1);*/ +} +.bs-docs-sidebar-brand:hover, +.bs-docs-sidebar-brand:focus { + color: #fff; + text-decoration: none; +} + +.bs-docs-sidenav { + display: none; +} + +.bs-docs-toc-link { + display: block; + padding: 4px 20px; + font-size: 16px; + color: #fff; +} +.bs-docs-toc-link:hover, +.bs-docs-toc-link:focus { + color: @bs-yellow; + text-decoration: none; +} +.active > .bs-docs-toc-link { + font-weight: 500; + color: @bs-yellow; +} +.active > .bs-docs-sidenav { + display: block; +} + +.bs-docs-toc-item.active { + margin-top: 15px; + margin-bottom: 15px; +} +.bs-docs-toc-item:first-child { + margin-top: 0; +} +.bs-docs-toc-item:last-child { + margin-bottom: 30px; +} + +// All levels of nav +.bs-docs-sidebar .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 14px; + color: #99979c; +} +.bs-docs-sidebar .nav > li > a:hover, +.bs-docs-sidebar .nav > li > a:focus { + color: @bs-yellow; + text-decoration: none; + background-color: transparent; +} +.bs-docs-sidebar .nav > .active > a, +.bs-docs-sidebar .nav > .active:hover > a, +.bs-docs-sidebar .nav > .active:focus > a { + font-weight: 500; + color: @bs-yellow; + background-color: transparent; +} + +// Nav: second level (shown on .active) +.bs-docs-sidebar .nav .nav { + display: none; // Hide by default, but at >768px, show it + padding-bottom: 10px; +} +.bs-docs-sidebar .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +.bs-docs-sidebar .nav .nav > .active > a, +.bs-docs-sidebar .nav .nav > .active:hover > a, +.bs-docs-sidebar .nav .nav > .active:focus > a { + font-weight: 500; +} + +.bs-docs-sidebar .nav > .active > .nav { + display: block; +} +.bs-docs-sidebar .nav .nav > li > a { + padding-top: 2px; + padding-bottom: 2px; + padding-left: 30px; + font-size: 13px; +} + + +// +// Docs sections +// + +.bs-docs-content { + > h1 { + padding-top: 2rem; + margin-top: 3rem; + + &:first-child { + margin-top: 0; + } + + + p { + font-size: 1.25rem; + font-weight: 300; + } + } + + > h2 { + margin-top: 2.5rem; + } + + > h3 { + margin-top: 1.5rem; + } +} + + +// +// Callouts +// + +.bs-callout { + padding: 1.25rem; + margin-top: 1.25rem; + margin-bottom: 1.25rem; + border: 1px solid #eee; + border-left-width: .25rem; + border-radius: .25rem; +} +.bs-callout h4 { + margin-top: 0; + margin-bottom: .25rem; +} +.bs-callout p:last-child { + margin-bottom: 0; +} +.bs-callout code { + border-radius: .25rem; +} + +.bs-callout + .bs-callout { + margin-top: -.25rem; +} + +// Variations +.bs-callout-variant(@color) { + border-left-color: @color; + + h4 { color: @color; } +} +.bs-callout-danger { .bs-callout-variant(@bs-danger); } +.bs-callout-warning { .bs-callout-variant(@bs-warning); } +.bs-callout-info { .bs-callout-variant(@bs-info); } + + +// +// Color swatches +// + +.color-swatches { + margin: 0 -5px; + overflow: hidden; // clearfix +} + +.color-swatch { + float: left; + width: 4rem; + height: 4rem; + margin-right: .25rem; + margin-left: .25rem; + border-radius: .25rem; + + @media (min-width: 768px) { + width: 6rem; + height: 6rem; + } +} + +// Docs colors +.color-swatches { + .bs-purple { + background-color: @bs-purple; + } + .bs-purple-light { + background-color: @bs-purple-light; + } + .bs-purple-lighter { + background-color: #e5e1ea; + } + .bs-gray { + background-color: #f9f9f9; + } +} + + +// +// Team members +// + +.bs-team { + .team-member { + line-height: 2rem; + color: #555; + } + .team-member:hover { + color: #333; + text-decoration: none; + } + .github-btn { + float: right; + width: 180px; + height: 1.25rem; + margin-top: .25rem; + } + img { + float: left; + width: 2rem; + margin-right: .5rem; + border-radius: .25rem; + } +} + + ++// Wall of Browser Bugs ++// ++// Better display for the responsive table on the Wall of Browser Bugs. ++ ++.bs-docs-browser-bugs { ++ td p { ++ margin-bottom: 0; ++ } ++ th:first-child { ++ width: 18%; ++ } ++} ++ +// +// Grid examples +// + +.bs-example > .row { + margin-bottom: 1rem; +} +.bs-example > .row > [class^="col-"] { + padding-top: .75rem; + padding-bottom: .75rem; + background-color: rgba(86,61,124,.15); + border: 1px solid rgba(86,61,124,.2); +} + + +// +// Docs examples +// + +.bs-example { + position: relative; + padding: 1.5rem; + margin-top: 1rem; + margin-bottom: -1rem; + border: solid #f7f7f9; + border-width: .2rem 0 0; + .clearfix(); + + @media (min-width: 480px) { + border-width: .2rem; + } + + // Undo width of container + .container { + width: auto; + } + + // Card examples should be horizontal + > .card { + float: left; + max-width: 15rem; + margin: .25rem; + } + + > .nav + .nav { + margin-top: 1rem; + } +} + + +// Tweak content of examples for optimum awesome +.bs-example > *:last-child, +.bs-example > .table-responsive:last-child > .table { + margin-bottom: 0 !important; +} +.bs-example > .close { + float: none; +} + +// Typography +.bs-example-type .table .type-info { + color: #999; + vertical-align: middle; +} +.bs-example-type .table td { + padding: 1rem 0; + border-color: #eee; +} +.bs-example-type .table tr:first-child td { + border-top: 0; +} +.bs-example-type h1, +.bs-example-type h2, +.bs-example-type h3, +.bs-example-type h4, +.bs-example-type h5, +.bs-example-type h6 { + margin: 0; +} + +// Contextual background colors +.bs-example-bg-classes p { + padding: 1rem; +} + +// Images +.bs-example > .img-circle, +.bs-example > .img-rounded, +.bs-example > .img-thumbnail { + margin: .25rem; +} + +// Tables +// .bs-example > .table-responsive > .table { +// background-color: #fff; +// } + +// Buttons +.bs-example > .btn-group { + margin-top: .25rem; + margin-bottom: .25rem; +} +.bs-example > .btn-toolbar + .btn-toolbar { + margin-top: .5rem; +} + +// Forms +.bs-example-control-sizing select, +.bs-example-control-sizing input[type="text"] + input[type="text"] { + margin-top: .5rem; +} +.bs-example-form .input-group { + margin-bottom: .5rem; +} +.bs-example > textarea.form-control { + resize: vertical; +} + +// List groups +.bs-example > .list-group { + max-width: 400px; +} + +// Navbars +.bs-example .navbar:last-child { + margin-bottom: 0; +} +.bs-navbar-top-example, +.bs-navbar-bottom-example { + z-index: 1; + padding: 0; + overflow: hidden; // cut the drop shadows off +} +.bs-navbar-top-example .navbar-header, +.bs-navbar-bottom-example .navbar-header { + margin-left: 0; +} +.bs-navbar-top-example .navbar-fixed-top, +.bs-navbar-bottom-example .navbar-fixed-bottom { + position: relative; + margin-right: 0; + margin-left: 0; +} +.bs-navbar-top-example { + padding-bottom: 45px; +} +.bs-navbar-top-example .navbar-fixed-top { + top: -1px; +} +.bs-navbar-bottom-example { + padding-top: 45px; +} +.bs-navbar-bottom-example .navbar-fixed-bottom { + bottom: -1px; +} +.bs-navbar-bottom-example .navbar { + margin-bottom: 0; +} +@media (min-width: 768px) { + .bs-navbar-top-example .navbar-fixed-top, + .bs-navbar-bottom-example .navbar-fixed-bottom { + position: absolute; + } +} + +// Pagination +.bs-example .pagination { + margin-top: .5rem; + margin-bottom: .5rem; +} + +// Pager +.bs-example > .pager { + margin-top: 0; +} + +// Example modals +.bs-example-modal { + background-color: #f5f5f5; +} +.bs-example-modal .modal { + position: relative; + top: auto; + right: auto; + bottom: auto; + left: auto; + z-index: 1; + display: block; +} +.bs-example-modal .modal-dialog { + left: auto; + margin-right: auto; + margin-left: auto; +} + +// Example dropdowns +.bs-example > .dropdown > .dropdown-toggle { + float: left; +} +.bs-example > .dropdown > .dropdown-menu { + position: static; + display: block; + margin-bottom: .25rem; + clear: left; +} + +// Example tabbable tabs +.bs-example-tabs .nav-tabs { + margin-bottom: 1rem; +} + +// Tooltips +.bs-example-tooltips { + text-align: center; +} +.bs-example-tooltips > .btn { + margin-top: .25rem; + margin-bottom: .25rem; +} + +// Popovers +.bs-example-popover { + padding-bottom: 1.5rem; + background-color: #f9f9f9; +} +.bs-example-popover .popover { + position: relative; + display: block; + float: left; + width: 260px; + margin: 1.25rem; +} + +// Tooltips +.bs-example-tooltip .tooltip { + position: relative; + display: inline-block; + margin: 10px 20px; + opacity: 1; +} + +// Scrollspy demo on fixed height div +.scrollspy-example { + position: relative; + height: 200px; + margin-top: .5rem; + overflow: auto; +} + + +// +// Code snippets +// + +.highlight { + padding: 1.5rem; + margin-top: 1rem; + margin-bottom: 1rem; + background-color: #f7f7f9; +} +.highlight pre { + padding: 0; + margin-top: 0; + margin-bottom: 0; + background-color: transparent; + border: 0; +} +.highlight pre code { + font-size: inherit; + color: @gray-dark; // Effectively the base text color +} + + +// +// Responsive tests +// + +// Responsive (scrollable) doc tables +.table-responsive .highlight pre { + white-space: normal; +} + +// Utility classes table +.bs-table th small, +.responsive-utilities th small { + display: block; + font-weight: normal; + color: #999; +} +.responsive-utilities tbody th { + font-weight: normal; +} +.responsive-utilities td { + text-align: center; +} +.responsive-utilities td.is-visible { + color: #468847; + background-color: #dff0d8 !important; +} +.responsive-utilities td.is-hidden { + color: #ccc; + background-color: #f9f9f9 !important; +} + +// Responsive tests +.responsive-utilities-test { + margin-top: .25rem; +} +.responsive-utilities-test .col-xs-6 { + margin-bottom: .5rem; +} +.responsive-utilities-test span { + display: block; + padding: 1rem .5rem; + font-size: 1rem; + font-weight: bold; + line-height: 1.1; + text-align: center; + border-radius: .25rem; +} +.visible-on, +.hidden-on { + .col-xs-6 { + .hidden-xs, + .hidden-sm, + .hidden-md, + .hidden-lg { + color: #999; + border: 1px solid #ddd; + } + } +} +.visible-on, +.hidden-on { + .col-xs-6 { + .visible-xs-block, + .visible-sm-block, + .visible-md-block, + .visible-lg-block { + color: #468847; + background-color: #dff0d8; + border: 1px solid #d6e9c6; + } + } +} + + +// +// Customizer +// + +.bs-customizer .toggle { + float: right; + margin-top: 1.5rem; +} + +// Headings and form controls +.bs-customizer label { + margin-top: .5rem; + font-weight: 500; + color: #555; +} +.bs-customizer h2 { + padding-top: 2rem; + margin-top: 0; + margin-bottom: .25rem; +} +.bs-customizer h3 { + margin-bottom: 0; +} +.bs-customizer h4 { + margin-top: 1rem; + margin-bottom: 0; +} +.bs-customizer .bs-callout h4 { + margin-top: 0; // lame, but due to specificity we have to duplicate + margin-bottom: .25rem; +} +.bs-customizer input[type="text"] { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + background-color: #fafafa; +} +.bs-customizer .help-block { + margin-bottom: .25rem; + font-size: 75%; +} + +// For the variables, use regular weight +#less-section label { + font-weight: normal; +} + - .bs-customizer-input { - float: left; - width: 33.333333%; - padding-right: 1rem; - padding-left: 1rem; - } - +// Downloads +.bs-customize-download .btn-outline { + padding: 20px; +} + +// Error handling +.bs-customizer-alert { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; + padding: 1rem 0; + color: #fff; + background-color: #d9534f; + border-bottom: 1px solid #b94441; + -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25); + box-shadow: inset 0 1px 0 rgba(255,255,255,.25); +} +.bs-customizer-alert .close { + margin-top: -.25rem; + font-size: 1.5rem; +} +.bs-customizer-alert p { + margin-bottom: 0; +} +.bs-customizer-alert .glyphicon { + margin-right: .25rem; +} +.bs-customizer-alert pre { + margin: .5rem 0 0; + color: #fff; + background-color: #a83c3a; + border-color: #973634; + -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1); + box-shadow: inset 0 2px 4px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1); +} + +// Drag and drop +.bs-dropzone { + position: relative; + padding: 20px; + margin-bottom: 20px; + color: #777; + text-align: center; + border: 2px dashed #eee; + border-radius: 4px; +} +.bs-dropzone h2 { + margin-top: 0; + margin-bottom: 5px; +} +.bs-dropzone .lead { + margin-bottom: 10px; + font-weight: normal; + color: #333; +} +.bs-dropzone hr { + width: 100px; +} +#import-manual-trigger { + cursor: pointer; +} +.bs-dropzone p:last-child { + margin-bottom: 0; +} + + +// +// Brand guidelines +// + +// Logo series wrapper +.bs-brand-logos { + display: table; + width: 100%; + margin-bottom: 1rem; + overflow: hidden; + color: #563d7c; + background-color: #f9f9f9; + border-radius: .25rem; +} + +// Individual items +.bs-brand-item { + padding: 4rem 0; + text-align: center; +} +.bs-brand-item + .bs-brand-item { + border-top: 1px solid #fff; +} +.bs-brand-logos .inverse { + color: #fff; + background-color: #563d7c; +} +.bs-brand-item .svg { + width: 9rem; + height: 9rem; +} + +// Heading content within +.bs-brand-item h1, +.bs-brand-item h3 { + margin-top: 0; + margin-bottom: 0; +} +.bs-brand-item .bs-docs-booticon { + margin-right: auto; + margin-left: auto; +} + +// Make the icons stand out on what is/isn't okay +// .bs-brand-item .glyphicon { +// width: 30px; +// height: 30px; +// margin: 10px auto -10px; +// line-height: 30px; +// color: #fff; +// border-radius: 50%; +// } +// .bs-brand-item .glyphicon-ok { +// background-color: #5cb85c; +// } +// .bs-brand-item .glyphicon-remove { +// background-color: #d9534f; +// } + +@media (min-width: 768px) { + .bs-brand-item { + display: table-cell; + width: 1%; + } + .bs-brand-item + .bs-brand-item { + border-top: 0; + border-left: 1px solid #fff; + } + .bs-brand-item h1 { + font-size: 4rem; + } +} + + +// +// ZeroClipboard styles +// + +.zero-clipboard { + position: relative; + display: none; + float: right; +} +.btn-clipboard { + position: absolute; + top: 0; + right: 0; + z-index: 10; + display: block; + padding: .25rem .5rem; + font-size: 75%; + color: #818a91; + cursor: pointer; + background-color: #eceeef; + border-radius: 0 .2rem 0 .2rem; +} +.btn-clipboard-hover { + color: #fff; + background-color: #027de7; +} + +@media (min-width: 768px) { + .zero-clipboard { + display: block; + } +} + + +// +// Miscellaneous +// + +// Pseudo :focus state for showing how it looks in the docs +#focusedInput { + border-color: @input-border-focus; + outline: 0; + outline: thin dotted \9; // IE9 + box-shadow: 0 0 .5rem @input-box-shadow-focus; +} diff --cc docs/browser-bugs.md index 6750c73427,0000000000..2b3c7fbb1a mode 100644,000000..100644 --- a/docs/browser-bugs.md +++ b/docs/browser-bugs.md @@@ -1,113 -1,0 +1,31 @@@ +--- +layout: default +title: Wall of 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](../getting-started/#support). + +
- ++
+ + + + + + + + + ++ {% for bug in site.data.browser-bugs %} + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ ++ ++ ++ + ++ {% endfor %} + +
Browser(s)Summary of bugUpstream bug(s)Bootstrap issue(s)
Internet Explorer 11Hovered element still remains in :hover state after scrolling awayIE bug #926665#14211
Internet Explorer 11When hovering over a <select> menu item, the cursor for the element underneath the menu is displayedIE bug #963961#14528
Firefox.table-bordered with an empty <tbody> is missing bordersMozilla bug #1023761#13453
Firefoxmax-width: 100%; doesn't work inside tablesMozilla bug #975632#10690
FirefoxJava applets that are descendants of elements with forced hardware acceleration using translate3d(0,0,0) are invisible on WindowsMozilla bug #1048279#14124
FirefoxButton elements with width: 100% become cropped in long tables.Mozilla bug #1060131#14320
FirefoxIf the disabled state of a form control is changed via JavaScript, the normal state doesn't return after refreshing the page.Mozilla bug #654072#793
ChromeClicking above <input type="number"> increment button flashes the decrement buttonOffshoot of #8350 & Chromium issue #337668
Chromedisplay: table; within display: block; forces sibling content to new lineChromium issue #309483#9950
ChromeIncorrect viewport size used for media queries when printingChromium issue #273306#12078
Chrome & SafariOS X scrollbar clipped in select[multiple] with paddingChromium issue #342208, WebKit bug #128489#12536
Chromedisplay: table-cell; width: 100%; doesn't work correctly on date <input>Chromium issue #346051#12548
Chrome<input type="password"> sporadically causes bad widths on floated elementsChrome issue #377346#13892
SafariWeird button behavior with some number <input>sWebKit bug #137269#8350, Normalize #283, Chromium issue #337668
SafariJustified nav rendering bug(No public bug tracker)#9774{{ bug.browser }}{{ bug.summary | markdownify | bugify }}{{ bug.upstream_bug | bugify }}{{ bug.origin | bugify }}
+
diff --cc docs/components/button-group.md index 178245e942,0000000000..370f4afcc5 mode 100644,000000..100644 --- a/docs/components/button-group.md +++ b/docs/components/button-group.md @@@ -1,240 -1,0 +1,240 @@@ +--- +layout: page +title: Button group +--- + +Group a series of buttons together on a single line with the button group. Add on optional JavaScript radio and checkbox style behavior with [our buttons plugin](../javascript/#buttons). + +
+

Tooltips & popovers in button groups require special setting

+

When using tooltips or popovers on elements within a .btn-group, you'll have to specify the option container: 'body' to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).

+
+ +### Basic example + +Wrap a series of buttons with `.btn` in `.btn-group`. + +{% example html %} +
+ + + +
+{% endexample %} + +### Button toolbar + +Combine sets of button groups into button toolbars for more complex components. + +{% example html %} + +{% endexample %} + +### Sizing + +Instead of applying button sizing classes to every button in a group, just add `.btn-group-*` to the `.btn-group`. + +
+ + + + +
+ +{% highlight html %} +
...
+
...
+
...
+
...
+{% endhighlight %} + +### Nesting + +Place a `.btn-group` within another `.btn-group` when you want dropdown menus mixed with a series of buttons. + +{% example html %} +
+ + + +
+ + +
+
+{% endexample %} + +### Vertical variation + +Make a set of buttons appear vertically stacked rather than horizontally. **Split button dropdowns are not supported here.** + +
+
+ + +
+ + +
+ + +
+ + +
+
+ + +
+
+ + +
+
+
+ +{% highlight html %} +
+ ... +
+{% endhighlight %} + +### Justified button groups + +Make a group of buttons stretch at equal sizes to span the entire width of its parent. Also works with button dropdowns within the button group. + +
+

Handling borders

+

Due to the specific HTML and CSS used to justify buttons (namely display: table-cell), the borders between them are doubled. In regular button groups, margin-left: -1px is used to stack the borders instead of removing them. However, margin doesn't work with display: table-cell. As a result, depending on your customizations to Bootstrap, you may wish to remove or re-color the borders.

+
+ +#### With `` elements + +Just wrap a series of `.btn`s in `.btn-group.btn-group-justified`. + +
+ +
+ +
+ +{% highlight html %} +
+ ... +
+{% endhighlight %} + +#### With ` + +
+ +
+
+ +
+ + + +{% highlight html %} +
+
+ +
+
+ +
+
+ +
+
+{% endhighlight %} diff --cc docs/components/jumbotron.md index 080133ed54,0000000000..b32dd4379d mode 100644,000000..100644 --- a/docs/components/jumbotron.md +++ b/docs/components/jumbotron.md @@@ -1,35 -1,0 +1,35 @@@ +--- +layout: page +title: Jumbotron +--- + +A lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site. + +{% example html %} +
+

Hello, world!

+

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

-

Learn more

++

Learn more

+
+{% endexample %} + +To make the jumbotron full width, and without rounded corners, place it outside all `.container`s and instead add a `.container` within. + +{% highlight html %} +
+
+ ... +
+
+{% endhighlight %} + +Jumbotrons also come with an adaptive `hr`—just add `.jumbotron-hr` to the element and the `border-top-color` will be tinted based on the jumbotron background. + +{% example html %} +
+

Jumbotron hr

+

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

+
-

Learn more

++

Learn more

+
+{% endexample %} diff --cc docs/examples/sticky-footer/index.html index c79adde999,64faec51cc..538a33a693 --- a/docs/examples/sticky-footer/index.html +++ b/docs/examples/sticky-footer/index.html @@@ -35,11 -42,10 +35,11 @@@

Place sticky footer content here.

- + - - + + diff --cc docs/getting-started/support.md index 5b35f6f41b,0000000000..0fd1b39825 mode 100644,000000..100644 --- a/docs/getting-started/support.md +++ b/docs/getting-started/support.md @@@ -1,223 -1,0 +1,231 @@@ +--- +layout: page +title: Browser and device support +--- + +Bootstrap is built to work best in the latest desktop and mobile browsers, meaning older browsers might display differently styled, though fully functional, renderings of certain components. + +### Supported browsers + +Bootstrap supports the **latest, stable releases** of all major browsers and platforms. On Windows, **we support Internet Explorer 9-11**. More specific support information is provided below. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ChromeFirefoxInternet ExplorerOperaSafari
AndroidSupportedSupportedN/ANot supportedN/A
iOSSupportedN/ANot supportedSupported
Mac OS XSupportedSupportedSupportedSupported
WindowsSupportedSupportedSupportedSupportedNot supported
+
+ +Unofficially, Bootstrap should look and behave well enough in Chromium and Chrome for Linux, Firefox for Linux, and Internet Explorer 7, 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](../browser-bugs/). + +### Internet Explorer 9 + +Internet Explorer 9 is also supported, however, please be aware that some CSS3 properties and HTML5 elements are not fully supported. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureStatus
border-radiusSupported
box-shadowSupported
transformSupported, with -ms prefix
transitionNot supported
placeholderNot supported
+
+ +Visit [Can I use...](http://caniuse.com/) for details on browser support of CSS3 and HTML5 features. + +### Supporting Internet Explorer 8 + +As of v4, Bootstrap no longer supports IE8. **If you require IE8 support, we recommend you use Bootstrap 3.** It's still supported by our team for bugfixes and documentation changes, but no new features will be added to it. + +Alternatively, you can add the some third party JavaScript to backfill support for the browser. You'll need the following: + +* [The HTML5 shiv](http://en.wikipedia.org/wiki/HTML5_Shiv) +* [Respond.js](https://github.com/scottjehl/Respond) +* [Rem unit polyfill](https://github.com/chuckcarpenter/REM-unit-polyfill) + +### IE Compatibility modes + +Bootstrap is not supported in the old Internet Explorer compatibility modes. To be sure you're using the latest rendering mode for IE, consider including the appropriate `` tag in your pages: + +{% highlight html %} + +{% endhighlight %} + +Confirm the document mode by opening the debugging tools: press F12 and check the "Document Mode". + +This tag is included in all of Bootstrap's documentation and examples to ensure the best rendering possible in each supported version of Internet Explorer. + +See [this StackOverflow question](http://stackoverflow.com/questions/6771258/whats-the-difference-if-meta-http-equiv-x-ua-compatible-content-ie-edge) for more information. + +### Internet Explorer 10 in Windows 8 and Windows Phone 8 + +Internet Explorer 10 doesn't differentiate **device width** from **viewport width**, and thus doesn't properly apply the media queries in Bootstrap's CSS. Normally you'd just add a quick snippet of CSS to fix this: + +{% highlight scss %} +@-ms-viewport { width: device-width; } +{% endhighlight %} + +However, this doesn't work for devices running Windows Phone 8 versions older than [Update 3 (a.k.a. GDR3)](http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/10/14/introducing-windows-phone-preview-for-developers.aspx), as it causes such devices to show a mostly desktop view instead of narrow "phone" view. To address this, you'll need to **include the following CSS and JavaScript to work around the bug**. + +{% highlight scss %} +@-webkit-viewport { width: device-width; } +@-moz-viewport { width: device-width; } +@-ms-viewport { width: device-width; } +@-o-viewport { width: device-width; } +@viewport { width: device-width; } +{% endhighlight %} + +{% highlight js %} +if (navigator.userAgent.match(/IEMobile\/10\.0/)) { + var msViewportStyle = document.createElement('style') + msViewportStyle.appendChild( + document.createTextNode( + '@-ms-viewport{width:auto!important}' + ) + ) + document.querySelector('head').appendChild(msViewportStyle) +} +{% endhighlight %} + +For more information and usage guidelines, read [Windows Phone 8 and Device-Width](http://timkadlec.com/2013/01/windows-phone-8-and-device-width/). + +As a heads up, we include this in all of Bootstrap's documentation and examples as a demonstration. + +### Safari percent rounding + +The rendering engine of versions of Safari prior to v7.1 for OS X and Safari for iOS v8.0 had some trouble with the number of decimal places used in our `.col-*-1` grid classes. So if you had 12 individual grid columns, you'd notice that they came up short compared to other rows of columns. Besides upgrading Safari/iOS, you have some options for workarounds: + +- Add `.pull-right` to your last grid column to get the hard-right alignment +- Tweak your percentages manually to get the perfect rounding for Safari (more difficult than the first option) + +We'll keep an eye on this though and update our code if we have an easy solution. + +### Modals, navbars, and virtual keyboards + +#### Overflow and scrolling + +Support for `overflow: hidden;` on the `` element is quite limited in iOS and Android. To that end, when you scroll past the top or bottom of a modal in either of those devices' browsers, the `` content will begin to scroll. + +#### Virtual keyboards + +Also, note that if you're using a fixed navbar or using inputs within a modal, iOS has a rendering bug that doesn't update the position of fixed elements when the virtual keyboard is triggered. A few workarounds for this include transforming your elements to `position: absolute;` or invoking a timer on focus to try to correct the positioning manually. This is not handled by Bootstrap, so it is up to you to decide which solution is best for your application. + +#### Navbar Dropdowns + +The `.dropdown-backdrop` element isn't used on iOS in the nav because of the complexity of z-indexing. Thus, to close dropdowns in navbars, you must directly click the dropdown element (or any other element which will fire a click event in iOS). + +### Browser zooming + +Page zooming inevitably presents rendering artifacts in some components, both in Bootstrap and the rest of the web. Depending on the issue, we may be able to fix it (search first and then open an issue if need be). However, we tend to ignore these as they often have no direct solution other than hacky workarounds. + - ### Printer viewports ++### Printing + - Even in some modern browsers, printing can be quirky. In particular, as of Chrome v32 and regardless of margin settings, Chrome uses a viewport width significantly narrower than the physical paper size when resolving media queries while printing a webpage. This can result in Bootstrap's extra-small grid being unexpectedly activated when printing. See #12078 for some details. Suggested workarounds: ++Even in some modern browsers, printing can be quirky. + - - Embrace the extra-small grid and make sure your page looks acceptable under it. - - Customize the values of the `@screen-*` Less variables so that your printer paper is considered larger than extra-small. - - Add custom media queries to change the grid size breakpoints for print media only. ++In particular, as of Chrome v32 and regardless of margin settings, Chrome uses a viewport width significantly narrower than the physical paper size when resolving media queries while printing a webpage. This can result in Bootstrap's extra-small grid being unexpectedly activated when printing. [See #12078 for some details.](https://github.com/twbs/bootstrap/issues/12078) Suggested workarounds: ++ ++Also, as of Safari v8.0, fixed-width .containers can cause Safari to use an unusually small font size when printing. See #14868 for more details. One potential workaround for this is adding the following CSS:

++ ++{% highlight css %} ++@media print { ++ .container { ++ width: auto; ++ } ++} ++{% endhighlight %} + +### Android stock browser + +Out of the box, Android 4.1 (and even some newer releases apparently) ship with the Browser app as the default web browser of choice (as opposed to Chrome). Unfortunately, the Browser app has lots of bugs and inconsistencies with CSS in general. + +#### Select menu + +On `` as an unstyled element on the Android stock browser. The user agent sniffing avoids interference with Chrome, Safari, and Mozilla browsers. + +{% highlight html %} + +{% endhighlight %} + +Want to see an example? [Check out this JS Bin demo.](http://jsbin.com/OyaqoDO/2) + +### Validators + +In order to provide the best possible experience to old and buggy browsers, Bootstrap uses [CSS browser hacks](http://browserhacks.com) in several places to target special CSS to certain browser versions in order to work around bugs in the browsers themselves. These hacks understandably cause CSS validators to complain that they are invalid. In a couple places, we also use bleeding-edge CSS features that aren't yet fully standardized, but these are used purely for progressive enhancement. + +These validation warnings don't matter in practice since the non-hacky portion of our CSS does fully validate and the hacky portions don't interfere with the proper functioning of the non-hacky portion, hence why we deliberately ignore these particular warnings. + +Our HTML docs likewise have some trivial and inconsequential HTML validation warnings due to our inclusion of [X-UA-Compatible `` tags](#ie-compatibility-modes) to avoid Internet Explorer issues and our inclusion of a workaround for [a certain Firefox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=654072). diff --cc docs/javascript/dropdowns.md index a80ae0d8de,0000000000..3e389e2c9a mode 100644,000000..100644 --- a/docs/javascript/dropdowns.md +++ b/docs/javascript/dropdowns.md @@@ -1,211 -1,0 +1,211 @@@ +--- +layout: page +title: Dropdowns +--- + +Add dropdown menus to nearly anything with this simple plugin, including the navbar, tabs, and pills. + +### Within navbars + +
+ +
+ +### Within pills + +
+ +
+ +## Usage + +Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.open` class on the parent list item. + +On mobile devices, opening a dropdown adds a `.dropdown-backdrop` as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. **This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile.** + +Note: 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. + +### Via data attributes + +Add `data-toggle="dropdown"` to a link or button to toggle a dropdown. + +{% highlight html %} + +{% endhighlight %} + +To keep URLs intact with link buttons, use the `data-target` attribute instead of `href="#"`. + +{% highlight html %} + +{% endhighlight %} + +### Via JavaScript + +Call the dropdowns via JavaScript: + +{% highlight js %} +$('.dropdown-toggle').dropdown() +{% endhighlight %} + +
+

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.

+
+ +### Options + +*None.* + +### Methods + +#### $().dropdown('toggle') + +Toggles the dropdown menu of a given navbar or tabbed navigation. + +### Events + +All dropdown events are fired at the `.dropdown-menu`'s parent element. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Event TypeDescription
show.bs.dropdownThis event fires immediately when the show instance method is called. The toggling anchor element is available as the relatedTarget property of the event.
shown.bs.dropdownThis event is fired when the dropdown has been made visible to the user (will wait for CSS transitions, to complete). The toggling anchor element is available as the relatedTarget property of the event.
hide.bs.dropdownThis event is fired immediately when the hide instance method has been called. The toggling anchor element is available as the relatedTarget property of the event.
hidden.bs.dropdownThis event is fired when the dropdown has finished being hidden from the user (will wait for CSS transitions, to complete). The toggling anchor element is available as the relatedTarget property of the event.
+
+ +{% highlight js %} +$('#myDropdown').on('show.bs.dropdown', function () { + // do something… +}) +{% endhighlight %} diff --cc docs/javascript/modal.md index 5f748234d1,0000000000..1d018c80c7 mode 100644,000000..100644 --- a/docs/javascript/modal.md +++ b/docs/javascript/modal.md @@@ -1,353 -1,0 +1,435 @@@ +--- +layout: page +title: Modal +--- + +Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults. + +**Due to how HTML5 defines its semantics, the `autofocus` HTML attribute has no effect in Bootstrap modals.** + +
+

Overlapping modals not supported

+

Be sure not to open a modal while another is still visible. Showing more than one modal at a time requires custom code.

+
+
+

Modal markup placement

+

Always try to place a modal's HTML code in a top-level position in your document to avoid other components affecting the modal's appearance and/or functionality.

+
+
+

Mobile device caveats

+

There are some caveats regarding using modals on mobile devices. See our browser support docs for details.

+
+ +### Static example + +A rendered modal with header, body, and set of actions in the footer.

+ +
+ +
+ +{% highlight html %} + +{% endhighlight %} + +### Live demo + +Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page. + + + +
+ +
+ +{% highlight html %} + + + + + +{% endhighlight %} + +
+

Make modals accessible

+

Be sure to add role="dialog" to .modal, aria-labelledby="myModalLabel" attribute to reference the modal title, and aria-hidden="true" to tell assistive technologies to skip the modal's DOM elements.

+

Additionally, you may give a description of your modal dialog with aria-describedby on .modal.

+
+ +
+

Embedding YouTube videos

+

Embedding YouTube videos in modals requires additional JavaScript not in Bootstrap to automatically stop playback and more. See this helpful Stack Overflow post for more information.

+
+ +## Optional sizes + +Modals have two optional sizes, available via modifier classes to be placed on a `.modal-dialog`. + +
+ + +
+ +{% highlight html %} + + + + + + + + + +{% endhighlight %} + + + + + +## Remove animation + +For modals that simply appear rather than fade in to view, remove the `.fade` class from your modal markup. + +{% highlight html %} + +{% endhighlight %} + ++## Varying modal content based on trigger button ++ ++Have a bunch of buttons that all trigger the same modal, just with slightly different contents? Use `event.relatedTarget` and [HTML `data-*` attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) (possibly [via jQuery](http://api.jquery.com/data/)) to vary the contents of the modal depending on which button was clicked. See the Modal Events docs for details on `relatedTarget`. ++ ++
++ ++ ++ ++ ++ ++
++ ++{% highlight html %} ++ ++ ++ ++ ++ ++{% endhighlight %} ++ ++{% highlight js %} ++$('#exampleModal').on('show.bs.modal', function (event) { ++ var button = $(event.relatedTarget) // Button that triggered the modal ++ var recipient = button.data('whatever') // Extract info from data-* attributes ++ // If necessary, you could initiate an AJAX request here (and then do the updating in a callback). ++ // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead. ++ var modal = $(this) ++ modal.find('.modal-title').text('New message to ' + recipient) ++ modal.find('.modal-body input').val(recipient) ++}) ++{% endhighlight %} ++ +## Usage + +The modal plugin toggles your hidden content on demand, via data attributes or JavaScript. It also adds `.modal-open` to the `` to override default scrolling behavior and generates a `.modal-backdrop` to provide a click area for dismissing shown modals when clicking outside the modal. + +### Via data attributes + +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 %} + +{% endhighlight %} + +### Via JavaScript + +Call a modal with id `myModal` with a single line of JavaScript: + +{% highlight js %}$('#myModal').modal(options){% endhighlight %} + +### Options + +Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-backdrop=""`. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
backdropboolean or the string 'static'trueIncludes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.
keyboardbooleantrueCloses the modal when escape key is pressed
showbooleantrueShows the modal when initialized.
+
+ +### Methods + +#### .modal(options) + +Activates your content as a modal. Accepts an optional options `object`. + +{% highlight js %} +$('#myModal').modal({ + keyboard: false +}) +{% endhighlight %} + +#### .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 %} + +#### .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 %} + +#### .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 %} + +### Events + +Bootstrap's modal class exposes a few events for hooking into modal functionality. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Event TypeDescription
show.bs.modalThis event fires immediately when the show instance method is called. If caused by a click, the clicked element is available as the relatedTarget property of the event.
shown.bs.modalThis event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete). If caused by a click, the clicked element is available as the relatedTarget property of the event.
hide.bs.modalThis event is fired immediately when the hide instance method has been called.
hidden.bs.modalThis event is fired when the modal has finished being hidden from the user (will wait for CSS transitions to complete).
loaded.bs.modalThis event is fired when the modal has loaded content using the remote option.
+
+ +{% highlight js %} +$('#myModal').on('hidden.bs.modal', function (e) { + // do something... +}) +{% endhighlight %} diff --cc docs/javascript/popovers.md index fa78c7acfb,0000000000..0844621ba3 mode 100644,000000..100644 --- a/docs/javascript/popovers.md +++ b/docs/javascript/popovers.md @@@ -1,325 -1,0 +1,331 @@@ +--- +layout: page +title: Popovers +--- + +Add small overlays of content, like those on the iPad, to any element for housing secondary information. + +Popovers whose both title and content are zero-length are never displayed. + +
+

Plugin dependency

+

Popovers require the tooltip plugin to be included in your version of Bootstrap.

+
+
+

Opt-in functionality

+

For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself.

++

One way to initialize all popovers on a page would be to select them by their data-toggle attribute:

++{% highlight js %} ++$(function () { ++ $('[data-toggle="popover"]').popover() ++}) ++{% endhighlight %} +
+
+

Popovers in button groups and input groups require special setting

+

When using popovers on elements within a .btn-group or an .input-group, you'll have to specify the option container: 'body' (documented below) to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the popover is triggered).

+
+
+

Don't try to show popovers on hidden elements

+

Invoking $(...).popover('show') when the target element is display: none; will cause the popover to be incorrectly positioned.

+
+
+

Popovers on disabled elements require wrapper elements

+

To add a popover to a disabled or .disabled element, put the element inside of a <div> and apply the popover to that <div> instead.

+
+
+

Multiple-line links

+

Sometimes you want to add a popover to a hyperlink that wraps multiple lines. The default behavior of the popover plugin is to center it horizontally and vertically. Add white-space: nowrap; to your anchors to avoid this.

+
+ +### Static popover + +Four options are available: top, right, bottom, and left aligned. + +
+
+
+

Popover top

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+

Popover right

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+

Popover bottom

+ +
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+

Popover left

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+ +### Live demo + +{% example html %} + +{% endexample %} + +#### Four directions + +
+
+ + + + +
+
+ +{% highlight html %} + + + + + + + +{% endhighlight %} + +#### Dismiss on next click + +Use the `focus` trigger to dismiss popovers on the next click that the user makes. + +
+

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 attribute.

+
+ +{% example html %} +Dismissible popover +{% endexample %} + +{% highlight js %} +$('.popover-dismiss').popover({ + trigger: 'focus' +}) +{% endhighlight %} + + + +## Usage + +Enable popovers via JavaScript: + +{% highlight js %}$('#example').popover(options){% endhighlight %} + +### Options + +Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-animation=""`. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
animationbooleantrueApply a CSS fade transition to the popover
containerstring | falsefalse +

Appends the popover to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.

+
contentstring | function'' +

Default content value if data-content attribute isn't present.

+

If a function is given, it will be called with its this reference set to the element that the popover is attached to.

+
delaynumber | object0 +

Delay showing and hiding the popover (ms) - does not apply to manual trigger type

+

If a number is supplied, delay is applied to both hide/show

+

Object structure is: delay: { "show": 500, "hide": 100 }

+
htmlbooleanfalseInsert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.
placementstring | function'right' +

How to position the popover - top | bottom | left | right | auto.
When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.

+

When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The this context is set to the popover instance.

+
selectorstringfalseIf 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 this and an informative example.
templatestring'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' +

Base HTML to use when creating the popover.

+

The popover's title will be injected into the .popover-title.

+

The popover's content will be injected into the .popover-content.

+

.arrow will become the popover's arrow.

+

The outermost wrapper element should have the .popover class.

+
titlestring | function'' +

Default title value if title attribute isn't present.

+

If a function is given, it will be called with its this reference set to the element that the popover is attached to.

+
triggerstring'click'How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.
viewportstring | object{ selector: 'body', padding: 0 } +

Keeps the popover within the bounds of this element. Example: viewport: '#viewport' or { "selector": "#viewport", "padding": 0 }

+
+
+ +
+

Data attributes for individual popovers

+

Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.

+
+ +### Methods + +#### $().popover(options) + +Initializes popovers for an element collection. + +#### .popover('show') + +Reveals an element's popover. Popovers whose both title and content are zero-length are never displayed. + +{% highlight js %}$('#element').popover('show'){% endhighlight %} + +#### .popover('hide') + +Hides an element's popover. + +{% highlight js %}$('#element').popover('hide'){% endhighlight %} + +#### .popover('toggle') + +Toggles an element's popover. + +{% highlight js %}$('#element').popover('toggle'){% endhighlight %} + +#### .popover('destroy') + +Hides and destroys an element's popover. + +{% highlight js %}$('#element').popover('destroy'){% endhighlight %} + +### Events + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Event TypeDescription
show.bs.popoverThis event fires immediately when the show instance method is called.
shown.bs.popoverThis event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).
hide.bs.popoverThis event is fired immediately when the hide instance method has been called.
hidden.bs.popoverThis event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).
+
+ +{% highlight js %} +$('#myPopover').on('hidden.bs.popover', function () { + // do something… +}) +{% endhighlight %} diff --cc docs/javascript/tooltips.md index 516b5f4aea,0000000000..008db7c868 mode 100644,000000..100644 --- a/docs/javascript/tooltips.md +++ b/docs/javascript/tooltips.md @@@ -1,295 -1,0 +1,301 @@@ +--- +layout: page +title: Tooltips +--- + +## Examples + +Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage. + +Tooltips with zero-length titles are never displayed. + +Hover over the links below to see tooltips: + +
+

Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. +

+
+ +### Static demo + +Four options are available: top, right, bottom, and left aligned. + +
+ + + + +
+ +### Interactive demo + +Hover over the buttons below to see their tooltips. + +
+
+ + + + +
+
+ +{% highlight html %} + + + + +{% endhighlight %} + +
+

Opt-in functionality

+

For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself.

++

One way to initialize all tooltips on a page would be to select them by their data-toggle attribute:

++{% highlight js %} ++$(function () { ++ $('[data-toggle="tooltip"]').tooltip() ++}) ++{% endhighlight %} +
+
+

Tooltips in button groups and input groups require special setting

+

When using tooltips on elements within a .btn-group or an .input-group, you'll have to specify the option container: 'body' (documented below) to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip is triggered).

+
+
+

Don't try to show tooltips on hidden elements

+

Invoking $(...).tooltip('show') when the target element is display: none; will cause the tooltip to be incorrectly positioned.

+
+
+

Tooltips on disabled elements require wrapper elements

+

To add a tooltip to a disabled or .disabled element, put the element inside of a <div> and apply the tooltip to that <div> instead.

+
+ +## Usage + +The tooltip plugin generates content and markup on demand, and by default places tooltips after their trigger element. + +Trigger the tooltip via JavaScript: + +{% highlight js %} +$('#example').tooltip(options) +{% endhighlight %} + +### 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). + +
+

Multiple-line links

+

Sometimes you want to add a tooltip to a hyperlink that wraps multiple lines. The default behavior of the tooltip plugin is to center it horizontally and vertically. Add white-space: nowrap; to your anchors to avoid this.

+
+ +{% highlight html %} + +Hover over me + + + +{% endhighlight %} + +### Options + +Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-animation=""`. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
animationbooleantrueApply a CSS fade transition to the tooltip
containerstring | falsefalse +

Appends the tooltip to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.

+
delaynumber | object0 +

Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

+

If a number is supplied, delay is applied to both hide/show

+

Object structure is: delay: { "show": 500, "hide": 100 }

+
htmlbooleanfalseInsert HTML into the tooltip. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.
placementstring | function'top' +

How to position the tooltip - top | bottom | left | right | auto.
When "auto" is specified, it will dynamically reorient the tooltip. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.

+

When a function is used to determine the placement, it is called with the tooltip DOM node as its first argument and the triggering element DOM node as its second. The this context is set to the tooltip instance.

+
selectorstringfalseIf 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 this and an informative example.
templatestring'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' +

Base HTML to use when creating the tooltip.

+

The tooltip's title will be injected into the .tooltip-inner.

+

.tooltip-arrow will become the tooltip's arrow.

+

The outermost wrapper element should have the .tooltip class.

+
titlestring | function'' +

Default title value if title attribute isn't present.

+

If a function is given, it will be called with its this reference set to the element that the tooltip is attached to.

+
triggerstring'hover focus'How tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.
viewportstring | object{ selector: 'body', padding: 0 } +

Keeps the tooltip within the bounds of this element. Example: viewport: '#viewport' or { "selector": "#viewport", "padding": 0 }

+
+
+ +
+

Data attributes for individual tooltips

+

Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.

+
+ +### Methods + +#### $().tooltip(options) + +Attaches a tooltip handler to an element collection. + +#### .tooltip('show') + +Reveals an element's tooltip. Tooltips with zero-length titles are never displayed. + +{% highlight js %}$('#element').tooltip('show'){% endhighlight %} + +#### .tooltip('hide') + +Hides an element's tooltip. + +{% highlight js %}$('#element').tooltip('hide'){% endhighlight %} + +#### .tooltip('toggle') + +Toggles an element's tooltip. + +{% highlight js %}$('#element').tooltip('toggle'){% endhighlight %} + +#### .tooltip('destroy') + +Hides and destroys an element's tooltip. + +{% highlight js %}$('#element').tooltip('destroy'){% endhighlight %} + +### Events + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Event TypeDescription
show.bs.tooltipThis event fires immediately when the show instance method is called.
shown.bs.tooltipThis event is fired when the tooltip has been made visible to the user (will wait for CSS transitions to complete).
hide.bs.tooltipThis event is fired immediately when the hide instance method has been called.
hidden.bs.tooltipThis event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).
+
+ +{% highlight js %} +$('#myTooltip').on('hidden.bs.tooltip', function () { + // do something… +}) +{% endhighlight %} diff --cc docs/layout/media.md index 4ebe8d05f5,0000000000..431805c9e2 mode 100644,000000..100644 --- a/docs/layout/media.md +++ b/docs/layout/media.md @@@ -1,147 -1,0 +1,147 @@@ +--- +layout: page +title: Media +--- + +Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content. + +### Default media + +The default media allow to float a media object (images, video, audio) to the left or right of a content block. + +{% example html %} +
- ++ + Generic placeholder image + +
+

Media heading

+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
+
+{% endexample %} + - ### Nested media ++### Nesting + +Media components can also be nested. + +{% example html %} +
- ++ + Generic placeholder image + +
+

Media heading

+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
- ++ + Generic placeholder image + +
+

Nested media heading

+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +
+
+
+
+{% endexample %} + - ### Media alignment ++### Alignment + +The images or other media can be aligned top, middle, or bottom. The default is top aligned. + +{% example html %} +
+ + Generic placeholder image + +
+

Top aligned media

+

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

+

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.

+
+
+{% endexample %} + +{% example html %} +
+ + Generic placeholder image + +
+

Middle aligned media

+

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

+

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.

+
+
+{% endexample %} + +{% example html %} +
+ + Generic placeholder image + +
+

Bottom aligned media

+

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

+

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.

+
+
+{% endexample %} + +### Media list + +With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists). + +{% example html %} + +{% endexample %} diff --cc less/_buttons.less index bef3779a4e,40553c6386..9c8e4ea37b --- a/less/_buttons.less +++ b/less/_buttons.less @@@ -46,9 -46,9 +46,9 @@@ &.disabled, &[disabled], fieldset[disabled] & { - cursor: not-allowed; + cursor: @cursor-disabled; pointer-events: none; // Future-proof disabling of clicks - .opacity(.65); + opacity: .65; .box-shadow(none); } } diff --cc less/_nav.less index fa87fec257,0000000000..70e79ea5b1 mode 100644,000000..100644 --- a/less/_nav.less +++ b/less/_nav.less @@@ -1,168 -1,0 +1,168 @@@ +// +// Navs +// -------------------------------------------------- + +.nav { + margin-bottom: 0; + .list-unstyled(); + &:extend(.clearfix all); +} + +.nav-item { + position: relative; + display: inline-block; +} + +.nav-link { + display: inline-block; + padding: @nav-link-padding; + line-height: @line-height-base; + + &:hover, + &:focus { + text-decoration: none; + background-color: @nav-link-hover-bg; + } + + // Disabled state sets text to gray and nukes hover/tab effects + .disabled > &, + &.disabled { + color: @nav-disabled-link-color; + + &, + &:hover, + &:focus { + color: @nav-disabled-link-hover-color; + background-color: transparent; - cursor: not-allowed; ++ cursor: @cursor-disabled; + } + } +} + + +// +// Tabs +// + +.nav-tabs { + border-bottom: 1px solid @nav-tabs-border-color; + + .nav-item { + float: left; + // Make the list-items overlay the bottom border + margin-bottom: -1px; + + + .nav-item { + margin-left: .2rem; + } + } + + .nav-link { + display: block; + border: 1px solid transparent; + .border-radius(@border-radius-base @border-radius-base 0 0); + + &:hover, + &:focus { + border-color: @nav-tabs-link-hover-border-color @nav-tabs-link-hover-border-color @nav-tabs-border-color; + } + } + + .open > .nav-link, + .active > .nav-link, + .nav-link.open, + .nav-link.active { + &, + &:hover, + &:focus { + color: @nav-tabs-active-link-hover-color; + background-color: @nav-tabs-active-link-hover-bg; + border-color: @nav-tabs-active-link-hover-border-color @nav-tabs-active-link-hover-border-color transparent; + } + } + + .disabled > .nav-link, + .nav-link.disabled { + &, + &:hover, + &:focus { + color: @nav-disabled-link-color; + background-color: transparent; + border-color: transparent; + } + } +} + + +// +// Pills +// + +.nav-pills { + .nav-item { + float: left; + + + .nav-item { + margin-left: .2rem; + } + } + + .nav-link { + display: block; + .border-radius(@nav-pills-border-radius); + } + + .open > .nav-link, + .active > .nav-link, + .nav-link.open, + .nav-link.active { + &, + &:hover, + &:focus { + color: @component-active-color; + background-color: @component-active-bg; + cursor: default; + } + } +} + +.nav-stacked { + .nav-item { + float: none; + display: block; + + + .nav-item { + margin-top: .2rem; + margin-left: 0; + } + } +} + + +// +// Tabbable tabs +// + +// Hide tabbable panes to start, show them when `.active` +.tab-content { + > .tab-pane { + display: none; + visibility: hidden; + } + > .active { + display: block; + visibility: visible; + } +} + + +// +// Dropdowns +// + +.nav-tabs .dropdown-menu { + // Make dropdown border overlap tab border + margin-top: -1px; + // Remove the top rounded corners here since there is a hard edge above the menu + .border-top-radius(0); +} diff --cc less/_tooltip.less index 5561b4db6a,9c2a37fd43..da6787cd4d --- a/less/_tooltip.less +++ b/less/_tooltip.less @@@ -9,11 -9,14 +9,14 @@@ z-index: @zindex-tooltip; display: block; visibility: visible; + // Reset font and text propertes given new insertion method + font-family: @font-family-base; - font-size: @font-size-small; + font-size: @font-size-sm; + font-weight: normal; line-height: 1.4; - .opacity(0); + opacity: 0; - &.in { .opacity(@tooltip-opacity); } + &.in { opacity: @tooltip-opacity; } &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; } &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; } &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; }