The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
Go to file
Patrick H. Lauke 6d64afe508 Replace dropdown backdrop hack with cleaner JS-only hack
* Replace backdrop with simple noop mouse listener

As discussed in https://github.com/twbs/bootstrap/pull/22422 the current
approach of injecting a backdrop (to work around iOS' broken event
delegation for the `click` event) has annoying consequences on
touch-enabled laptop/desktop devices.
Instead of a backdrop `<div>`, here we simply add extra empty/noop
mouse listeners to the immediate children of `<body>` (and remove
them when the dropdown is closed) in order to force iOS to properly
bubble a `click` resulting from a tap (essentially, method 2 from
https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html)
This is sufficient (except in rare cases where the user does manage to tap
on the body itself, rather than any child elements of body - which is not
very likely in an iOS phone/tablet scenario for most layouts) to get iOS to
get a grip and do the correct event bubbling/delegation, meaning the regular
"click" event will bubble back to the `<body>` when tapping outside of the dropdown,
and the dropdown will close properly (just like it already does, even without
this fix, in non-iOS touchscreen devices/browsers, like Chrome/Android and
Windows on a touch laptop).
This approach, though a bit hacky, has no impact on the DOM structure, and
has no unforeseen side effects on touch-enabled laptops/desktops. And crucially,
it works just fine in iOS.

* Remove dropdown backdrop styles

* Update doc for dropdowns and touch-enabled devices
2017-04-14 09:19:00 +01:00
dist grunt 2017-04-08 22:05:50 -07:00
docs Replace dropdown backdrop hack with cleaner JS-only hack 2017-04-14 09:19:00 +01:00
grunt don't test ie9 on win7 anymore (#22294) 2017-03-28 13:36:11 -07:00
js Replace dropdown backdrop hack with cleaner JS-only hack 2017-04-14 09:19:00 +01:00
nuget Update nuspec to support jquery v1.9.1 - v3.x 2017-01-05 14:25:31 -08:00
scss Replace dropdown backdrop hack with cleaner JS-only hack 2017-04-14 09:19:00 +01:00
.babelrc More config tweaks. 2017-03-21 21:37:33 +11:00
.editorconfig Update README.md. 2015-07-26 00:29:29 +03:00
.eslintignore Fix Hound warnings for minified files. (#20446) 2016-10-05 20:12:24 -07:00
.gitattributes Remove dropped v3 bootstrap-theme 2015-09-08 08:58:03 +03:00
.gitignore .gitignore: Remove no longer used entries. 2016-07-12 22:55:50 +03:00
.hound.yml Update config files across the board. 2017-03-12 16:15:00 +11:00
.houndignore Disable Hound on test cases. 2016-12-25 20:23:22 +11:00
.travis.yml Update config files across the board. 2017-03-12 16:15:00 +11:00
CHANGELOG.md Fix broken/redirected links, moving to HTTPS where possible. (#20557) 2016-10-03 09:55:59 -07:00
CNAME custom cname for v4 alpha 2015-08-18 22:47:18 -07:00
CONTRIBUTING.md normalize is no longer part of BS 2017-02-25 16:14:27 +11:00
Gemfile Update dependencies. 2017-03-12 14:41:41 +11:00
Gemfile.lock Update dependencies. 2017-03-12 14:41:41 +11:00
Gruntfile.js More config tweaks. 2017-03-21 21:37:33 +11:00
ISSUE_TEMPLATE.md Fix broken/redirected links, moving to HTTPS where possible. (#20557) 2016-10-03 09:55:59 -07:00
LICENSE Update copyright years to 2017 2017-01-01 12:56:11 +11:00
README.md one more 2017-03-20 13:25:10 -07:00
_config.yml bump to jquery 3.2.1 2017-03-20 23:27:54 -07:00
bower.json Package grunt (#22396) 2017-04-10 21:12:24 -07:00
composer.json Fix broken/redirected links, moving to HTTPS where possible. (#20557) 2016-10-03 09:55:59 -07:00
package.js version bump 2017-01-06 08:38:04 -08:00
package.json Package grunt (#22396) 2017-04-10 21:12:24 -07:00
sache.json Add sache.json 2014-12-15 11:06:10 -08:00

README.md

Bootstrap

Sleek, intuitive, and powerful front-end framework for faster and easier web development.
Visit Bootstrap »


Table of contents

Quick start

Several quick start options are available:

  • Download the latest release.
  • Clone the repo: git clone https://github.com/twbs/bootstrap.git
  • Install with npm: npm install bootstrap@4.0.0-alpha.6
  • Install with yarn: yarn add bootstrap@4.0.0-alpha.6
  • Install with Composer: composer require twbs/bootstrap:4.0.0-alpha.6
  • Install with Bower: bower install bootstrap#v4.0.0-alpha.6
  • Install with NuGet: CSS: Install-Package bootstrap -Pre Sass: Install-Package bootstrap.sass -Pre (-Pre is only required until Bootstrap v4 has a stable release).

Read the Getting started page for information on the framework contents, templates and examples, and more.

Status

Slack Bower version npm version Gem version Build Status devDependency Status Meteor Atmosphere Packagist Prerelease NuGet

Selenium Test Status

What's included

Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:

bootstrap/
├── css/
│   ├── bootstrap.css
│   ├── bootstrap.css.map
│   ├── bootstrap.min.css
│   └── bootstrap.min.css.map
└── js/
    ├── bootstrap.js
    └── bootstrap.min.js

We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). CSS source maps (bootstrap.*.map) are available for use with certain browsers' developer tools.

Bugs and feature requests

Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Documentation

Bootstrap's documentation, included in this repo in the root directory, is built with Jekyll and publicly hosted on GitHub Pages at https://getbootstrap.com. The docs may also be run locally.

Running documentation locally

  1. Run through the tooling setup to install Jekyll (the site builder) and other Ruby dependencies with bundle install.
  2. Run grunt (or a specific set of Grunt tasks) to rebuild distributed CSS and JavaScript files, as well as our docs assets.
  3. From the root /bootstrap directory, run bundle exec jekyll serve in the command line.
  4. Open http://localhost:9001 in your browser, and voilà.

Learn more about using Jekyll by reading its documentation.

Documentation for previous releases

Documentation for v2.3.2 has been made available for the time being at https://getbootstrap.com/2.3.2/ while folks transition to Bootstrap 3.

Previous releases and their documentation are also available for download.

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

Moreover, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the Code Guide, maintained by Mark Otto.

Editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at http://editorconfig.org.

Community

Get updates on Bootstrap's development and chat with the project maintainers and community members.

  • Follow @getbootstrap on Twitter.
  • Read and subscribe to The Official Bootstrap Blog.
  • Join the official Slack room.
  • Chat with fellow Bootstrappers in IRC. On the irc.freenode.net server, in the ##bootstrap channel.
  • Implementation help may be found at Stack Overflow (tagged bootstrap-4).
  • Developers should use the keyword bootstrap on packages which modify or add to the functionality of Bootstrap when distributing through npm or similar delivery mechanisms for maximum discoverability.

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we'll adhere to those rules whenever possible.

See the Releases section of our GitHub project for changelogs for each release version of Bootstrap. Release announcement posts on the official Bootstrap blog contain summaries of the most noteworthy changes made in each release.

Creators

Mark Otto

Jacob Thornton

Code and documentation copyright 2011-2017 the Bootstrap Authors and Twitter, Inc. Code released under the MIT License. Docs released under Creative Commons.