diff --git a/Makefile b/Makefile index 0dddb13dd0..05ac491684 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ LESS_COMPESSOR ?= `which lessc` UGLIFY_JS ?= `which uglifyjs` WATCHR ?= `which watchr` +# +# Build less files +# + build: @@if test ! -z ${LESS_COMPESSOR}; then \ sed -e 's/@VERSION/'"v${VERSION}"'/' -e 's/@DATE/'"`date`"'/' <${BOOTSTRAP_LESS} >${BOOTSTRAP_LESS}.tmp; \ @@ -18,24 +22,9 @@ build: echo "You can install it by running: npm install less -g"; \ fi -uglify: - @@if test ! -z ${UGLIFY_JS}; then \ - mkdir -p js/min; \ - uglifyjs -o js/min/bootstrap-alerts.js js/bootstrap-alert.js;\ - uglifyjs -o js/min/bootstrap-buttons.js js/bootstrap-button.js;\ - uglifyjs -o js/min/bootstrap-carousel.js js/bootstrap-carousel.js;\ - uglifyjs -o js/min/bootstrap-collapse.js js/bootstrap-collapse.js;\ - uglifyjs -o js/min/bootstrap-dropdown.js js/bootstrap-dropdown.js;\ - uglifyjs -o js/min/bootstrap-modal.js js/bootstrap-modal.js;\ - uglifyjs -o js/min/bootstrap-popover.js js/bootstrap-popover.js;\ - uglifyjs -o js/min/bootstrap-scrollspy.js js/bootstrap-scrollspy.js;\ - uglifyjs -o js/min/bootstrap-tabs.js js/bootstrap-tab.js;\ - uglifyjs -o js/min/bootstrap-transitions.js js/bootstrap-transition.js;\ - uglifyjs -o js/min/bootstrap-tooltip.js js/bootstrap-tooltip.js;\ - else \ - echo "You must have the UGLIFYJS minifier installed in order to minify Bootstrap's js."; \ - echo "You can install it by running: npm install uglify-js -g"; \ - fi +# +# Watch less files +# watch: @@if test ! -z ${WATCHR}; then \ @@ -46,4 +35,12 @@ watch: echo "You can install it by running: gem install watchr"; \ fi -.PHONY: build watch \ No newline at end of file +# +# Build docs from templates +# + +docs: + @ node docs/build + + +.PHONY: build watch docs \ No newline at end of file diff --git a/bootstrap.css b/bootstrap.css index aa68f04b99..b911730eb4 100644 --- a/bootstrap.css +++ b/bootstrap.css @@ -6,7 +6,7 @@ * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. - * Date: Sun Jan 22 20:50:28 PST 2012 + * Date: Mon Jan 23 14:12:25 PST 2012 */ html, body { margin: 0; diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index ba5a269475..93f7ea719c 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -117,37 +117,66 @@ $(function(){ }) +// JS for javascript demos +$(function () { + // tooltip demo + $('.tooltip-demo.well').tooltip({ + selector: "a[rel=tooltip]" + }) + $('.tooltip-test').tooltip() + + // popover demo + $("a[rel=popover]") + .popover() + .click(function(e) { + e.preventDefault() + }) + + // button state demo + $('#fat-btn') + .click(function () { + var btn = $(this) + btn.button('loading') + setTimeout(function () { + btn.button('reset') + }, 3000) + }) + + // carousel demo + $('#myCarousel').carousel() +}) + // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi // by the talented Ben Vinegar !function($) { - $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { - var url = opts.url; + $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { + var url = opts.url; - return { - send: function(_, completeCallback) { - var name = 'jQuery_iframe_' + jQuery.now(), - iframe, form; + return { + send: function(_, completeCallback) { + var name = 'jQuery_iframe_' + jQuery.now() + , iframe, form - iframe = $(' - -
  • - -
  • - - -
  • ·
  • -
  • - Follow @twbootstrap -
  • -
  • - Tweet -
  • +
    +

    Feature highlights

    + +
    + + + + -
    -

    Built with Bootstrap.

    -

    For even more sites built with Bootstrap, visit the unofficial Tumblr.

    - +
    +

    Built with Bootstrap.

    + + -

    Designed for everyone, everywhere.

    - -
    -
    - -

    Built for and by nerds

    -

    Like you, we love building awesome products on the web. We love it so much, we decided to help people just like us do it easier, better, and faster. Bootstrap is built for you.

    -
    -
    - -

    For all skill levels

    -

    Bootstrap is designed to help people of all skill level—designer or developer, huge nerd or early beginner. Use it as a complete kit or use to start something more complex.

    -
    -
    - -

    Cross-everything

    -

    Originally built with only modern browsers in mind, Bootstrap has evolved to include support for all major browsers (even IE7!) and, with Bootstrap 2, tablets and smartphones, too.

    -
    -
    -
    -
    - -

    12-column grid

    -

    Grid systems aren't everything, but having a durable and flexible one at the core of your work can make development much simpler. Use our built-in grid classes or roll your own.

    -
    -
    - -

    Responsive design

    -

    With Bootstrap 2, we've gone fully responsive. Our components are scaled according to a range of resolutions and devices to provide a consistent experience, no matter what.

    -
    -
    - -

    Styleguide docs

    -

    Unlike other front-end toolkits, Bootstrap was designed first and foremost as a styleguide to document not only our features, but best practices and living, coded examples.

    -
    -
    -
    -
    - -

    Growing library

    -

    Despite being only 7kb (gzipped), Bootstrap is one of the most complete front-end toolkits out there with dozens of fully functional components ready to be put to use.

    -
    -
    - -

    Custom jQuery plugins

    -

    What good is an awesome design component without easy-to-use, proper, and extensible interactions? With Bootstrap, you get custom-built jQuery plugins to bring your projects to life.

    -
    -
    - -

    Built on LESS

    -

    Where vanilla CSS falters, LESS excels. Variables, nesting, operations, and mixins in LESS makes coding CSS faster and more efficient with minimal overhead.

    -
    -
    -
    -
    - -

    HTML5

    -

    Built to support new HTML5 elements and syntax.

    -
    -
    - -

    CSS3

    -

    Progressively enhanced components for ultimate style.

    -
    -
    - -

    Open-source

    -

    Built for and maintained by the community via GitHub.

    -
    -
    - -

    Made at Twitter

    -

    Brought to you by an experienced engineer and designer.

    -
    -
    - - - -

    Get started in no time.

    - - - - - - - - - -
    -

    Hotlink the CSS

    -

    For the quickest and easiest start, just copy this snippet into your webpage.

    -
    - -
    -
    -

    Use it with LESS

    -

    A fan of using LESS? No problem, just clone the repo and add these lines:

    -
    - -
    -
    -

    Fork on GitHub

    -

    Download, fork, pull, file issues, and more with the Bootstrap GitHub repo.

    -

    Bootstrap on GitHub »

    -

    Currently v2.0.0

    -
    -
    -
    +

    Designed for everyone, everywhere.

    +

    Need reasons to love Bootstrap? Look no further.

    +
    +
    + +

    Built for and by nerds

    +

    Like you, we love building awesome products on the web. We love it so much, we decided to help people just like us do it easier, better, and faster. Bootstrap is built for you.

    +
    +
    + +

    For all skill levels

    +

    Bootstrap is designed to help people of all skill level—designer or developer, huge nerd or early beginner. Use it as a complete kit or use to start something more complex.

    +
    +
    + +

    Cross-everything

    +

    Originally built with only modern browsers in mind, Bootstrap has evolved to include support for all major browsers (even IE7!) and, with Bootstrap 2, tablets and smartphones, too.

    +
    +
    +
    +
    + +

    12-column grid

    +

    Grid systems aren't everything, but having a durable and flexible one at the core of your work can make development much simpler. Use our built-in grid classes or roll your own.

    +
    +
    + +

    Responsive design

    +

    With Bootstrap 2, we've gone fully responsive. Our components are scaled according to a range of resolutions and devices to provide a consistent experience, no matter what.

    +
    +
    + +

    Styleguide docs

    +

    Unlike other front-end toolkits, Bootstrap was designed first and foremost as a styleguide to document not only our features, but best practices and living, coded examples.

    +
    +
    +
    +
    + +

    Growing library

    +

    Despite being only 7kb (gzipped), Bootstrap is one of the most complete front-end toolkits out there with dozens of fully functional components ready to be put to use.

    +
    +
    + +

    Custom jQuery plugins

    +

    What good is an awesome design component without easy-to-use, proper, and extensible interactions? With Bootstrap, you get custom-built jQuery plugins to bring your projects to life.

    +
    +
    + +

    Built on LESS

    +

    Where vanilla CSS falters, LESS excels. Variables, nesting, operations, and mixins in LESS makes coding CSS faster and more efficient with minimal overhead.

    +
    +
    +
    +
    + +

    HTML5

    +

    Built to support new HTML5 elements and syntax.

    +
    +
    + +

    CSS3

    +

    Progressively enhanced components for ultimate style.

    +
    +
    + +

    Open-source

    +

    Built for and maintained by the community via GitHub.

    +
    +
    + +

    Made at Twitter

    +

    Brought to you by an experienced engineer and designer.

    +
    +
    + +

    Get started in no time.

    +

    Quickly start using Bootstrap within your workflow and development process.

    + + + + + + + + +
    +

    Hotlink the CSS

    +

    For the quickest and easiest start, just copy this snippet into your webpage.

    +
    + +
    +
    +

    Use it with LESS

    +

    A fan of using LESS? No problem, just clone the repo and add these lines:

    +
    + +
    +
    +

    Fork on GitHub

    +

    Download, fork, pull, file issues, and more with the Bootstrap GitHub repo.

    +

    Bootstrap on GitHub »

    +

    Currently v2.0.0

    +
    + + + + - - - + + + + + + + + + + + + + + + diff --git a/docs/javascript.html b/docs/javascript.html index 6a240c4d4b..fda3ae32bb 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -25,7 +25,7 @@ - + @@ -34,8 +34,8 @@
    Bootstrap -
  • Icons by Glyphicons
  • -
  • Typeahead
  • -
  • +
  • Using LESS @@ -107,1308 +107,1306 @@
  • - -
    -

    Javascript for Bootstrap

    -

    Bring Bootstrap's components to life—now with 12 custom jQuery plugins. -

    + + +
    +

    Javascript for Bootstrap

    +

    Bring Bootstrap's components to life—now with 12 custom jQuery plugins. +

    - -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - Download Source - - - - + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + Select/Unselect All Plugins +

    Note: All plugins require the latest version of jQuery to be included.

    +
    + + + + +
    + +
    +
    +

    About modals

    +

    A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.

    + Download file +
    +
    +

    Static example

    +

    Below is a statically rendered modal.

    +
    + +
    + +

    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.

    + + + Launch demo modal +
    - Select/Unselect All Plugins -

    Note: All plugins require the latest version of jQuery to be included.

    -
    - - - -
    - -
    -
    -

    About modals

    -

    A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.

    - Download file -
    -
    -

    Static example

    -

    Below is a statically rendered modal.

    -
    - -
    - -

    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.

    - - - Launch demo modal - -
    - -

    Using bootstrap-modal

    -

    Call the modal via javascript:

    -
    $('#myModal').modal(options)
    -

    Options

    - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    backdropbooleantrueIncludes a modal-backdrop element
    keyboardbooleantrueCloses the modal when escape key is pressed
    -

    Markup

    -

    You can activate modals on your page easily without having to write a single line of javascript. Just set data-toggle="modal" on a controller element with a data-target="#foo" or href="#foo" which corresponds to a modal element id, and when clicked, it will launch your modal.

    -

    Also, to add options to your modal instance, just include them as additional data attributes on either the control element or the modal markup itself.

    +

    Using bootstrap-modal

    +

    Call the modal via javascript:

    +
    $('#myModal').modal(options)
    +

    Options

    + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    backdropbooleantrueIncludes a modal-backdrop element
    keyboardbooleantrueCloses the modal when escape key is pressed
    +

    Markup

    +

    You can activate modals on your page easily without having to write a single line of javascript. Just set data-toggle="modal" on a controller element with a data-target="#foo" or href="#foo" which corresponds to a modal element id, and when clicked, it will launch your modal.

    +

    Also, to add options to your modal instance, just include them as additional data attributes on either the control element or the modal markup itself.

     <a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>
     
     <div class="modal">
    -  <div class="modal-header">
    -    <a href="#" class="close js-dismiss">×</a>
    -    <h3>Modal header</h3>
    -  </div>
    -  <div class="modal-body">
    -    <p>One fine body…</p>
    -  </div>
    -  <div class="modal-footer">
    -    <a href="#" class="btn primary">Save changes</a>
    -    <a href="#" class="btn">Close</a>
    -  </div>
    +<div class="modal-header">
    +<a href="#" class="close js-dismiss">×</a>
    +<h3>Modal header</h3>
    +</div>
    +<div class="modal-body">
    +<p>One fine body…</p>
    +</div>
    +<div class="modal-footer">
    +<a href="#" class="btn primary">Save changes</a>
    +<a href="#" class="btn">Close</a>
    +</div>
     </div>
     
    -

    Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).

    -

    Methods

    -

    .modal(options)

    -

    Activates your content as a modal. Accepts an optional options object. +

    Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).

    +

    Methods

    +

    .modal(options)

    +

    Activates your content as a modal. Accepts an optional options object.

     $('#myModal').modal({
    -  keyboard: false
    +keyboard: false
     })
    -

    .modal('toggle')

    -

    Manually toggles a modal.

    -
    $('#myModal').modal('toggle')
    -

    .modal('show')

    -

    Manually opens a modal.

    -
    $('#myModal').modal('show')
    -

    .modal('hide')

    -

    Manually hides a modal.

    -
    $('#myModal').modal('hide')
    -

    Events

    -

    Bootstrap's modal class exposes a few events for hooking into modal functionality.

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).
    hideThis event is fired immediately when the hide instance method has been called.
    hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
    +

    .modal('toggle')

    +

    Manually toggles a modal.

    +
    $('#myModal').modal('toggle')
    +

    .modal('show')

    +

    Manually opens a modal.

    +
    $('#myModal').modal('show')
    +

    .modal('hide')

    +

    Manually hides a modal.

    +
    $('#myModal').modal('hide')
    +

    Events

    +

    Bootstrap's modal class exposes a few events for hooking into modal functionality.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).
    hideThis event is fired immediately when the hide instance method has been called.
    hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
     $('#myModal').on('hidden', function () {
    -  // do something ...
    +// do something ...
     })
    -
    -
    -
    +
    +
    +
    - - +

    Methods

    +

    $().dropdown()

    +

    + A programatic api for activating menus for a given navbar or tabbed navigation. +

    +
    + + - -
    - -
    -
    -

    The ScrollSpy plugin is for automatically updating nav targets based on scroll position.

    - Download file -
    -
    -

    Example navbar with scrollspy

    -

    Scroll the area below and watch the navigation update. The dropdown sub items will be highlighted as well. Try it!

    - -
    - - - - -
    -
    + + + + +
    + +
    +
    +

    This plugin adds quick, dynamic tab and pill functionality for transitioning through local content.

    + Download file +
    +
    +

    Example tabs

    +

    Click the tabs below to toggle between hidden panes, even via dropdown menus.

    + +
    +
    +

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    +
    +
    +

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    +
    + + +
    +
    +

    Using bootstrap-tab.js

    +

    Enable tabbable tabs via javascript:

    +
    $('#myTab').tab('show')
    +

    Markup

    +

    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.

     <ul class="tabs">
    -  <li><a href="#home" data-toggle="tab">Home</a></li>
    -  <li><a href="#profile" data-toggle="tab">Profile</a></li>
    -  <li><a href="#messages" data-toggle="tab">Messages</a></li>
    -  <li><a href="#ettings" data-toggle="tab">Settings</a></li>
    +<li><a href="#home" data-toggle="tab">Home</a></li>
    +<li><a href="#profile" data-toggle="tab">Profile</a></li>
    +<li><a href="#messages" data-toggle="tab">Messages</a></li>
    +<li><a href="#ettings" data-toggle="tab">Settings</a></li>
     </ul>
    -

    Methods

    -

    $().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. -

    +

    Methods

    +

    $().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. +

     <ul class="tabs">
    -  <li class="active"><a href="#home">Home</a></li>
    -  <li><a href="#profile">Profile</a></li>
    -  <li><a href="#messages">Messages</a></li>
    -  <li><a href="#settings">Settings</a></li>
    +<li class="active"><a href="#home">Home</a></li>
    +<li><a href="#profile">Profile</a></li>
    +<li><a href="#messages">Messages</a></li>
    +<li><a href="#settings">Settings</a></li>
     </ul>
     
     <div class="tab-content">
    -  <div class="active" id="home">...</div>
    -  <div id="profile">...</div>
    -  <div id="messages">...</div>
    -  <div id="settings">...</div>
    +<div class="active" id="home">...</div>
    +<div id="profile">...</div>
    +<div id="messages">...</div>
    +<div id="settings">...</div>
     </div>
     
     <script>
    -  $(function () {
    -    $('.tabs a:last').tab('show')
    -  })
    +$(function () {
    +$('.tabs a:last').tab('show')
    +})
     </script>
    -

    -

    Events

    - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    +

    +

    Events

    + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    -
    +      
     $('a[data-toggle="tab"]').on('shown', function (e) {
    -  e.target // activated tab
    -  e.relatedTarget // previous tab
    +e.target // activated tab
    +e.relatedTarget // previous tab
     })
    -
    +
    + +
    + + + +
    + +
    +
    +

    About Tooltips

    +

    Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, uss css3 for animations, and data-attributes for local title storage.

    + Download file +
    +
    +

    Example use of Tooltips

    +

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

    -
    +
    +

    Using bootstrap-tooltip.js

    +

    Trigger the tooltip via javascript:

    +
    $('#example').tooltip(options)
    +

    Options

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    placementstring'top'how to position the tooltip - top | bottom | left | right
    selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
    titlestring | function''default title value if `title` tag isn't present
    triggerstring'hover'how tooltip is triggered - hover | focus | manual
    delaynumber | object0 +

    delay showing/hiding the tooltip (ms)

    +

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

    +

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

    +
    +

    Notice Individual tooltip instance options can alternatively be specified through the use of data attributes.

    +

    Markup

    +

    For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

    +

    Methods

    +

    $().tooltip(options)

    +

    Attaches a tooltip handler to an element collection.

    +

    .tooltip('show')

    +

    Reveals an elements tooltip.

    +
    $('#element').tooltip('show')
    +

    .tooltip('hide')

    +

    Hides an elements tooltip.

    +
    $('#element').tooltip('hide')
    + + + - -
    - + +
    - -
    - -
    -
    -

    About

    -

    Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

    - Download file -
    -
    -

    Example uses

    -

    Use the buttons plugin for states and toggles.

    - - - - - - - - - - - - - - - - - - - -
    Stateful - -
    Single toggle - -
    Checkbox -
    - - - -
    -
    Radio -
    - - - -
    -
    -
    -

    Using bootstrap-button.js

    -

    Enable buttons via javascript:

    -
    $('.tabs').button()
    -

    Markup

    -

    Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

    + +
    + +
    +
    +

    About

    +

    Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

    + Download file +
    +
    +

    Example uses

    +

    Use the buttons plugin for states and toggles.

    + + + + + + + + + + + + + + + + + + + +
    Stateful + +
    Single toggle + +
    Checkbox +
    + + + +
    +
    Radio +
    + + + +
    +
    +
    +

    Using bootstrap-button.js

    +

    Enable buttons via javascript:

    +
    $('.tabs').button()
    +

    Markup

    +

    Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

     <!-- Add data-toggle="button" to activate toggling on a single button -->
     <button class="btn" data-toggle="button">Single Toggle</button>
     
     <!-- Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group -->
     <div class="btn-group" data-toggle="buttons-checkbox">
    -  <button class="btn">Left</button>
    -  <button class="btn">Middle</button>
    -  <button class="btn">Right</button>
    +<button class="btn">Left</button>
    +<button class="btn">Middle</button>
    +<button class="btn">Right</button>
     </div>
     
     <!-- Add data-toggle="buttons-radio" for radio style toggling on btn-group -->
     <div class="btn-group" data-toggle="buttons-radio">
    -  <button class="btn">Left</button>
    -  <button class="btn">Middle</button>
    -  <button class="btn">Right</button>
    +<button class="btn">Left</button>
    +<button class="btn">Middle</button>
    +<button class="btn">Right</button>
     </div>
     
    -

    Methods

    -

    $().button('toggle')

    -

    Toggles push state. Gives btn the look that it's been activated.

    -

    Notice You can enable auto toggling of a button by using the data-toggle attribute.

    -
    <button class="btn" data-toggle="button" >...</button>
    -

    $().button('loading')

    -

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. -

    -
    <button class="btn" data-loading-text="loading stuff..." >...</button>
    -

    - Notice Firefox persists the disabled state across page loads. A workaround for this is to use: autocomplete="off". More info can be found here. -

    -

    $().button('reset')

    -

    Resets button state - swaps text to original text.

    -

    $().button(string)

    -

    Resets button state - swaps text to any data defined text state.

    +

    Methods

    +

    $().button('toggle')

    +

    Toggles push state. Gives btn the look that it's been activated.

    +

    Notice You can enable auto toggling of a button by using the data-toggle attribute.

    +
    <button class="btn" data-toggle="button" >...</button>
    +

    $().button('loading')

    +

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. +

    +
    <button class="btn" data-loading-text="loading stuff..." >...</button>
    +

    + Notice Firefox persists the disabled state across page loads. A workaround for this is to use: autocomplete="off". More info can be found here. +

    +

    $().button('reset')

    +

    Resets button state - swaps text to original text.

    +

    $().button(string)

    +

    Resets button state - swaps text to any data defined text state.

    <button class="btn" data-complete-text="finished!" >...</button>
     <script>
    -  $('.btn').button('complete')
    +$('.btn').button('complete')
     </script>
    -
    -
    -
    +
    +
    +
    - -
    - -
    -
    -

    About

    -

    Get base styles and flexible support for collapsible components like accordions and navigation.

    - Download file -
    -
    -

    Example accordion

    -

    Using the collapse plugin, we built a simple accordion style widget:

    - -
    -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
    -
    -
    -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
    -
    -
    -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
    -
    + +
    + +
    +
    +

    About

    +

    Get base styles and flexible support for collapsible components like accordions and navigation.

    + Download file +
    +
    +

    Example accordion

    +

    Using the collapse plugin, we built a simple accordion style widget:

    + +
    +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
    +
    +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    +
    +
    +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    +
    +
    +
    - -
    -

    Using bootstrap-collapse.js

    -

    Enable via javascript:

    -
    $(".collapse").collapse()
    -

    Options

    - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collasabile item is shown. (similar to traditional accordion behavior)
    togglebooleantrueToggles the collapsible element on invocation
    -

    Markup

    -

    Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

    -
    +      
    +      
    +

    Using bootstrap-collapse.js

    +

    Enable via javascript:

    +
    $(".collapse").collapse()
    +

    Options

    + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collasabile item is shown. (similar to traditional accordion behavior)
    togglebooleantrueToggles the collapsible element on invocation
    +

    Markup

    +

    Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

    +
     <button class="btn danger" data-toggle="collapse" data-target="#demo">
    -  simple collapsible
    +simple collapsible
     </button>
     
     <div id="demo" class="collapse in"> … </div>
    -

    Notice To add accordion like group management to a collapsible control just add the additional data attribute data-parent="#selector". Refer to the demo below to see this in action.

    -

    Methods

    -

    .collapse(options)

    -

    Activates your content as a collapsible element. Accepts an optional options object. +

    Notice To add accordion like group management to a collapsible control just add the additional data attribute data-parent="#selector". Refer to the demo below to see this in action.

    +

    Methods

    +

    .collapse(options)

    +

    Activates your content as a collapsible element. Accepts an optional options object.

     $('#myCollapsible').collapse({
    -  toggle: false
    +toggle: false
     })
    -

    .collapse('toggle')

    -

    Toggles a collapsible element to shown or hidden.

    -

    .collapse('show')

    -

    Shows a collapsible element.

    -

    .collapse('hide')

    -

    Hides a collapsible element.

    -

    Events

    -

    - Bootstrap's collapse class exposes a few events for hooking into collapse functionality. -

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
    hide - This event is fired immediately when the hide method has been called. -
    hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
    +

    .collapse('toggle')

    +

    Toggles a collapsible element to shown or hidden.

    +

    .collapse('show')

    +

    Shows a collapsible element.

    +

    .collapse('hide')

    +

    Hides a collapsible element.

    +

    Events

    +

    + Bootstrap's collapse class exposes a few events for hooking into collapse functionality. +

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
    hide + This event is fired immediately when the hide method has been called. +
    hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
     $('#myCollapsible').on('hidden', function () {
    -  // do something ...
    +// do something ...
     })
    -
    -
    -
    +
    +
    +
    - - + + + + +
    + +
    +
    +

    About

    +

    A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

    + Download file +
    +
    +

    Example

    +

    Start typing in the field below to show the typeahead results.

    +
    +
    -
    +
    +

    Using bootstrap-typeahead.js

    +

    Call the typeahead via javascript:

    +
    $('.typeahead').typeahead()
    +

    Options

    + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    itemsnumber8The max number of items to display in the dropdown.
    - - - -
    - -
    -
    -

    About

    -

    A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

    - Download file -
    -
    -

    Example

    -

    Start typing in the field below to show the typeahead results.

    -
    - -
    -
    -

    Using bootstrap-typeahead.js

    -

    Call the typeahead via javascript:

    -
    $('.typeahead').typeahead()
    -

    Options

    - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    itemsnumber8The max number of items to display in the dropdown.
    - -

    Markup

    -

    Add data attributes to register an element with typeahead functionality.

    +

    Markup

    +

    Add data attributes to register an element with typeahead functionality.

     <input type="text" data-provide="typeahead">
     
    -
    -
    -
    - - - + + + + @@ -1438,34 +1437,5 @@ $('.myCarousel').carousel({ - diff --git a/docs/less.html b/docs/less.html index 09ff3e8e10..84f58f00d7 100644 --- a/docs/less.html +++ b/docs/less.html @@ -7,7 +7,7 @@ - + @@ -18,10 +18,11 @@ - - - - + + + + + @@ -33,8 +34,8 @@
    Bootstrap -
  • Icons by Glyphicons
  • -
  • Progress bars
  • -
    - - + + - + + - + + + + + + + + + + + + diff --git a/docs/scaffolding.html b/docs/scaffolding.html index f068c837c7..7fdbea0ec3 100644 --- a/docs/scaffolding.html +++ b/docs/scaffolding.html @@ -7,7 +7,7 @@ - + @@ -18,10 +18,11 @@ - - - - + + + + + @@ -33,7 +34,7 @@
    Bootstrap -
  • Icons by Glyphicons
  • -
  • Progress bars
  • -
  • Typeahead
  • -
  • +
  • Using LESS @@ -107,12 +108,13 @@
    - -
    -

    Scaffolding

    -

    Bootstrap is built on a responsive 12-column grid. We've also included fixed- and fluid-width layouts based on that system.

    -
    + + +
    +

    Scaffolding

    +

    Bootstrap is built on a responsive 12-column grid. We've also included fixed- and fluid-width layouts based on that system.

    +
    @@ -417,8 +419,6 @@
  • - - + + - + + - + + + + + + + + + + - diff --git a/docs/templates/layout.mustache b/docs/templates/layout.mustache new file mode 100644 index 0000000000..cc36a05ed8 --- /dev/null +++ b/docs/templates/layout.mustache @@ -0,0 +1,144 @@ + + + + + Bootstrap, from Twitter + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +{{>body}} + + + + +
    + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/templates/pages/base-css.mustache b/docs/templates/pages/base-css.mustache new file mode 100644 index 0000000000..3933c867dc --- /dev/null +++ b/docs/templates/pages/base-css.mustache @@ -0,0 +1,1427 @@ + +
    +

    Base CSS

    +

    On top of the scaffolding, basic HTML elements are styled and enhanced with extensible classes to provide a fresh, consistent look and feel.

    +
    + + + +
    + + +

    Headings & body copy

    + + +
    +
    +

    Typographic scale

    +

    The entire typographic grid is based on two Less variables in our preboot.less file: @baseFontSize and @baseLineHeight. The first is the base font-size used throughout and the second is the base line-height.

    +

    We use those variables, and some math, to create the margins, paddings, and line-heights of all our type and more.

    +
    +
    +

    Example body text

    +

    Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    +

    Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec sed odio dui.

    +
    +
    +
    +

    h1. Heading 1

    +

    h2. Heading 2

    +

    h3. Heading 3

    +

    h4. Heading 4

    +
    h5. Heading 5
    +
    h6. Heading 6
    +
    +
    +
    + + +

    Emphasis, address, and abbreviation

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ElementUsageOptional
    + <strong> + + For emphasizing a snippet of text with important + + None +
    + <em> + + For emphasizing a snippet of text with stress + + None +
    + <abbr> + + Wraps abbreviations and acronyms to show the expanded version on hover + + Include optional title for expanded text +
    + <address> + + For contact information for its nearest ancestor or the entire body of work + + Preserve formatting by ending all lines with <br> +
    + +
    +
    +

    Using emphasis

    +

    Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.

    +

    Note: Feel free to use <b> and <i> in HTML5, but their usage has changed a bit. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.

    +
    +
    +

    Example addresses

    +

    Here are two examples of how the <address> tag can be used:

    +
    + Twitter, Inc.
    + 795 Folsom Ave, Suite 600
    + San Francisco, CA 94107
    + P: (123) 456-7890 +
    +
    + Full Name
    + first.last@gmail.com +
    +
    +
    +

    Example abbreviations

    +

    Abbreviations are styled with uppercase text and a light dotted bottom border. They also have a help cursor on hover so users have extra indication something will be shown on hover.

    +

    HTML is the best thing since sliced bread.

    +

    An abbreviation of the word attribute is attr.

    +
    +
    + + + +

    Blockquotes

    + + + + + + + + + + + + + + + + + + + + +
    ElementUsageOptional
    + <blockquote> + + Block-level element for quoting content from another source + +

    Add cite attribute for source URL

    + Use .pull-left and .pull-right classes for floated options +
    + <small> + + Optional element for adding a user-facing citation, typically an author with title of work + + Place the <cite> around the title or name of source +
    +
    +
    +

    To include a blockquote, wrap <blockquote> around any HTML as the quote. For straight quotes we recommend a <p>.

    +

    Include an optional <small> element to cite your source and you'll get an em dash &mdash; before it for styling purposes.

    +
    +
    +
    +<blockquote>
    +  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p>
    +  <small>Someone famous</small>
    +</blockquote>
    +
    +
    +
    + +

    Example blockquotes

    +
    +
    +

    Default blockquotes are styled as such:

    +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.

    + Someone famous in Body of work +
    +
    +
    +

    To float your blockquote to the right, add class="pull-right":

    +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.

    + Someone famous in Body of work +
    +
    +
    + + + +

    Lists

    +
    +
    +

    Unordered

    +

    <ul>

    +
      +
    • Lorem ipsum dolor sit amet
    • +
    • Consectetur adipiscing elit
    • +
    • Integer molestie lorem at massa
    • +
    • Facilisis in pretium nisl aliquet
    • +
    • Nulla volutpat aliquam velit +
        +
      • Phasellus iaculis neque
      • +
      • Purus sodales ultricies
      • +
      • Vestibulum laoreet porttitor sem
      • +
      • Ac tristique libero volutpat at
      • +
      +
    • +
    • Faucibus porta lacus fringilla vel
    • +
    • Aenean sit amet erat nunc
    • +
    • Eget porttitor lorem
    • +
    +
    +
    +

    Unstyled

    +

    <ul class="unstyled">

    +
      +
    • Lorem ipsum dolor sit amet
    • +
    • Consectetur adipiscing elit
    • +
    • Integer molestie lorem at massa
    • +
    • Facilisis in pretium nisl aliquet
    • +
    • Nulla volutpat aliquam velit +
        +
      • Phasellus iaculis neque
      • +
      • Purus sodales ultricies
      • +
      • Vestibulum laoreet porttitor sem
      • +
      • Ac tristique libero volutpat at
      • +
      +
    • +
    • Faucibus porta lacus fringilla vel
    • +
    • Aenean sit amet erat nunc
    • +
    • Eget porttitor lorem
    • +
    +
    +
    +

    Ordered

    +

    <ol>

    +
      +
    1. Lorem ipsum dolor sit amet
    2. +
    3. Consectetur adipiscing elit
    4. +
    5. Integer molestie lorem at massa
    6. +
    7. Facilisis in pretium nisl aliquet
    8. +
    9. Nulla volutpat aliquam velit
    10. +
    11. Faucibus porta lacus fringilla vel
    12. +
    13. Aenean sit amet erat nunc
    14. +
    15. Eget porttitor lorem
    16. +
    +
    +
    +

    Description

    +

    <dl>

    +
    +
    Description lists
    +
    A description list is perfect for defining terms.
    +
    Euismod
    +
    Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
    +
    Donec id elit non mi porta gravida at eget metus.
    +
    Malesuada porta
    +
    Etiam porta sem malesuada magna mollis euismod.
    +
    +
    +
    + + + + +

    Code Inline and block

    + + + + + + + + + + + + + + + + + + + + + +
    ElementResult
    <code>In a line of text like this, your wrapped code will look like this <html> element.
    <pre> +
    <div>
    +  <h1>Heading</h1>
    +  <p>Something right here...</p>
    +</div>
    +

    Note: Be sure to keep code within <pre> tags as close to the left as possible; it will render all tabs.

    +
    <pre class="prettyprint"> +

    Using the google-code-prettify library, you're blocks of code get a slightly different visual style and automatic syntax highlighting. You can also add an additional class to add line numbers.

    +
    <div>
    +  <h1>Heading</h1>
    +  <p>Something right here...</p>
    +</div>
    +
    <div>
    +  <h1>Heading</h1>
    +  <p>Something right here...</p>
    +</div>
    +

    Download google-code-prettify and view the readme for how to use.

    +
    + + +

    Inline labels for special attention

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LabelsMarkup
    + Default + + <span class="label">Default</span> +
    + New + + <span class="label success">New</span> +
    + Warning + + <span class="label warning">Warning</span> +
    + Important + + <span class="label important">Important</span> +
    + Notice + + <span class="label notice">Notice</span> +
    + +
    + + + + +
    + + +

    Table markup

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TagDescription
    + <table> + + Wrapping element for displaying data in a tabular format +
    + <thead> + + Container element for table header rows (<tr>) to label table columns +
    + <tbody> + + Container element for table rows (<tr>) in the body of the table +
    + <tr> + + Container element for a set of table cells (<td> or <th>) that appears on a single row +
    + <td> + + Default table cell +
    + <th> + + Special table cell for column (or row, depending on scope and placement) labels
    + Must be used within a <thead> +
    + <caption> + + Description or summary of what the table holds, especially useful for screen readers +
    +
    +
    +
    +<table>
    +  <thead>
    +    <tr>
    +      <th>...</th>
    +      <th>...</th>
    +    </tr>
    +  </thead>
    +  <tbody>
    +    <tr>
    +      <td>...</td>
    +      <td>...</td>
    +    </tr>
    +  </tbody>
    +</table>
    +
    +
    +
    + +

    Table options

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameClassDescription
    DefaultNoneNo styles, just columns and rows
    Basic + .table + Only horizontal lines between rows
    Bordered + .table-bordered + Rounds corners and adds outter border
    Zebra-stripe + .table-striped + Adds light gray background color to odd rows (1, 3, 5, etc)
    Condensed + .table-condensed + Cuts vertical padding in half, from 8px to 4px, within all td and th elements
    + + +

    Example tables

    + +

    1. Default table styles

    +
    +
    +

    Tables are automatically styled with only a few borders to ensure readability and maintain structure. With 2.0, the .table class is required.

    +
    +<table class="table">
    +  ...
    +</table>
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #First NameLast NameLanguage
    1MarkOttoCSS
    2JacobThorntonJavascript
    3StuDentHTML
    +
    +
    + + +

    2. Striped table

    +
    +
    +

    Get a little fancy with your tables by adding zebra-striping—just add the .table-striped class.

    +

    Note: Sprited tables use the :nth-child CSS selector and is not available in IE7-IE8.

    +
    +<table class="table table-striped">
    +  ...
    +</table>
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #First NameLast NameLanguage
    1MarkOttoCSS
    2JacobThorntonJavascript
    3StuDentHTML
    +
    +
    + + +

    3. Bordered table

    +
    +
    +

    Add borders around the entire table and rounded corners for aesthetic purposes.

    +
    +<table class="table table-bordered">
    +  ...
    +</table>
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #First NameLast NameLanguage
    1Mark OttoCSS
    2JacobThorntonJavascript
    3StuDent
    3BrosefStalinHTML
    +
    +
    + + +

    4. Condensed table

    +
    +
    +

    Make your tables more compact by adding the .table-condensed class to cut table cell padding in half (from 10px to 5px).

    +
    +<table class="table table-condensed">
    +  ...
    +</table>
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #First NameLast NameLanguage
    1MarkOttoCSS
    2JacobThorntonJavascript
    3StuDentHTML
    +
    +
    + + + +

    5. Striped table w/ TableSorter.js

    +
    +
    +

    Include the jQuery Tablesorter plugin and automaically get clear styles for sorted columns.

    +
    +<script src="jquery.tablesorter.js"></script>
    +<script >
    +  $(function() {
    +    $("table#sortTableExample")
    +    .tablesorter({
    +      sortList: [[1,0]]
    +    });
    +  });
    +</script>
    +<table class="table table-striped">
    +  ...
    +</table>
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #First NameLast NameLanguage
    1MarkOttoCSS
    2JacobThorntonJavascript
    3StuDentHTML
    4BrosefStalinHTML
    +

    Styles for the Tablesorter, zebra striping, borders, and condensing may all compound in any variation to fit your needs.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #First NameLast NameLanguage
    1MarkOttoCSS
    2JacobThorntonJavascript
    3StuDentHTML
    4BrosefStalinHTML
    +
    +
    +
    + + + + +
    + +
    +
    +

    Flexible HTML and CSS

    +

    The best part about forms in Bootstrap is that all your inputs and controls look great no matter how you build them in your markup. No superfluous HTML is required, but we provide the patterns for those who require it.

    +

    More complicated layouts come with succinct and scalable classes for easy styling and event binding, so you're covered at every step.

    +
    +
    +

    Four layouts included

    +

    Bootstrap comes with support for four types of form layouts:

    +
      +
    • Vertical (default)
    • +
    • Search
    • +
    • Inline
    • +
    • Horizontal
    • +
    +

    Different types of form layouts require some changes to markup, but the controls themselves remain and behave the same.

    +
    +
    +

    Control states and more

    +

    Bootstrap's forms include styles for all the base form controls like input, textarea, and select you'd expect. But it also comes with a number of custom components like appended and prepended inputs and support for lists of checkboxes.

    +

    States like error, warning, and success are included for each type of form control. Also included are styles for disabled controls.

    +
    +
    + +

    Four types of forms

    +

    Bootstrap provides simple markup and styles for four styles of common web forms.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameClassDescription
    Vertical (default).vertical-form (not required)Stacked, left-aligned labels over controls
    Horizontal.form-horizontalFloat left, right-aligned labels on same line as controls
    Inline.form-inlineLeft-aligned label and inline-block controls for compact style
    Search.form-searchExtra-rounded text input for a typical search aesthetic
    + + +

    Example forms using just form controls, no extra markup

    +
    +
    +

    Basic form

    +

    With v2.0, we have lighter and smarter defaults for form styles. No extra markup, just form controls.

    +
    + + + + +
    +
    +
    +

    Search form

    +

    Reflecting default WebKit styles, just add .form-search for extra rounded search fields.

    + +
    +
    +

    Inline form

    +

    Inputs are block level to start. For .form-inline and .form-horizontal, we use inline-block.

    + +
    +
    + +
    + +

    Horizontal forms

    +
    +
    +
    + Controls Bootstrap supports +
    + +
    + +

    In addition to freeform text, any HTML5 text-based input appears like so.

    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +

    What's included

    +

    Shown on the left are all the default form controls we support. Here's the bulleted list:

    +
      +
    • text inputs (text, password, email, etc)
    • +
    • checkbox
    • +
    • radio
    • +
    • select
    • +
    • multiple select
    • +
    • file input
    • +
    • textarea
    • +
    +
    +

    New defaults with v2.0

    +

    Up to v1.4, Bootstrap's default form styles used the horizontal layout. With Bootstrap 2, we removed that constraint to have smarter, more scalable defaults for any form.

    +
    +
    +
    + +
    + +
    +
    +
    + Form control states +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + Something may have gone wrong +
    +
    +
    + +
    + + Please correct the error +
    +
    +
    + +
    + + Woohoo! +
    +
    +
    + + +
    +
    +
    +
    +
    +

    Redesigned browser states

    +

    Bootstrap features styles for browser-supported focused and disabled states. We remove the default Webkit outline and apply a box-shadow in it's place for :focus.

    +
    +

    Form validation

    +

    It also includes validation styles for errors, warnings, and success. To use, add the a class to the surrounding .control-group.

    +
    +<fieldset
    +  class="control-group error">
    +  ...
    +</fieldset>
    +
    +
    +
    +
    + +
    + +
    +
    +
    + Extending form controls +
    + +
    + + + +

    Use the same .span* classes from the grid system for input sizes.

    +
    +
    +
    + +
    +
    + @ + +
    +

    Here's some help text

    +
    +
    +
    + +
    +
    + + .00 +
    +

    Here's more help text

    +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +

    Note: Labels surround all the options for much larger click areas and a more usable form.

    +
    +
    +
    + +
    + + +
    +
    +
    + + +
    +
    +
    +
    +
    +

    Prepend & append inputs

    +

    Input groups—with appended or prepended text—provide an easy way to give more context for your inputs. Great examples include the @ sign for Twitter usernames or $ for finances.

    +
    +

    Checkboxes and radios

    +

    Up to v1.4, Bootstrap required extra markup around checkboxes and radios to stack them. Now, it's a simple matter of repeating the <label class="checkbox"> that wraps the <input type="checkbox">.

    +

    Inline checkboxes and radios are also supported. Just add .inline to any .checkbox or .radio and you're done.

    +
    +
    +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ButtonClassDescription
    Default.btnStandard gray button with gradient
    Primary.primaryProvides extra visual weight and identifies the primary action in a set of buttons
    Info.infoUsed as an alternate to the default styles
    Success.successIndicates a successful or positive action
    Danger.dangerIndicates a dangerous or potentially negative action
    + +
    +
    +

    Buttons for actions

    +

    As a convention, buttons should only be used for actions while hyperlinks are to be used for objects. For instance, "Download" should be a button while "recent activity" should be a link.

    +
    +
    +

    For anchors and forms

    +

    Button styles can be applied to anything with the .btn applied. However, typically you’ll want to apply these to only <a> and <button> elements.

    +
    +
    +

    Note: All buttons must include the .btn class. Button styles should be applied to <button> and <a> elements for consistency.

    +
    +
    + +
    +
    +

    Multiple sizes

    +

    Fancy larger or smaller buttons? Have at it!

    +

    + Primary action + Action +

    +

    + Primary action + Action +

    +
    +
    +

    Disabled state

    +

    For buttons that are not active or are disabled by the app for one reason or another, use the disabled state. That’s .disabled for links and :disabled for <button> elements.

    +

    + Primary action + Action +

    +

    +   +

    +
    +
    + +
    + +
    + + + + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + +
    +
    +
    +

    Light red background color is only used to show the dimensions of the icons in the docs.

    +
    +
    + +
    + +
    +
    +

    Built as a sprite

    +

    Instead of making every icon an extra request, we've compiled them into a sprite—a bunch of images in one file that uses CSS to position the images with background-position. This is the same method we use on Twitter.com and it has worked well for us.

    +

    Glyphicons has granted us use of the Halflings set in our open-source toolkit so long as we provide a link and credit. Please consider doing the same in your projects.

    +
    +
    +

    How to use

    +

    With v2.0.0, the <i> tag is essentially dedicated to iconography. To use the icons, you can place the follow code wherever you like one to appear:

    +
    +<i class="chevron-left"></i>
    +
    +

    There are over 100 classes to choose from for your icons. Just add an <i> tag with the right class and you're set. You can find the full list in sprites.less or right here in this document.

    +
    +
    +

    Use cases

    +

    Icons are great, but where would one use them? Here are a few ideas:

    +
      +
    • As visuals for your sidebar navigation
    • +
    • For a purely icon-driven nav
    • +
    • For buttons to help convey the meaning of an action
    • +
    • With links to share context on a user's destination
    • +
    +

    Essentially, anywhere you can put an <i> tag, you can put an icon.

    +
    +
    + +

    Examples

    +
    +
    +

    Use them in buttons, or in button groups for a toolbar style presentation.

    +

    + Refresh + Settings +

    +
    +
    + + + +
    +
    + + + + +
    +
    +
    +
    +

    Or, use them in navigation.

    + +
    +
    +
    \ No newline at end of file diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache new file mode 100644 index 0000000000..21ddf47477 --- /dev/null +++ b/docs/templates/pages/components.mustache @@ -0,0 +1,1176 @@ + +
    +

    Components

    +

    Dozens of reusable components are built into Bootstrap to provide navigation, alerts, popovers, and much more.

    +
    + + + +
    + +
    +
    +

    Button groups

    +

    Use button groups to join multiple buttons together as one composite component. Build them with a series of <a> or <button> elements.

    +

    You can also combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex projects.

    +
    +
    + Left + Middle + Right +
    +
    +
    +
    +
    + 1 + 2 + 3 + 4 +
    +
    + 5 + 6 + 7 +
    +
    + 8 +
    +
    +
    + +
    +
    +

    Example markup

    +

    Here's how the HTML looks for a standard button group built with anchor tag buttons:

    +
    +<div class="btn-group">
    +  <a class="btn" href="#">1</a>
    +  <a class="btn" href="#">2</a>
    +  <a class="btn" href="#">3</a>
    +</div>
    +
    +

    And with a toolbar for multiple groups:

    +
    +<div class="btn-toolbar">
    +  <div class="btn-group">
    +    ...
    +  </div>
    +</div>
    +
    +
    +
    +

    Checkbox and radio flavors

    +

    Button groups can also function as radios, where only one button may be active, or checkboxes, where any number of buttons may be active. View the Javascript docs for that.

    +

    Get the javascript »

    +
    +

    Heads up

    +

    CSS for button groups is in a separate file, button-groups.less.

    +
    +
    +
    + + + + +
    + +
    +
    +

    Split button dropdowns

    +

    Building on the button group styles and markup, we can easily create a split button. Split buttons feature a standard action on the left and a dropdown toggle on the right with contextual links.

    + +
    +
    +

    Example markup

    +

    Similar to a button group, our markup uses regular button markup, but with a handful of additions to refine the style and support Bootstrap's dropdown jQuery plugin.

    +
    +<div class="btn-group">
    +  <a class="btn" href="#">Action</a>
    +  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
    +    <span class="caret"></span>
    +  </a>
    +  <ul class="dropdown-menu">
    +    <!-- dropdown menu links -->
    +  </ul>
    +</div>
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    + + +

    Multi-page pagination

    +
    +
    +

    When to use

    +

    Ultra simplistic and minimally styled pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.

    +

    Stateful page links

    +

    Links are customizable and work in a number of circumstances with the right class. .disabled for unclickable links and .active for current page.

    +

    Flexible alignment

    +

    Add either of two optional classes to change the alignment of pagination links: .pagination-centered and .pagination-right.

    +
    +
    +

    Examples

    +

    The default pagination component is flexible and works in a number of variations.

    + + + + +
    +
    +

    Markup

    +

    Wrapped in a <div>, pagination is just a <ul>.

    +
    +<div class="pagination">
    +  <ul>
    +    <li><a href="#">Prev</a></li>
    +    <li class="active">
    +      <a href="#">1</a>
    +    </li>
    +    <li><a href="#">2</a></li>
    +    <li><a href="#">3</a></li>
    +    <li><a href="#">4</a></li>
    +    <li><a href="#">Next</a></li>
    +  </ul>
    +</div>
    +
    +
    +
    + +

    Pager For quick previous and next links

    +
    +
    +

    About pager

    +

    The pager component is a set of links for simple pagination implemenations with light markup and even lighter styles. It's great for simple sites like blogs or magazines.

    +
    +
    +

    Default example

    +

    By default, the pager centers links.

    + +
    +<ul class="pager">
    +  <li>
    +    <a href="#">Previous</a>
    +  </li>
    +  <li>
    +    <a href="#">Next</a>
    +  </li>
    +</ul>
    +
    +
    +
    +

    Aligned links

    +

    Alternatively, you can align each link to the sides:

    + +
    +<ul class="pager">
    +  <li class="previous">
    +    <a href="#">&larr; Older</a>
    +  </li>
    +  <li class="next">
    +    <a href="#">Newer &rarr;</a>
    +  </li>
    +</ul>
    +
    +
    +
    +
    + + + + +
    + + +
    +
    +

    Default thumbnails

    +

    By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.

    + +
    +
    +

    Highly customizable

    +

    With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.

    +
      +
    • +
      + +
      +
      Thumbnail label
      +

      Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

      +

      Action Action

      +
      +
      +
    • +
    • +
      + +
      +
      Thumbnail label
      +

      Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

      +

      Action Action

      +
      +
      +
    • +
    +
    +
    + +
    +
    +

    Why use thumbnails

    +

    Thumbnails (previously .media-grid up until v1.4) are great for grids of photos or videos, image search results, retail products, portfolios, and much more. They can be links or static content.

    +
    +
    +

    Simple, flexible markup

    +

    Thumbnail markup is simple—a ul with any number of li elements is all that is required. It's also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.

    +
    +
    +

    Uses grid column sizes

    +

    Lastly, the thumbnails component uses existing grid system classes—like .span2 or .span3—for control of thumbnail dimensions.

    +
    +
    + +
    +
    +

    The markup

    +

    As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup for linked images:

    +
    +<ul class="thumbnails">
    +  <li class="span3">
    +    <a href="#" class="thumbnail">
    +      <img src="http://placehold.it/210x150" alt="">
    +    </a>
    +  </li>
    +  ...
    +</ul>
    +
    +

    For custom HTML content in thumbnails, the markup changes slightly. To allow block level content anywhere, we swap the <a> for a <div> like so:

    +
    +<ul class="thumbnails">
    +  <li class="span3">
    +    <div class="thumbnail">
    +      <img src="http://placehold.it/210x150" alt="">
    +      <h5>Thumbnail label</h5>
    +      <p>Thumbnail caption right here...</p>
    +    </div>
    +  </li>
    +  ...
    +</ul>
    +
    +
    +
    +

    More examples

    +

    Explore all your options with the various grid classes available to you. You can also mix and match different sizes.

    + +
    +
    + +
    + + + + +
    + + +

    Lightweight defaults

    +
    +
    +

    Rewritten base class

    +

    With Bootstrap 2, we've simplified the base class: .alert instead of .alert-message. We've also reduced the minimum required markup—no <p> is required by default, just the outter <div>.

    +

    Single alert message

    +

    For a more durable component with less code, we've removed the differentiating look for block alerts, messages that come with more padding and typically more text. The class also has changed to .alert-block.

    +
    +

    Goes great with javascript

    +

    Bootstrap comes with a great jQuery plugin that supports alert messages, making dismissing them quick and easy.

    +

    Get the plugin »

    +
    +
    +

    Example alerts

    +

    Wrap your message and an optional close icon in a div with simple class.

    +
    + × + Warning! Best check yo self, you’re not looking too good. +
    +
    +<div class="alert">
    +  <a class="close">×</a>
    +  <strong>Warning!</strong> Best check yo self, you’re not looking too good.
    +</div>
    +
    +

    Easily extend the standard alert message with two optional classes: .alert-block for more padding and text controls and .alert-heading for a matching heading.

    +
    + × +

    Warning!

    +

    Best check yo self, you’re not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

    +
    +
    +<div class="alert alert-block">
    +  <a class="close">×</a>
    +  <h4 class="alert-heading">Warning!</h4>
    +  Best check yo self, you’re not...
    +</div>
    +
    +
    +
    + +

    Contextual alternatives Add optional classes to change an alert's connotation

    +
    +
    +

    Error or danger

    +
    + × + Oh snap! Change a few things up and try submitting again. +
    +
    +<div class="alert alert-error">
    +  ...
    +</div>
    +
    +
    +
    +

    Success

    +
    + × + Well done! You successfully read this important alert message. +
    +
    +<div class="alert alert-success">
    +  ...
    +</div>
    +
    +
    +
    +

    Information

    +
    + × + Heads up! This alert needs your attention, but it’s not super important. +
    +
    +<div class="alert alert-info">
    +  ...
    +</div>
    +
    +
    +
    + +
    + + + + +
    + + +

    Examples and markup

    +
    +
    +

    Basic

    +

    Default progress bar with a vertical gradient.

    +
    +
    +
    +
    +<div class="progress">
    +  <div class="bar"
    +       style="width: 60%;"></div>
    +</div>
    +
    +
    +
    +

    Striped

    +

    Uses a gradient to create a striped effect.

    +
    +
    +
    +
    +<div class="progress info
    +     striped">
    +  <div class="bar"
    +       style="width: 20%;"></div>
    +</div>
    +
    +
    +
    +

    Animated

    +

    Takes the striped example and animates it.

    +
    +
    +
    +
    +<div class="progress danger
    +     striped active">
    +  <div class="bar"
    +       style="width: 40%;"></div>
    +</div>
    +
    +
    +
    + +

    Options and browser support

    +
    +
    +

    Additional colors

    +

    Progress bars utilize some of the same classes as buttons and alert messages for quick styling.

    +
      +
    • .info
    • +
    • .success
    • +
    • .danger
    • +
    +

    Alternatively, you can customize the LESS files and roll your own colors and sizes.

    +
    +
    +

    Behavior

    +

    Progress bars use CSS3 transitions, so if you dynamically adjust the width via javascript, it will smoothly resize.

    +

    If you use the .active class, your .striped progress bars will animate the stripes left to right.

    +
    +
    +

    Browser support

    +

    Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in IE7-8 or older versions of Firefox.

    +

    Opera does not support animations at this time.

    +
    +
    + +
    \ No newline at end of file diff --git a/docs/templates/pages/index.mustache b/docs/templates/pages/index.mustache new file mode 100644 index 0000000000..f07116a5af --- /dev/null +++ b/docs/templates/pages/index.mustache @@ -0,0 +1,188 @@ +
    + + +
    +
    +

    Bootstrap,
    from Twitter

    +

    Bootstrap is a responsive frontend toolkit from Twitter designed to kickstart web development, featuring HTML, CSS, and JS for dozens of base elements and common design components.

    +

    + Download on GitHub + Get started → +

    + +
    +

    Feature highlights

    +
      +
    • × Built on LESS
    • +
    • × Complete styleguide docs
    • +
    • × Fully responsive design
    • +
    • × Small footprint (7kb gzipped)
    • +
    • × Support for IE7 and up
    • +
    • × Custom jQuery plugins
    • +
    • × Dozens of components
    • +
    +
    +
    +
    + + + + +
    +

    Built with Bootstrap.

    + + + +

    Designed for everyone, everywhere.

    + +
    +
    + +

    Built for and by nerds

    +

    Like you, we love building awesome products on the web. We love it so much, we decided to help people just like us do it easier, better, and faster. Bootstrap is built for you.

    +
    +
    + +

    For all skill levels

    +

    Bootstrap is designed to help people of all skill level—designer or developer, huge nerd or early beginner. Use it as a complete kit or use to start something more complex.

    +
    +
    + +

    Cross-everything

    +

    Originally built with only modern browsers in mind, Bootstrap has evolved to include support for all major browsers (even IE7!) and, with Bootstrap 2, tablets and smartphones, too.

    +
    +
    +
    +
    + +

    12-column grid

    +

    Grid systems aren't everything, but having a durable and flexible one at the core of your work can make development much simpler. Use our built-in grid classes or roll your own.

    +
    +
    + +

    Responsive design

    +

    With Bootstrap 2, we've gone fully responsive. Our components are scaled according to a range of resolutions and devices to provide a consistent experience, no matter what.

    +
    +
    + +

    Styleguide docs

    +

    Unlike other front-end toolkits, Bootstrap was designed first and foremost as a styleguide to document not only our features, but best practices and living, coded examples.

    +
    +
    +
    +
    + +

    Growing library

    +

    Despite being only 7kb (gzipped), Bootstrap is one of the most complete front-end toolkits out there with dozens of fully functional components ready to be put to use.

    +
    +
    + +

    Custom jQuery plugins

    +

    What good is an awesome design component without easy-to-use, proper, and extensible interactions? With Bootstrap, you get custom-built jQuery plugins to bring your projects to life.

    +
    +
    + +

    Built on LESS

    +

    Where vanilla CSS falters, LESS excels. Variables, nesting, operations, and mixins in LESS makes coding CSS faster and more efficient with minimal overhead.

    +
    +
    +
    +
    + +

    HTML5

    +

    Built to support new HTML5 elements and syntax.

    +
    +
    + +

    CSS3

    +

    Progressively enhanced components for ultimate style.

    +
    +
    + +

    Open-source

    +

    Built for and maintained by the community via GitHub.

    +
    +
    + +

    Made at Twitter

    +

    Brought to you by an experienced engineer and designer.

    +
    +
    + + + +

    Get started in no time.

    + + + + + + + + + +
    +

    Hotlink the CSS

    +

    For the quickest and easiest start, just copy this snippet into your webpage.

    +
    + +
    +
    +

    Use it with LESS

    +

    A fan of using LESS? No problem, just clone the repo and add these lines:

    +
    + +
    +
    +

    Fork on GitHub

    +

    Download, fork, pull, file issues, and more with the Bootstrap GitHub repo.

    +

    Bootstrap on GitHub »

    +

    Currently v2.0.0

    +
    +
    +
    \ No newline at end of file diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache new file mode 100644 index 0000000000..aefe878469 --- /dev/null +++ b/docs/templates/pages/javascript.mustache @@ -0,0 +1,1299 @@ + +
    +

    Javascript for Bootstrap

    +

    Bring Bootstrap's components to life—now with 12 custom jQuery plugins. +

    + + + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + Select/Unselect All Plugins +

    Note: All plugins require the latest version of jQuery to be included.

    +
    + + + + +
    + +
    +
    +

    About modals

    +

    A streamlined, but flexible, take on the traditional javascript modal plugin with only the minimum required functionality and smart defaults.

    + Download file +
    +
    +

    Static example

    +

    Below is a statically rendered modal.

    +
    + +
    + +

    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.

    + + + Launch demo modal + +
    + +

    Using bootstrap-modal

    +

    Call the modal via javascript:

    +
    $('#myModal').modal(options)
    +

    Options

    + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    backdropbooleantrueIncludes a modal-backdrop element
    keyboardbooleantrueCloses the modal when escape key is pressed
    +

    Markup

    +

    You can activate modals on your page easily without having to write a single line of javascript. Just set data-toggle="modal" on a controller element with a data-target="#foo" or href="#foo" which corresponds to a modal element id, and when clicked, it will launch your modal.

    +

    Also, to add options to your modal instance, just include them as additional data attributes on either the control element or the modal markup itself.

    +
    +<a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>
    +
    + +
    +<div class="modal">
    +<div class="modal-header">
    +<a href="#" class="close js-dismiss">×</a>
    +<h3>Modal header</h3>
    +</div>
    +<div class="modal-body">
    +<p>One fine body…</p>
    +</div>
    +<div class="modal-footer">
    +<a href="#" class="btn primary">Save changes</a>
    +<a href="#" class="btn">Close</a>
    +</div>
    +</div>
    +
    +

    Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).

    +

    Methods

    +

    .modal(options)

    +

    Activates your content as a modal. Accepts an optional options object. +

    +$('#myModal').modal({
    +keyboard: false
    +})
    +

    .modal('toggle')

    +

    Manually toggles a modal.

    +
    $('#myModal').modal('toggle')
    +

    .modal('show')

    +

    Manually opens a modal.

    +
    $('#myModal').modal('show')
    +

    .modal('hide')

    +

    Manually hides a modal.

    +
    $('#myModal').modal('hide')
    +

    Events

    +

    Bootstrap's modal class exposes a few events for hooking into modal functionality.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).
    hideThis event is fired immediately when the hide instance method has been called.
    hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
    + +
    +$('#myModal').on('hidden', function () {
    +// do something ...
    +})
    +
    +
    +
    + + + + + + + + + +
    + +
    +
    +

    The ScrollSpy plugin is for automatically updating nav targets based on scroll position.

    + Download file +
    +
    +

    Example navbar with scrollspy

    +

    Scroll the area below and watch the navigation update. The dropdown sub items will be highlighted as well. Try it!

    + +
    +

    @fat

    +

    + Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. +

    +

    @mdo

    +

    + Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt. +

    +

    one

    +

    + Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone. +

    +

    two

    +

    + In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt. +

    +

    three

    +

    + Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat. +

    +

    Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. +

    +
    +
    +

    Using bootstrap-scrollspy.js

    +

    Call the scrollspy via javascript:

    +
    $('#navbar').scrollspy()
    +

    Markup

    +

    To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body). +

    <body data-spy="scroll" >...</body>
    +

    Notice Navbar anchor tags 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>. +

    Options

    + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    offsetnumber10Pixels to offset from top when calculating position of scroll.
    +
    +
    +
    + + + + +
    + +
    +
    +

    This plugin adds quick, dynamic tab and pill functionality for transitioning through local content.

    + Download file +
    +
    +

    Example tabs

    +

    Click the tabs below to toggle between hidden panes, even via dropdown menus.

    + +
    +
    +

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    +
    +
    +

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    +
    + + +
    +
    +

    Using bootstrap-tab.js

    +

    Enable tabbable tabs via javascript:

    +
    $('#myTab').tab('show')
    +

    Markup

    +

    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.

    +
    +<ul class="tabs">
    +<li><a href="#home" data-toggle="tab">Home</a></li>
    +<li><a href="#profile" data-toggle="tab">Profile</a></li>
    +<li><a href="#messages" data-toggle="tab">Messages</a></li>
    +<li><a href="#ettings" data-toggle="tab">Settings</a></li>
    +</ul>
    +

    Methods

    +

    $().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. +

    +
    +<ul class="tabs">
    +<li class="active"><a href="#home">Home</a></li>
    +<li><a href="#profile">Profile</a></li>
    +<li><a href="#messages">Messages</a></li>
    +<li><a href="#settings">Settings</a></li>
    +</ul>
    +
    +<div class="tab-content">
    +<div class="active" id="home">...</div>
    +<div id="profile">...</div>
    +<div id="messages">...</div>
    +<div id="settings">...</div>
    +</div>
    +
    +<script>
    +$(function () {
    +$('.tabs a:last').tab('show')
    +})
    +</script>
    +

    +

    Events

    + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    + +
    +$('a[data-toggle="tab"]').on('shown', function (e) {
    +e.target // activated tab
    +e.relatedTarget // previous tab
    +})
    +
    +
    +
    + + + +
    + +
    +
    +

    About Tooltips

    +

    Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, uss css3 for animations, and data-attributes for local title storage.

    + Download file +
    +
    +

    Example use of Tooltips

    +

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

    +
    +
    +

    Using bootstrap-tooltip.js

    +

    Trigger the tooltip via javascript:

    +
    $('#example').tooltip(options)
    +

    Options

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    placementstring'top'how to position the tooltip - top | bottom | left | right
    selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
    titlestring | function''default title value if `title` tag isn't present
    triggerstring'hover'how tooltip is triggered - hover | focus | manual
    delaynumber | object0 +

    delay showing/hiding the tooltip (ms)

    +

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

    +

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

    +
    +

    Notice Individual tooltip instance options can alternatively be specified through the use of data attributes.

    +

    Markup

    +

    For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

    +

    Methods

    +

    $().tooltip(options)

    +

    Attaches a tooltip handler to an element collection.

    +

    .tooltip('show')

    +

    Reveals an elements tooltip.

    +
    $('#element').tooltip('show')
    +

    .tooltip('hide')

    +

    Hides an elements tooltip.

    +
    $('#element').tooltip('hide')
    +
    +
    +
    + + + + +
    + +
    +
    +

    About popovers

    +

    Add small overlays of content, like those on the iPad, to any element for housing secondary information.

    +

    * Requires Tooltip to be included

    + Download file +
    +
    +

    Example hover popover

    +

    Hover over the button to trigger the popover.

    + +
    +

    Using bootstrap-popover.js

    +

    Enable popovers via javascript:

    +
    $('#example').popover(options)
    +

    Options

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    placementstring'right'how to position the popover - top | bottom | left | right
    selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
    triggerstring'hover'how tooltip is triggered - hover | focus | manual
    titlestring | function''default title value if `title` attribute isn't present
    contentstring | function''default content value if `data-content` attribute isn't present
    delaynumber | object0 +

    delay showing/hiding the popover (ms)

    +

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

    +

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

    +
    +

    Notice Individual popover instance options can alternatively be specified through the use of data attributes.

    +

    Markup

    +

    + For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a the selector option. +

    +

    Methods

    +

    $().popover(options)

    +

    Initializes popovers for an element collection.

    +

    .popover('show')

    +

    Reveals an elements popover.

    +
    $('#element').popover('show')
    +

    .popover('hide')

    +

    Hides an elements popover.

    +
    $('#element').popover('hide')
    +
    +
    +
    + + + + +
    + +
    +
    +

    About alerts

    +

    The alert plugin is a tiny class for adding close functionality to alerts.

    + Download +
    +
    +

    Example alerts

    +

    The alerts plugin works on regular alert messages, and block messages.

    +
    + × + Holy guacamole! Best check yo self, you’re not looking too good. +
    +
    + × +

    Oh snap! You got an error!

    +

    Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

    +

    + Take this action Or do this +

    +
    +
    +

    Using bootstrap-alerts.js

    +

    Enable dismissal of an alert via javascript:

    +
    $(".alert-message").alert()
    +

    Markup

    +

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    +
    <a class="close" data-dismiss="alert" href="#">&times;</a>
    +

    Methods

    +

    $().alert()

    +

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    +

    .alert('close')

    +

    Closes an alert.

    +
    $(".alert-message").alert('close')
    +

    Events

    +

    Bootstrap's alert class exposes a few events for hooking into alert functionality.

    + + + + + + + + + + + + + + + + + +
    EventDescription
    closeThis event fires immediately when the close instance method is called.
    closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
    +
    +$('#my-alert').bind('closed', function () {
    +// do something ...
    +})
    +
    +
    +
    + + + + +
    + +
    +
    +

    About

    +

    Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

    + Download file +
    +
    +

    Example uses

    +

    Use the buttons plugin for states and toggles.

    + + + + + + + + + + + + + + + + + + + +
    Stateful + +
    Single toggle + +
    Checkbox +
    + + + +
    +
    Radio +
    + + + +
    +
    +
    +

    Using bootstrap-button.js

    +

    Enable buttons via javascript:

    +
    $('.tabs').button()
    +

    Markup

    +

    Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

    +
    +<!-- Add data-toggle="button" to activate toggling on a single button -->
    +<button class="btn" data-toggle="button">Single Toggle</button>
    +
    +<!-- Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group -->
    +<div class="btn-group" data-toggle="buttons-checkbox">
    +<button class="btn">Left</button>
    +<button class="btn">Middle</button>
    +<button class="btn">Right</button>
    +</div>
    +
    +<!-- Add data-toggle="buttons-radio" for radio style toggling on btn-group -->
    +<div class="btn-group" data-toggle="buttons-radio">
    +<button class="btn">Left</button>
    +<button class="btn">Middle</button>
    +<button class="btn">Right</button>
    +</div>
    +
    +

    Methods

    +

    $().button('toggle')

    +

    Toggles push state. Gives btn the look that it's been activated.

    +

    Notice You can enable auto toggling of a button by using the data-toggle attribute.

    +
    <button class="btn" data-toggle="button" >...</button>
    +

    $().button('loading')

    +

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. +

    +
    <button class="btn" data-loading-text="loading stuff..." >...</button>
    +

    + Notice Firefox persists the disabled state across page loads. A workaround for this is to use: autocomplete="off". More info can be found here. +

    +

    $().button('reset')

    +

    Resets button state - swaps text to original text.

    +

    $().button(string)

    +

    Resets button state - swaps text to any data defined text state.

    +
    <button class="btn" data-complete-text="finished!" >...</button>
    +<script>
    +$('.btn').button('complete')
    +</script>
    +
    +
    +
    + + + + +
    + +
    +
    +

    About

    +

    Get base styles and flexible support for collapsible components like accordions and navigation.

    + Download file +
    +
    +

    Example accordion

    +

    Using the collapse plugin, we built a simple accordion style widget:

    + +
    +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    +
    +
    +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    +
    +
    +
    + +
    +
    + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
    +
    +
    +
    + + +
    +

    Using bootstrap-collapse.js

    +

    Enable via javascript:

    +
    $(".collapse").collapse()
    +

    Options

    + + + + + + + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collasabile item is shown. (similar to traditional accordion behavior)
    togglebooleantrueToggles the collapsible element on invocation
    +

    Markup

    +

    Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

    +
    +<button class="btn danger" data-toggle="collapse" data-target="#demo">
    +simple collapsible
    +</button>
    +
    +<div id="demo" class="collapse in"> … </div>
    +

    Notice To add accordion like group management to a collapsible control just add the additional data attribute data-parent="#selector". Refer to the demo below to see this in action.

    +

    Methods

    +

    .collapse(options)

    +

    Activates your content as a collapsible element. Accepts an optional options object. +

    +$('#myCollapsible').collapse({
    +toggle: false
    +})
    +

    .collapse('toggle')

    +

    Toggles a collapsible element to shown or hidden.

    +

    .collapse('show')

    +

    Shows a collapsible element.

    +

    .collapse('hide')

    +

    Hides a collapsible element.

    +

    Events

    +

    + Bootstrap's collapse class exposes a few events for hooking into collapse functionality. +

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
    hide + This event is fired immediately when the hide method has been called. +
    hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
    + +
    +$('#myCollapsible').on('hidden', function () {
    +// do something ...
    +})
    +
    +
    +
    + + + + + + + + + +
    + +
    +
    +

    About

    +

    A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

    + Download file +
    +
    +

    Example

    +

    Start typing in the field below to show the typeahead results.

    +
    + +
    +
    +

    Using bootstrap-typeahead.js

    +

    Call the typeahead via javascript:

    +
    $('.typeahead').typeahead()
    +

    Options

    + + + + + + + + + + + + + + + + + +
    Nametypedefaultdescription
    itemsnumber8The max number of items to display in the dropdown.
    + +

    Markup

    +

    Add data attributes to register an element with typeahead functionality.

    +
    +<input type="text" data-provide="typeahead">
    +
    +
    +
    +
    \ No newline at end of file diff --git a/docs/templates/pages/less.mustache b/docs/templates/pages/less.mustache new file mode 100644 index 0000000000..568e857bef --- /dev/null +++ b/docs/templates/pages/less.mustache @@ -0,0 +1,406 @@ + +
    +

    Using LESS with Bootstrap

    +

    Customize and extend Bootstrap with LESS, a CSS preprocessor, to take advantage of the variables, mixins, and more used to build Bootstrap's CSS.

    +
    + + + + + +
    +
    +

    Why LESS?

    +

    Bootstrap is made with LESS at it's core, a dynamic stylesheet language created by Alexis Sellier. It makes developing systems-based CSS faster, easier, and more fun.

    +
    +
    +

    What's included?

    +

    As an extension of CSS, LESS includes variables, mixins for reusable snippets of code, operations for simple math, nesting, and even color functions.

    +
    +
    +

    Learn more

    + LESS CSS +

    Visit the official website at http://lesscss.org to learn more.

    +
    +
    +
    +
    +

    Variables

    +

    Managing colors and pixel values in CSS can be a bit of a pain, usually full of copy and paste. Not with LESS though—assign colors or pixel values as variables and change them once.

    +
    +
    +

    Mixins

    +

    Those three border-radius declarations you need to make in regular ol' CSS? Now they're down to one line with the help of mixins, snippets of code you can reuse anywhere.

    +
    +
    +

    Operations

    +

    Make your grid, leading, and more super flexible by doing the math on the fly with operations. Multiple, divide, add, and subtract your way to CSS sanity.

    +
    +
    + + + + + + +

    Hyperlinks

    + + + + + + + + + + + + + + + + + + + + +
    VariableValueUsage
    @linkColor#0069d6Default link text color
    @linkColorHoverdarken(@linkColor, 15)Default link text hover color
    + +
    +
    +

    Grayscale colors

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    @black#000
    @grayDarklighten(@black, 25%)
    @graylighten(@black, 50%)
    @grayLightlighten(@black, 75%)
    @grayLighterlighten(@black, 90%)
    @white#fff
    +
    +
    +

    Accent colors

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    @blue#049CDB
    @green#46a546
    @red#9d261d
    @yellow#ffc40d
    @orange#f89406
    @pink#c3325f
    @purple#7a43b6
    +
    +
    + +
    +
    +

    Grid system

    + + + + + + + + + + + + + + + + + + + +
    @gridColumns12
    @gridColumnWidth60px
    @gridGutterWidth20px
    @siteWidth(@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1))
    +
    +
    +

    Typography

    + + + + + + + + + + + + + + + + +
    @baseFontSize13px
    @baseFontFamily"Helvetica Neue", Helvetica, Arial, sans-serif
    @baseLineHeight18px
    +
    +
    + +
    +
    +

    Visuals

    +
    +
    + + + + + + + + +
    @primaryButtonColor@blue
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +

    Bootstrap was built with Preboot, an open-source pack of mixins and variables to be used in conjunction with Less, a CSS preprocessor for faster and easier web development.

    +

    Check out how we used Preboot in Bootstrap and how you can make use of it should you choose to run Less on your next project.

    +
    +
    +

    How to use it

    +

    Use this option to make full use of Bootstrap’s Less variables, mixins, and nesting in CSS via javascript in your browser.

    +
    +<link rel="stylesheet/less" href="less/bootstrap.less" media="all" />
    +<script src="js/less-1.1.3.min.js"></script>
    +

    Not feeling the .js solution? Try the Less Mac app or use Node.js to compile when you deploy your code.

    + +

    What’s included

    +

    Here are some of the highlights of what’s included in Twitter Bootstrap as part of Bootstrap. Head over to the Bootstrap website or Github project page to download and learn more.

    +

    Variables

    +

    Variables in Less are perfect for maintaining and updating your CSS headache free. When you want to change a color value or a frequently used value, update it in one spot and you’re set.

    +
    +// Links
    +@linkColor:         #8b59c2;
    +@linkColorHover:    darken(@linkColor, 10);
    +
    +// Grays
    +@black:             #000;
    +@grayDark:          lighten(@black, 25%);
    +@gray:              lighten(@black, 50%);
    +@grayLight:         lighten(@black, 70%);
    +@grayLighter:       lighten(@black, 90%);
    +@white:             #fff;
    +
    +// Accent Colors
    +@blue:              #08b5fb;
    +@green:             #46a546;
    +@red:               #9d261d;
    +@yellow:            #ffc40d;
    +@orange:            #f89406;
    +@pink:              #c3325f;
    +@purple:            #7a43b6;
    +
    +// Baseline grid
    +@basefont:          13px;
    +@baseline:          18px;
    +
    + +

    Commenting

    +

    Less also provides another style of commenting in addition to CSS’s normal /* ... */ syntax.

    +
    +// This is a comment
    +/* This is also a comment */
    +
    + +

    Mixins up the wazoo

    +

    Mixins are basically includes or partials for CSS, allowing you to combine a block of code into one. They’re great for vendor prefixed properties like box-shadow, cross-browser gradients, font stacks, and more. Below is a sample of the mixins that are included with Bootstrap.

    +

    Font stacks

    +
    +#font {
    +  .shorthand(@weight: normal, @size: 14px, @lineHeight: 20px) {
    +    font-size: @size;
    +    font-weight: @weight;
    +    line-height: @lineHeight;
    +  }
    +  .sans-serif(@weight: normal, @size: 14px, @lineHeight: 20px) {
    +    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    +    font-size: @size;
    +    font-weight: @weight;
    +    line-height: @lineHeight;
    +  }
    +  ...
    +}
    +
    +

    Gradients

    +
    +#gradient {
    +  ...
    +  .vertical (@startColor: #555, @endColor: #333) {
    +    background-color: @endColor;
    +    background-repeat: repeat-x;
    +    background-image: -khtml-gradient(linear, left top, left bottom, from(@startColor), to(@endColor)); // Konqueror
    +    background-image: -moz-linear-gradient(@startColor, @endColor); // FF 3.6+
    +    background-image: -ms-linear-gradient(@startColor, @endColor); // IE10
    +    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @startColor), color-stop(100%, @endColor)); // Safari 4+, Chrome 2+
    +    background-image: -webkit-linear-gradient(@startColor, @endColor); // Safari 5.1+, Chrome 10+
    +    background-image: -o-linear-gradient(@startColor, @endColor); // Opera 11.10
    +    background-image: linear-gradient(@startColor, @endColor); // The standard
    +  }
    +  ...
    +}
    +
    + +

    Operations

    +

    Get fancy and perform some math to generate flexible and powerful mixins like the one below.

    +
    +// Griditude
    +@gridColumns:       16;
    +@gridColumnWidth:   40px;
    +@gridGutterWidth:   20px;
    +@siteWidth:         (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
    +
    +// Make some columns
    +.columns(@columnSpan: 1) {
    +  width: (@gridColumnWidth * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1));
    +}
    +
    + +

    Compiling Less

    +

    After modifying the .less files in /lib/, you'll need to recompile them in order to regenerate the bootstrap-*.*.*.css and bootstrap-*.*.*.min.css files. If you're submitting a pull request to GitHub, you must always recompile.

    +

    Ways to compile

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    MethodSteps
    Node with makefile +

    Install the LESS command line compiler with npm by running the following command:

    +
    $ npm install less
    +

    Once installed just run make from the root of your bootstrap directory and you're all set.

    +

    Additionally, if you have watchr installed, you may run make watch to have bootstrap automatically rebuilt every time you edit a file in the bootstrap lib (this isn't required, just a convenience method).

    +
    Javascript +

    Download the latest Less.js and include the path to it (and Bootstrap) in the <head>.

    +
    +<link rel="stylesheet/less" href="/path/to/bootstrap.less">
    +<script src="/path/to/less.js"></script>
    +
    +

    To recompile the .less files, just save them and reload your page. Less.js compiles them and stores them in local storage.

    +
    Command line +

    Install the LESS command line tool via Node and run the following command:

    +
    $ lessc ./lib/bootstrap.less > bootstrap.css
    +

    Be sure to include --compress in that command if you're trying to save some bytes!

    +
    Unofficial Mac app +

    The unofficial Mac app watches directories of .less files and compiles the code to local files after every save of a watched .less file.

    +

    If you like, you can toggle preferences in the app for automatic minifying and which directory the compiled files end up in.

    +
    CrunchCrunch is a great looking LESS editor and compiler built on Adobe Air.
    CodeKitCreated by the same guy as the unofficial Mac app, CodeKit is a Mac app that compiles LESS, SASS, Stylus, and CoffeeScript.
    SimplessMac, Linux, and PC app for drag and drop compiling of LESS files. Plus, the source code is on GitHub.
    +
    +
    + +
    \ No newline at end of file diff --git a/docs/templates/pages/scaffolding.mustache b/docs/templates/pages/scaffolding.mustache new file mode 100644 index 0000000000..567ac6d0d4 --- /dev/null +++ b/docs/templates/pages/scaffolding.mustache @@ -0,0 +1,311 @@ + + +
    +

    Scaffolding

    +

    Bootstrap is built on a responsive 12-column grid. We've also included fixed- and fluid-width layouts based on that system.

    +
    + + + + +
    + + +

    Default 940px grid

    +
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    1
    +
    +
    +
    4
    +
    4
    +
    4
    +
    +
    +
    4
    +
    8
    +
    +
    +
    6
    +
    6
    +
    +
    +
    12
    +
    + +
    +
    +

    The default grid system provided as part of Bootstrap is a 940px-wide, 12-column grid.

    +

    It also has three responsive variations for various devices and resolutions: phone, tablet, and large widescreen desktops.

    +
    +
    +
    +<div class="row">
    +  <div class="span4">...</div>
    +  <div class="span8">...</div>
    +</div>
    +
    +
    +
    +

    As shown here, a basic layout can be created with two "columns," each spanning a number of the 12 foundational columns we defined as part of our grid system.

    +
    +
    + +

    Offsetting columns

    +
    +
    4
    +
    4 offset 4
    +
    +
    +
    3 offset 3
    +
    3 offset 3
    +
    +
    +
    8 offset 4
    +
    + +
    + +

    Nesting columns

    +
    +
    +

    With the static (non-fluid) grid system in Bootstrap, nesting is easy. To nest your content, just add a new .row and set of .span* columns within an existing .span* column.

    +

    Example

    +
    +
    + Level 1 of column +
    +
    + Level 2 +
    +
    + Level 2 +
    +
    +
    +
    +
    +
    +
    +<div class="row">
    +  <div class="span12">
    +    Level 1 of column
    +    <div class="row">
    +      <div class="span6">Level 2</div>
    +      <div class="span6">Level 2</div>
    +    </div>
    +  </div>
    +</div>
    +
    +
    +
    + +

    Grid customization

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    VariableDefault valueDescription
    @gridColumns12Number of columns
    @gridColumnWidth60pxWidth of each column
    @gridGutterWidth20pxNegative space between columns
    @siteWidthComputed sum of all columns and guttersCounts number of columns and gutters to set width of the .fixed-container() mixin
    +
    +
    +

    Variables in LESS

    +

    Built into Bootstrap are a handful of variables for customizing the default 940px grid system, documented above. All variables for the grid are stored in variables.less.

    +
    +
    +

    How to customize

    +

    Modifying the grid means changing the three @grid* variables and recompiling Bootstrap. Change the grids in the preboot.less file and use one of the four ways documented to recompile.

    +
    +
    +

    Staying responsive

    +

    Customization of the grid only works at the default level, the 940px grid. To maintain the responsive aspects of Bootstrap, you'll also have to customize the grids in responsive.less.

    +
    +
    + +
    + + + + +
    + + +
    +
    +

    Fixed layout

    +

    The default and simple 940px-wide, centered layout for just about any website or page provided by a single <div class="container">.

    +
    +
    +
    +
    +<body>
    +  <div class="container">
    +    ...
    +  </div>
    +</body>
    +
    +
    +
    +

    Fluid layout

    +

    <div class="fluid-container"> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.

    +
    +
    +
    +
    +
    +<body>
    +  <div class="fluid-container sidebar-left">
    +    <div class="fluid-sidebar">
    +      ...
    +    </div>
    +    <div class="fluid-content">
    +      ...
    +    </div>
    +  </div>
    +</body>
    +
    +
    +
    +
    + + + + + +
    + + +
    +
    + Responsive devices +
    +
    +

    Supported devices

    +

    Bootstrap supports a handful of media queries to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LabelLayout widthColumn widthGutter width
    Smartphones480px and belowFluid columns, no fixed widths
    Portrait tablets480px to 768pxFluid columns, no fixed widths
    Landscape tablets768px to 940px44px20px
    Default940px and up60px20px
    Large display1210px and up70px30px
    + +

    What they do

    +

    Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.

    +
      +
    • Modify the width of column in our grid
    • +
    • Stack elements instead of float wherever necessary
    • +
    • Resize headings and text to be more appropriate for devices
    • +
    +
    +
    + +
    + + +

    Using the media queries

    +
    +
    +

    Bootstrap doesn't automatically include these media queries, but understanding and adding them is very easy and requires minimal setup. You have a few options for including the responsive features of Bootstrap:

    +
      +
    1. Use the compiled responsive version, bootstrap.reponsive.css
    2. +
    3. Add @import "responsive.less" and recompile Bootstrap
    4. +
    5. Compile responsive.less as a separate file and include that
    6. +
    +

    Why not just include it? Truth be told, not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it.

    +
    +
    +
    +  // Landscape phones and down
    +  @media (max-width: 480px) { ... }
    +
    +  // Landscape phone to portrait tablet
    +  @media (min-width: 480px) and (max-width: 768px) { ... }
    +
    +  // Portrait tablet to landscape and desktop
    +  @media (min-width: 768px) and (max-width: 940px) { ... }
    +
    +  // Large desktop
    +  @media (min-width: 1210px) { .. }
    +
    +
    +
    +
    \ No newline at end of file diff --git a/docs/templates/pages/upgrading.mustache b/docs/templates/pages/upgrading.mustache new file mode 100644 index 0000000000..a243d6ad5d --- /dev/null +++ b/docs/templates/pages/upgrading.mustache @@ -0,0 +1,86 @@ + +
    +

    Upgrading to Bootstrap 2

    +

    Learn about significant changes and additions since v1.4 with this handy guide.

    +
    + + +

    Rough outline

    + + + \ No newline at end of file diff --git a/docs/upgrading.html b/docs/upgrading.html index 42521bb9a8..7e43408ac7 100644 --- a/docs/upgrading.html +++ b/docs/upgrading.html @@ -2,12 +2,12 @@ - Bootstrap, from Twitter: Upgrading from v1.4 to v2.0 + Bootstrap, from Twitter - + @@ -18,10 +18,11 @@ - - - - + + + + + @@ -33,8 +34,8 @@
    Bootstrap -
  • Icons by Glyphicons
  • -
  • Progress bars
  • -
  • Typeahead
  • -
  • +
  • Using LESS @@ -107,12 +108,12 @@
    - -
    -

    Upgrading to Bootstrap 2

    -

    Learn about significant changes and additions since v1.4 with this handy guide.

    -
    + +
    +

    Upgrading to Bootstrap 2

    +

    Learn about significant changes and additions since v1.4 with this handy guide.

    +

    Rough outline

    @@ -193,8 +194,6 @@
  • --> - - +
    + - - - + + + + + + - + + + + + + + + +