11# Contributing to sanitize.css
22
3- Please take a moment to review this document in order to make the contribution
4- process easy and effective for everyone involved.
3+ Please review this document in order to make the contribution process easy and
4+ effective for everyone involved.
55
66Following these guidelines helps to communicate that you respect the time of
7- the developers managing and developing this open source project. In return,
8- they should reciprocate that respect in addressing your issue or assessing
9- patches and features.
10-
7+ the developers managing and developing this project. In return, we will
8+ reciprocate that respect in addressing your issues, patches, and features.
119
1210## Using the issue tracker
1311
14- The issue tracker is the preferred channel for [ bug reports] ( #bugs ) ,
15- [ features requests] ( #features ) and [ submitting pull
12+ The issue tracker is the preferred channel for [ bug reports] ( #bug-reports ) ,
13+ [ feature requests] ( #feature-requests ) and [ pull
1614requests] ( #pull-requests ) , but please respect the following restrictions:
1715
1816* Please ** do not** use the issue tracker for personal support requests.
19-
2017* Please ** do not** derail or troll issues. Keep the discussion on topic and
2118 respect the opinions of others.
2219
23-
2420## Bug reports
2521
26- A bug is a _ demonstrable problem_ that is caused by the code in the repository.
27- Good bug reports are extremely helpful - thank you!
28-
29- Guidelines for bug reports:
22+ A bug is a _ demonstrable problem_ caused by the code in this repository.
3023
31- 1 . ** Use the GitHub issue search** – check if the issue has already been
32- reported.
24+ 1 . ** Use the GitHub issue search** to see if the issue has
25+ [ already been reported] .
3326
34- 2 . ** Check if the issue has been fixed** – try to reproduce it using the
35- latest `master` branch in the repository.
27+ 2 . ** Check if the issue has been fixed** by trying to reproduce it using the
28+ latest ` master ` branch in the repository.
3629
37- 3 . ** Isolate the problem** – create a live example (e.g., on
38- [Codepen](http://codepen.io)) of a [reduced test
39- case](http://css-tricks.com/6263-reduced-test-cases/).
30+ 3 . ** Isolate the problem** to create a [ live example] of a [ reduced test case] .
4031
4132A good bug report shouldn't leave others needing to chase you up for more
42- information. Please try to be as detailed as possible in your report. What is
43- your environment? What steps will reproduce the issue? What browser(s) and OS
33+ information. Please be as detailed as possible in your report. What is your
34+ environment? What steps will reproduce the issue? What browser(s) and OS
4435experience the problem? What would you expect to be the outcome? All these
4536details will help people to fix any potential bugs.
4637
@@ -62,15 +53,13 @@ Example:
6253> causing the bug, and potential solutions (and your opinions on their
6354> merits).
6455
65-
6656## Feature requests
6757
68- Feature requests are welcome. But take a moment to find out whether your idea
69- fits with the scope and aims of the project. It's up to * you* to make a strong
70- case to convince the project's developers of the merits of this feature. Please
58+ Feature requests are welcome. Take a moment to find out whether your idea fits
59+ with the scope and aims of the project. It's up to * you* to make a strong case
60+ to convince the project's developers of the merits of this feature. Please
7161provide as much detail and context as possible.
7262
73-
7463## Pull requests
7564
7665Good pull requests - patches, improvements, new features - are a fantastic
@@ -87,83 +76,70 @@ accurate comments, etc.) and any other requirements (such as test coverage).
8776Follow this process if you'd like your work considered for inclusion in the
8877project:
8978
90- 1 . [ Fork] ( https://help.github.com/articles/fork-a-repo/ ) the project, clone your
91- fork, and configure the remotes:
92-
93- ```bash
94- # Clone your fork of the repo into the current directory
95- git clone https://github.com/<your-username>/sanitize.css
96- # Navigate to the newly cloned directory
97- cd sanitize.css
98- # Assign the original repo to a remote called "upstream"
99- git remote add upstream https://github.com/jonathantneal/sanitize.css
100- ```
101-
102- 2 . If you cloned a while ago, get the latest changes from upstream:
103-
104- ```bash
105- git checkout master
106- git pull upstream master
107- ```
108-
109- 3 . Never work directly on ` master ` . Create a new topic branch (off the latest
110- version of `master`) to contain your feature, change, or fix:
111-
112- ```bash
113- git checkout -b <topic-branch-name>
114- ```
115-
116- 4 . Commit your changes in logical chunks. Please adhere to these [ git commit
117- message conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
118- or your code is unlikely be merged into the main project. Use Git's
119- [interactive rebase](https://help.github.com/articles/interactive-rebase)
120- feature to tidy up your commits before making them public.
121-
122- Be sure to test the `sanitize.css` file for style conformance.
123-
124- ```bash
125- npm test
126- ```
127-
128- Be sure to add a test to the `test.html` file if appropriate, and test
129- your change in all supported browsers.
130-
131- 5 . Locally rebase the upstream development branch into your topic branch:
132-
133- ```bash
134- git pull --rebase upstream master
135- ```
136-
137- 6 . Push your topic branch up to your fork:
138-
139- ```bash
140- git push origin <topic-branch-name>
141- ```
142-
143- 10 . [ Open a Pull Request] ( https://help.github.com/articles/using-pull-requests/ )
144- with a clear title and description.
145-
146- ** IMPORTANT** : By submitting a patch, you agree to allow the project owner to
147- license your work under the same license as that used by the project.
79+ 1 . To begin: [ fork this project] , clone your fork, and add our upstream.
80+ ``` bash
81+ # Clone your fork of the repo into the current directory
82+ git clone
[email protected] :YOUR_USER/sanitize.css.git
83+
84+ # Navigate to the newly cloned directory
85+ cd sanitize.css
86+
87+ # Assign the original repo to a remote called "upstream"
88+ git remote add upstream
[email protected] :csstools/sanitize.css.git
89+
90+ # Install the tools necessary for testing
91+ npm install
92+ ```
93+
94+ 2 . Create a branch for your feature or fix:
95+ ``` bash
96+ # Move into a new branch for your feature
97+ git checkout -b feature/thing
98+ ```
99+ ``` bash
100+ # Move into a new branch for your fix
101+ git checkout -b fix/something
102+ ```
103+
104+ 3 . If your code follows our practices, then push your feature branch:
105+ ``` bash
106+ # Test current code
107+ npm test
108+ ```
109+ ``` bash
110+ # Push the branch for your new feature
111+ git push origin feature/thing
112+ ```
113+ ``` bash
114+ # Or, push the branch for your update
115+ git push origin update/something
116+ ```
117+
118+ Be sure to add a test to the ` test.html ` file if appropriate, and test
119+ your change in all supported browsers.
120+
121+
122+ Now [ open a pull request] with a clear title and description. Remember,
123+ by submitting a patch, you agree to allow the project owner to license your
124+ work under the same license as that used by the project.
148125
149126### CSS Conventions
150127
151128Keep the CSS file as readable as possible by following these guidelines:
152129
153130- Comments are short and to the point.
154131- Comments without a number reference the entire rule.
155- - Comments only describe the selector when the selector does not make the
132+ - Comments describe the selector when the selector does not make the
156133 normalization obvious.
157134- Comments begin with “Correct the...” when they deal with less obvious side
158135 effects.
159- - Rules are sorted by cascade, specificity, and then alphabetic order.
160- - Selectors are sorted by specificity and then alphabetic order.
136+ - Rules are sorted by section, cascade, specificity, and then alphabetic order.
137+ - Selectors are sorted by low-to-high specificity and then alphabetic order.
161138- ` in browser ` applies to all versions.
162- - ` in browser v- ` applies to all versions up to and including the version.
163139- ` in browser v+ ` applies to all versions after and including the version.
140+ - ` in browser v- ` applies to all versions up to and including the version.
164141- ` in browser v-v ` applies to all versions including and between the versions.
165142
166-
167143## Maintainers
168144
169145If you have commit access, please follow this process for merging patches and
@@ -173,29 +149,40 @@ cutting new releases.
173149
1741501 . Check that a patch is within the scope and philosophy of the project.
1751512 . Check that a patch has any necessary tests and a proper, descriptive commit
176- message.
152+ message.
1771533 . Test the patch locally.
1781544 . Use GitHub’s merge button with caution or apply the patch locally, squashing
179155 any commits.
180156
181157### Releasing a new version
182158
183- 1 . Include all new functional changes in the CHANGELOG.
184- 2 . Use a dedicated commit to increment the version. The version needs to be
185- added to the CHANGELOG (inc. date), the `package.json`, and `sanitize.css `
186- files.
187- 3 . The commit message must be of ` v0.0.0 ` format.
188- 4 . Create an annotated tag for the version: ` git tag -m "v0.0.0" 0.0.0 ` .
189- 5 . Push the changes and tags to GitHub: ` git push --tags origin master `
190- 6 . Checkout the ` gh-pages ` branch and follow the instructions in the README .
159+ 1 . Include all new functional changes in CHANGELOG.md .
160+ 2 . Create an annotated tag for the version: ` git tag -m "0.0.0" 0.0.0 ` .
161+ 3 . Push the changes and tags to GitHub: ` git push --tags origin master `
162+ 4 . Update the ` gh-pages ` branch,
163+ 1 . Copy the latest sanitize.css and test.html from the master branch into
164+ the root directory, the ` latest ` directory, and a new directory named
165+ after the new version: ` 0.0.0 ` .
166+ 2 . Update the sanitize.css version and supported browsers in ` index.html ` .
191167
192168### Semver strategy
193169
194170[ Semver] ( http://semver.org/ ) is a widely accepted method for deciding how
195171version numbers are incremented in a project. Versions are written as
196172MAJOR.MINOR.PATCH.
197173
198- Changes limited to fallback declarations for browsers which do not support
199- newer features produce a PATCH release.
200-
201- Changes limited to normalizations for older browsers produce a MINOR release.
174+ Any change to CSS rules whatsoever is considered backwards-breaking and will
175+ result in a new ** major** release. Others changes with no impact on rendering
176+ are considered backwards-compatible and will result in a new ** patch** release.
177+
178+ No changes to CSS rules can add functionality in a backwards-compatible manner,
179+ therefore no changes are considered ** minor** . For instance, a normalization on
180+ an element selector may override a user style on a universal selector, or a
181+ change to ` opacity ` might cause [ inputs to disappear] ( https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3901363/ ) ,
182+ or a change to ` background-color ` might cause [ backgrounds to shrink] ( https://github.com/jonathantneal/sanitize.css/issues/42 ) .
183+
184+ [ already been reported ] : https://github.com/csstools/sanitize.css/issues
185+ [ fork this project ] : https://github.com/csstools/sanitize.css/fork
186+ [ live example ] : https://codepen.io/pen
187+ [ open a pull request ] : https://help.github.com/articles/using-pull-requests/
188+ [ reduced test case ] : https://css-tricks.com/reduced-test-cases/
0 commit comments