mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
4.1 KiB
4.1 KiB
Contributing to Bootstrap
Looking to contribute something to Bootstrap? Here's how you can help.
Reporting issues
We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Bootstrap core. Please read the following guidelines before opening any issue.
- Search for existing issues. We get a lot of duplicate issues, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available.
- Create an isolated and reproducible test case. Be sure the problem exists in Bootstrap's code with a reduced test case that should be included in each bug report.
- Include a live example. Make use of jsFiddle or jsBin to share your isolated test cases.
- Share as much information as possible. Include operating system and version, browser and version, version of Bootstrap, customized or vanilla build, etc. where appropriate. Also include steps to reproduce the bug.
Pull requests
- CSS changes must be done in
.less
files first, never just in the compiled.css
files - If modifying the
.less
files, always recompile and commit the compiled filesbootstrap.css
andbootstrap.min.css
- Try not to pollute your pull request with unintended changes--keep them simple and small
- Try to share which browsers your code has been tested in before submitting a pull request
- Pull requests should always be against the
master
branch, never againstgh-pages
.
Coding standards
HTML
- Two spaces for indentation, never tabs
- Double quotes only, never single quotes
- Always use proper indentation
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags)
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via
file://
.
CSS
- Adhere to the CSS property order
- Multiple-line approach (one property and value per line)
- Always a space after a property's colon (e.g.,
display: block;
and notdisplay:block;
) - End all lines with a semi-colon
- For multiple, comma-separated selectors, place each selector on its own line
- Attribute selectors, like
input[type="text"]
should always wrap the attribute's value in double quotes, for consistency and safety (see this blog post on unquoted attribute values that can lead to XSS attacks). - Attribute selectors should only be used where absolutely necessary (e.g., form controls) and should be avoided on custom components for performance and explicitness.
- Series of classes for a component should include a base class (e.g.,
.component
) and use the base class as a prefix for modifier and sub-components (e.g.,.component-lg
). - Avoid inheritance and over nesting—use single, explicit classes whenever possible.
JS
- No semicolons
- Comma first
- 2 spaces (no tabs)
- strict mode
- "Attractive"
License
Prior to v3.1.0, Bootstrap was released under the Apache License v2.0. As of v3.1.0, Bootstrap is now licensed under the MIT license. By contributing your code, you agree to license your contribution under the MIT license.
Release checklist
- Close ship list issue for the release.
- Close the milestone for the release.
- Open new release issue that includes this checklist.
- Ping folks to coordinate release (mainly @jdorfman for BootstrapCDN).
- Update version numbers using
grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
. Review the changes and stage them manually. - Run
grunt
one last time. - Push to
master
branch. - Merge
master
intogh-pages
. - Generate
bootstrap-X.Y.Z-dist.zip
file for release. - Create release on GitHub with
/dist/
folder and release notes. - Push
gh-pages
. - Publish blog post.
- Tweet tweet.