CONTRIBUTING.md 4.08 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
2
# Contributing to Bootstrap

3
Looking to contribute something to Bootstrap? **Here's how you can help.**
Chris Aniszczyk's avatar
Chris Aniszczyk committed
4
5


6
7
8
9
10
11

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

1. **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.
12
2. **Create an isolated and reproducible test case.** Be sure the problem exists in Bootstrap's code with a [reduced test case](http://css-tricks.com/reduced-test-cases/) that should be included in each bug report.
13
14
15
16
17
18
19
3. **Include a live example.** Make use of jsFiddle or jsBin to share your isolated test cases.
4. **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

Zlatan Vasović's avatar
Zlatan Vasović committed
20
- CSS changes must be done in `.less` files first, never just in the compiled `.css` files
21
- If modifying the `.less` files, always recompile and commit the compiled files `bootstrap.css` and `bootstrap.min.css`
Chris Aniszczyk's avatar
Chris Aniszczyk committed
22
23
- 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
24
- Pull requests should always be against the `master` branch, never against `gh-pages`.
Chris Aniszczyk's avatar
Chris Aniszczyk committed
25

26
27


Mark Otto's avatar
Mark Otto committed
28
29
30
## Coding standards

### HTML
31

Chris Aniszczyk's avatar
Chris Aniszczyk committed
32
33
34
35
- 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)
36
- 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://`.
Chris Aniszczyk's avatar
Chris Aniszczyk committed
37

Mark Otto's avatar
Mark Otto committed
38
### CSS
39

40
- Adhere to the [CSS property order](http://markdotto.com/2011/11/29/css-property-order/)
Chris Aniszczyk's avatar
Chris Aniszczyk committed
41
- Multiple-line approach (one property and value per line)
Chris Rebert's avatar
Chris Rebert committed
42
- Always a space after a property's colon (e.g., `display: block;` and not `display:block;`)
Chris Aniszczyk's avatar
Chris Aniszczyk committed
43
- End all lines with a semi-colon
Andy Trevorah's avatar
Andy Trevorah committed
44
- For multiple, comma-separated selectors, place each selector on its own line
Chris Aniszczyk's avatar
Chris Aniszczyk committed
45
- 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](http://mathiasbynens.be/notes/unquoted-attribute-values) that can lead to XSS attacks).
46
47
48
- 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.
Chris Aniszczyk's avatar
Chris Aniszczyk committed
49

Mark Otto's avatar
Mark Otto committed
50
### JS
fat's avatar
fat committed
51
52
53
54
55
56
57
58
59

- No semicolons
- Comma first
- 2 spaces (no tabs)
- strict mode
- "Attractive"



60
61
## License

Chris Rebert's avatar
Chris Rebert committed
62
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](https://github.com/twbs/bootstrap/blob/master/LICENSE). By contributing your code, you agree to license your contribution under the [MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE).
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80



## Release checklist

1. Close ship list issue for the release.
2. Close the milestone for the release.
3. Open new release issue that includes this checklist.
4. Ping folks to coordinate release (mainly @jdorfman for BootstrapCDN).
5. Update version numbers using `grunt change-version-number --oldver=A.B.C --newver=X.Y.Z`. Review the changes and stage them manually.
6. Run `grunt` one last time.
7. Push to `master` branch.
8. Merge `master` into `gh-pages`.
9. Generate `bootstrap-X.Y.Z-dist.zip` file for release.
10. Create release on GitHub with `/dist/` folder and release notes.
11. Push `gh-pages`.
12. Publish blog post.
13. Tweet tweet.