|
| 1 | +# Contributing to Font Awesome |
| 2 | + |
| 3 | +Looking to contribute something to Font Awesome? **Here's how you can help.** |
| 4 | + |
| 5 | +## Reporting issues |
| 6 | + |
| 7 | +We only accept issues that are icon requests, bug reports, or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Font Awesome core. Please read the following guidelines to ensure you are the paragon of bug reporting. |
| 8 | + |
| 9 | +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. |
| 10 | +2. **Create an isolated and reproducible test case.** Be sure the problem exists in Font Awesome's code with a [reduced test case](http://css-tricks.com/reduced-test-cases/) that should be included in each bug report. |
| 11 | +3. **Include a live example.** Make use of jsFiddle, jsBin, or Codepen to share your isolated test cases. |
| 12 | +4. **Share as much information as possible.** Include operating system and version, browser and version, version of Font Awesome, etc. where appropriate. Also include steps to reproduce the bug. |
| 13 | + |
| 14 | +## Key branches |
| 15 | + |
| 16 | +- `master` is the latest, deployed version (not to be used for pull requests) |
| 17 | +- `gh-pages` is the hosted docs (not to be used for pull requests) |
| 18 | +- `*-wip` branches are the official work in progress branches for the next releases. All pull requests should be submitted against the appropriate branch |
| 19 | + |
| 20 | +## Notes on the repo |
| 21 | + |
| 22 | +As of v3.2.0, Font Awesome's CSS, LESS, SCSS, and documentation are all powered by Jekyll templates and built before each commit and release. |
| 23 | + |
| 24 | +- `_config.yml` - much of the site is driven off variables from this file, including Font Awesome and Bootstrap versions |
| 25 | +- `src/` - All edits to documentation, LESS, SCSS, and CSS should be made to files and templates in this directory |
| 26 | +- `src/icons.yml` - all LESS, SCSS, and CSS icon definitions are driven off this single file |
| 27 | + |
| 28 | +## Pull requests |
| 29 | + |
| 30 | +- Submit all pull requests against the appropriate `*-wip` branch for easier merging |
| 31 | +- Any changes to the docs must be made to the Liquid templates in the `src` directory |
| 32 | +- CSS changes must be done in .less and .scss files first, never the compiled files |
| 33 | +- If modifying the .less and .scss files, always recompile and commit the compiled files |
| 34 | +- Try not to pollute your pull request with unintended changes--keep them simple and small |
| 35 | +- Try to share which browsers your code has been tested in before submitting a pull request |
| 36 | + |
| 37 | +## Style Guides |
| 38 | + |
| 39 | +### Git Commit Messages |
| 40 | + |
| 41 | +This section shows you how to write commit messages. Follow these guidelines to help us maintain order and make it easier to locate your changes. |
| 42 | + |
| 43 | +Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject: |
| 44 | + |
| 45 | +``` |
| 46 | +<type>(<scope>): <subject> |
| 47 | +``` |
| 48 | + |
| 49 | +The header is mandatory and the scope of the header is optional. |
| 50 | + |
| 51 | +> This repository follows the "[Conventional Commits](https://www.conventionalcommits.org/)" specification. |
| 52 | +
|
| 53 | +### Coding standards: HTML |
| 54 | + |
| 55 | +- Two spaces for indentation, never tabs |
| 56 | +- Double quotes only, never single quotes |
| 57 | +- Always use proper indentation |
| 58 | +- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags) |
| 59 | + |
| 60 | +### Coding standards: CSS |
| 61 | + |
| 62 | +- Adhere to the [Recess CSS property order](http://markdotto.com/2011/11/29/css-property-order/) |
| 63 | +- Multiple-line approach (one property and value per line) |
| 64 | +- Always a space after a property's colon (.e.g, `display: block;` and not `display:block;`) |
| 65 | +- End all lines with a semi-colon |
| 66 | +- For multiple, comma-separated selectors, place each selector on it's own line |
| 67 | +- 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) |
| 68 | + |
| 69 | +## Release process |
| 70 | + |
| 71 | +To publish a new version, follow these steps: |
| 72 | + |
| 73 | +```bash |
| 74 | +# Confirm you are logged in on Github and NPM |
| 75 | +ssh -T git@github.com |
| 76 | +yarn login |
| 77 | + |
| 78 | +# Checkout the latest code |
| 79 | +git checkout master |
| 80 | + |
| 81 | +# Update the CHANGELOG. With the `--interactive` flag, `changelog-generator` |
| 82 | +# will propose a semantic version. If you wish to manually set the version, |
| 83 | +# see `--help` for options. |
| 84 | +npx @liferay/changelog-generator --interactive |
| 85 | + |
| 86 | +# Confirm a staged CHANGELOG.md file. Review it and update if needed. |
| 87 | + |
| 88 | +# Update version. The version was determined in the last step. |
| 89 | +yarn version --new-version $VERSION |
| 90 | + |
| 91 | +# Confirm a tagged commit was created. It should contain CHANGELOG.md and the |
| 92 | +# version increase in package.json. |
| 93 | + |
| 94 | +# Change commit message |
| 95 | +git commit --amend -m "chore: prepare v$VERSION release" |
| 96 | + |
| 97 | +# Push to Git |
| 98 | +git push --follow-tags |
| 99 | + |
| 100 | +# Publish to NPM |
| 101 | +yarn publish |
| 102 | +``` |
| 103 | + |
| 104 | +## License |
| 105 | + |
| 106 | +By contributing your code, you agree to license your contribution under the terms of the MIT License: |
| 107 | + |
| 108 | +- http://opensource.org/licenses/mit-license.html |
| 109 | + |
| 110 | +## Thanks |
| 111 | + |
| 112 | +Thanks to Bootstrap for their wonderful CONTRIBUTING.MD doc. It was modified to create this one. |
0 commit comments