sanitize.css
Advanced tools
Comparing version 5.0.0 to 6.0.0
# Changes to sanitize.css | ||
### 6.0.0 (June 24, 2018) | ||
- Added: `word-break: break-word` to `html` | ||
- Added: `font-family: inherit` on form elements | ||
- Added: normalize.css updates | ||
- Added: `box-sizing: border-box` to `*, ::before, ::after` | ||
- Removed: `box-sizing: border-box` from `html` and `box-sizing: inherit` from | ||
`html` | ||
- Removed: `color: inherit` and `background-color: transparent` from | ||
`form` | ||
### 5.0.0 (March 1, 2017) | ||
@@ -4,0 +15,0 @@ |
109
LICENSE.md
@@ -1,15 +0,108 @@ | ||
# CC0 1.0 Universal License | ||
# CC0 1.0 Universal | ||
Public Domain Dedication | ||
## Statement of Purpose | ||
The person(s) who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. | ||
The laws of most jurisdictions throughout the world automatically confer | ||
exclusive Copyright and Related Rights (defined below) upon the creator and | ||
subsequent owner(s) (each and all, an “owner”) of an original work of | ||
authorship and/or a database (each, a “Work”). | ||
You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. | ||
Certain owners wish to permanently relinquish those rights to a Work for the | ||
purpose of contributing to a commons of creative, cultural and scientific works | ||
(“Commons”) that the public can reliably and without fear of later claims of | ||
infringement build upon, modify, incorporate in other works, reuse and | ||
redistribute as freely as possible in any form whatsoever and for any purposes, | ||
including without limitation commercial purposes. These owners may contribute | ||
to the Commons to promote the ideal of a free culture and the further | ||
production of creative, cultural and scientific works, or to gain reputation or | ||
greater distribution for their Work in part through the use and efforts of | ||
others. | ||
In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights. | ||
For these and/or other purposes and motivations, and without any expectation of | ||
additional consideration or compensation, the person associating CC0 with a | ||
Work (the “Affirmer”), to the extent that he or she is an owner of Copyright | ||
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and | ||
publicly distribute the Work under its terms, with knowledge of his or her | ||
Copyright and Related Rights in the Work and the meaning and intended legal | ||
effect of CC0 on those rights. | ||
Unless expressly stated otherwise, the person(s) who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. | ||
1. Copyright and Related Rights. A Work made available under CC0 may be | ||
protected by copyright and related or neighboring rights (“Copyright and | ||
Related Rights”). Copyright and Related Rights include, but are not limited | ||
to, the following: | ||
1. the right to reproduce, adapt, distribute, perform, display, communicate, | ||
and translate a Work; | ||
2. moral rights retained by the original author(s) and/or performer(s); | ||
3. publicity and privacy rights pertaining to a person’s image or likeness | ||
depicted in a Work; | ||
4. rights protecting against unfair competition in regards to a Work, | ||
subject to the limitations in paragraph 4(i), below; | ||
5. rights protecting the extraction, dissemination, use and reuse of data in | ||
a Work; | ||
6. database rights (such as those arising under Directive 96/9/EC of the | ||
European Parliament and of the Council of 11 March 1996 on the legal | ||
protection of databases, and under any national implementation thereof, | ||
including any amended or successor version of such directive); and | ||
7. other similar, equivalent or corresponding rights throughout the world | ||
based on applicable law or treaty, and any national implementations | ||
thereof. | ||
When using or citing the work, you should not imply endorsement by the author or the affirmer. | ||
2. Waiver. To the greatest extent permitted by, but not in contravention of, | ||
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and | ||
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright | ||
and Related Rights and associated claims and causes of action, whether now | ||
known or unknown (including existing as well as future claims and causes of | ||
action), in the Work (i) in all territories worldwide, (ii) for the maximum | ||
duration provided by applicable law or treaty (including future time | ||
extensions), (iii) in any current or future medium and for any number of | ||
copies, and (iv) for any purpose whatsoever, including without limitation | ||
commercial, advertising or promotional purposes (the “Waiver”). Affirmer | ||
makes the Waiver for the benefit of each member of the public at large and | ||
to the detriment of Affirmer’s heirs and successors, fully intending that | ||
such Waiver shall not be subject to revocation, rescission, cancellation, | ||
termination, or any other legal or equitable action to disrupt the quiet | ||
enjoyment of the Work by the public as contemplated by Affirmer’s express | ||
Statement of Purpose. | ||
This is a [human-readable summary of the Legal Code](https://creativecommons.org/publicdomain/zero/1.0/) ([read the full text](https://creativecommons.org/publicdomain/zero/1.0/legalcode)). | ||
3. Public License Fallback. Should any part of the Waiver for any reason be | ||
judged legally invalid or ineffective under applicable law, then the Waiver | ||
shall be preserved to the maximum extent permitted taking into account | ||
Affirmer’s express Statement of Purpose. In addition, to the extent the | ||
Waiver is so judged Affirmer hereby grants to each affected person a | ||
royalty-free, non transferable, non sublicensable, non exclusive, | ||
irrevocable and unconditional license to exercise Affirmer’s Copyright and | ||
Related Rights in the Work (i) in all territories worldwide, (ii) for the | ||
maximum duration provided by applicable law or treaty (including future time | ||
extensions), (iii) in any current or future medium and for any number of | ||
copies, and (iv) for any purpose whatsoever, including without limitation | ||
commercial, advertising or promotional purposes (the “License”). The License | ||
shall be deemed effective as of the date CC0 was applied by Affirmer to the | ||
Work. Should any part of the License for any reason be judged legally | ||
invalid or ineffective under applicable law, such partial invalidity or | ||
ineffectiveness shall not invalidate the remainder of the License, and in | ||
such case Affirmer hereby affirms that he or she will not (i) exercise any | ||
of his or her remaining Copyright and Related Rights in the Work or (ii) | ||
assert any associated claims and causes of action with respect to the Work, | ||
in either case contrary to Affirmer’s express Statement of Purpose. | ||
4. Limitations and Disclaimers. | ||
1. No trademark or patent rights held by Affirmer are waived, abandoned, | ||
surrendered, licensed or otherwise affected by this document. | ||
2. Affirmer offers the Work as-is and makes no representations or warranties | ||
of any kind concerning the Work, express, implied, statutory or | ||
otherwise, including without limitation warranties of title, | ||
merchantability, fitness for a particular purpose, non infringement, or | ||
the absence of latent or other defects, accuracy, or the present or | ||
absence of errors, whether or not discoverable, all to the greatest | ||
extent permissible under applicable law. | ||
3. Affirmer disclaims responsibility for clearing rights of other persons | ||
that may apply to the Work or any use thereof, including without | ||
limitation any person’s Copyright and Related Rights in the Work. | ||
Further, Affirmer disclaims responsibility for obtaining any necessary | ||
consents, permissions or other rights required for any use of the Work. | ||
4. Affirmer understands and acknowledges that Creative Commons is not a | ||
party to this document and has no duty or obligation with respect to this | ||
CC0 or use of the Work. | ||
For more information, please see | ||
http://creativecommons.org/publicdomain/zero/1.0/. |
{ | ||
"name": "sanitize.css", | ||
"version": "5.0.0", | ||
"description": "The best-practices CSS foundation", | ||
"version": "6.0.0", | ||
"description": "A best-practices CSS foundation", | ||
"author": "Jonathan Neal <jonathantneal@hotmail.com>", | ||
"contributors": [ | ||
"Jonathan Neal <jonathantneal@hotmail.com> (http://jonathantneal.com/)", | ||
"Nicolas Gallagher <nicolas@nicolasgallagher.com> (http://nicolasgallagher.com/)" | ||
], | ||
"license": "CC0-1.0", | ||
"repository": "jonathantneal/sanitize.css", | ||
"homepage": "https://jonathantneal.github.io/sanitize.css", | ||
"bugs": "https://github.com/jonathantneal/sanitize.css/issues", | ||
"repository": "csstools/sanitize.css", | ||
"homepage": "https://github.com/csstools/sanitize.css#readme", | ||
"bugs": "https://github.com/csstools/sanitize.css/issues", | ||
"main": "sanitize.css", | ||
@@ -16,11 +20,32 @@ "style": "sanitize.css", | ||
"scripts": { | ||
"prepublishOnly": "npm test", | ||
"test": "stylelint sanitize.css" | ||
}, | ||
"devDependencies": { | ||
"stylelint": "^7.9.0", | ||
"stylelint-config-dev": "^1.0.0" | ||
"stylelint": "^9.3.0", | ||
"stylelint-config-standard": "^18.2.0" | ||
}, | ||
"stylelint": { | ||
"extends": "stylelint-config-dev" | ||
} | ||
"extends": "stylelint-config-standard", | ||
"rules": { | ||
"font-family-no-duplicate-names": [ | ||
true, | ||
{ | ||
"ignoreFontFamilyNames": [ | ||
"monospace" | ||
] | ||
} | ||
], | ||
"no-descending-specificity": [ | ||
null | ||
] | ||
} | ||
}, | ||
"keywords": [ | ||
"css", | ||
"normalizes", | ||
"sanitizes", | ||
"browsers", | ||
"fixes" | ||
] | ||
} |
177
README.md
@@ -1,18 +0,8 @@ | ||
# sanitize.css <a href="https://github.com/jonathantneal/sanitize.css"><img src="https://jonathantneal.github.io/sanitize.css/logo.svg" alt="sanitize.css logo" width="80" height="80" align="right"></a> | ||
# sanitize.css [<img src="https://csstools.github.io/sanitize.css/logo.svg" alt="sanitize" width="90" height="90" align="right">][sanitize.css] | ||
[![NPM Version][npm-img]][npm-url] | ||
[![Bower Version][bow-img]][bow-url] | ||
[![CDNJS Version][cdn-img]][cdn-url] | ||
[![Build Status][cli-img]][cli-url] | ||
[![License][lic-img]][lic-url] | ||
[![Gitter Chat][git-img]][git-url] | ||
[sanitize.css] is a CSS library that provides consistent, cross-browser | ||
default styling of HTML elements alongside useful defaults. | ||
[sanitize.css] is a CSS library that corrects broken and missing styles in all | ||
browsers, preserving useful defaults rather than unstyling everything. It’s | ||
developed alongside [normalize.css], so every normalization includes the | ||
browsers or browser versions being targeted, and every opinionated change is | ||
marked and documented. | ||
## Usage | ||
##### NPM | ||
```sh | ||
@@ -22,137 +12,157 @@ npm install --save sanitize.css | ||
##### Bower | ||
**Download** | ||
```sh | ||
bower install --save sanitize-css | ||
``` | ||
See https://csstools.github.io/sanitize.css/latest/sanitize.css | ||
## What does it do? | ||
* Normalizes styles for a wide range of elements. | ||
* Corrects bugs and common browser inconsistencies. | ||
* Provides common, useful defaults. | ||
* Explains what code does using detailed comments. | ||
## Features | ||
##### Box sizing should be inherited and default to border-box | ||
##### Box sizing defaults to border-box | ||
```css | ||
* { | ||
box-sizing: inherit; | ||
*, ::before, ::after { | ||
box-sizing: border-box; | ||
} | ||
``` | ||
html { | ||
box-sizing: border-box; | ||
##### Backgrounds do not repeat by default | ||
```css | ||
*, ::before, ::after { | ||
background-repeat: no-repeat; | ||
} | ||
``` | ||
##### Backgrounds should not repeat by default | ||
##### Pseudo-elements inherit text decoration and vertical alignment | ||
```css | ||
* { | ||
background-repeat: no-repeat; | ||
::before, | ||
::after { | ||
text-decoration: inherit; | ||
vertical-align: inherit; | ||
} | ||
``` | ||
##### Cursor should only change to hint non-obvious interfaces | ||
##### Cursors only change to hint non-obvious interfaces | ||
```css | ||
html { | ||
cursor: default; | ||
cursor: default; | ||
} | ||
``` | ||
##### Documents should not use a margin for outer padding | ||
##### Words break to prevent prevent overflow | ||
```css | ||
html { | ||
word-break: break-all; | ||
} | ||
``` | ||
##### Documents do not use a margin for outer padding | ||
```css | ||
body { | ||
margin: 0; | ||
margin: 0; | ||
} | ||
``` | ||
##### Navigation lists should not include a marker style | ||
##### Navigation lists do not include a marker style | ||
```css | ||
nav ol, nav ul { | ||
list-style: none; | ||
list-style: none; | ||
} | ||
``` | ||
##### Text selections should not include text shadows | ||
##### Text selections do not include text shadows | ||
```css | ||
::selection { | ||
text-shadow: none; | ||
background-color: #b3d4fc; | ||
color: #000; | ||
text-shadow: none; | ||
} | ||
``` | ||
##### Media elements should align to the text center of other content | ||
##### Media elements align to the text center of other content | ||
```css | ||
audio, canvas, iframe, img, svg, video { | ||
vertical-align: middle; | ||
vertical-align: middle; | ||
} | ||
``` | ||
##### SVGs should fallback to their surrounding text color | ||
##### SVGs fallback to the current text color | ||
```css | ||
svg { | ||
fill: currentColor; | ||
fill: currentColor; | ||
} | ||
``` | ||
##### Tables should not include additional border spacing | ||
##### Tables do not include additional border spacing | ||
```css | ||
table { | ||
border-collapse: collapse; | ||
border-collapse: collapse; | ||
} | ||
``` | ||
##### Form controls should be easily style-able | ||
##### Form controls are easily style-able | ||
```css | ||
button, input, select, textarea { | ||
background-color: transparent; | ||
color: inherit; | ||
font-size: inherit; | ||
line-height: inherit; | ||
font-family: inherit; | ||
font-size: inherit; | ||
line-height: inherit; | ||
} | ||
``` | ||
##### Textarea should only resize vertically by default | ||
##### Textareas only resize vertically by default | ||
```css | ||
textarea { | ||
resize: vertical; | ||
resize: vertical; | ||
} | ||
``` | ||
##### Single taps should be dispatched immediately on clickable elements | ||
##### Single taps are dispatched immediately on clickable elements | ||
```css | ||
a, area, button, input, label, select, summary, textarea, [tabindex] { | ||
-ms-touch-action: manipulation; | ||
touch-action: manipulation; | ||
-ms-touch-action: manipulation; | ||
touch-action: manipulation; | ||
} | ||
``` | ||
##### ARIA roles should include visual cursor hints | ||
##### ARIA roles include visual cursor hints | ||
```css | ||
[aria-busy="true"] { | ||
cursor: progress; | ||
cursor: progress; | ||
} | ||
[aria-controls] { | ||
cursor: pointer; | ||
cursor: pointer; | ||
} | ||
[aria-disabled] { | ||
cursor: default; | ||
cursor: default; | ||
} | ||
``` | ||
##### Visually hidden content should remain accessible | ||
##### Visually hidden content remains accessible | ||
```css | ||
[aria-hidden="false"][hidden]:not(:focus) { | ||
clip: rect(0, 0, 0, 0); | ||
display: inherit; | ||
position: absolute; | ||
clip: rect(0, 0, 0, 0); | ||
display: inherit; | ||
position: absolute; | ||
} | ||
@@ -169,36 +179,33 @@ ``` | ||
## Support | ||
## Browser support | ||
At present, sanitize.css supports the current and previous major releases of | ||
popular web browsers. When a new version is released, we begin supporting that | ||
newer version and stop supporting the third version back. Additionally, many | ||
older browsers remain supported without supplementary CSS. | ||
* Chrome (last 3) | ||
* Edge (last 3) | ||
* Firefox (last 3) | ||
* Firefox ESR | ||
* Opera (last 3) | ||
* Safari (last 3) | ||
* iOS Safari (last 2) | ||
* Internet Explorer 9+ | ||
Currently tested and supported browsers in the latest release include | ||
**Android 4.3-4.4+**, **Chrome 50-51+**, **Edge 12-13+**, **Firefox 46-47+**, | ||
**Internet Explorer 10-11**, **iOS 7-8+**, **Opera 37-38+**, **Safari 8-9+**, | ||
and **Windows Phone 8.1+**. | ||
## Contributing | ||
Additionally tested and supported browsers (requiring little supplementary CSS) | ||
include **Internet Explorer 9** and **Safari 7**. | ||
Please read the [contribution guidelines](CONTRIBUTING.md) in order to make the | ||
contribution process easy and effective for everyone involved. | ||
## License | ||
## Similar Projects | ||
**sanitize.css** is dedicated to the [public domain](LICENSE.md). | ||
- [normalize.css] - A cross-browser css foundation. | ||
- [opinionate.css] - A supplement to normalize.css with opinionated rules | ||
[bow-img]: https://img.shields.io/bower/v/sanitize-css.svg | ||
[bow-url]: https://libraries.io/bower/sanitize-css | ||
[cdn-img]: https://img.shields.io/cdnjs/v/10up-sanitize.css.svg | ||
[cdn-url]: https://cdnjs.com/libraries/10up-sanitize.css | ||
[cli-img]: https://img.shields.io/travis/jonathantneal/sanitize.css.svg | ||
[cli-url]: https://travis-ci.org/jonathantneal/sanitize.css | ||
[git-img]: https://img.shields.io/badge/chat-gitter-blue.svg | ||
[git-url]: https://gitter.im/jonathantneal/sanitize.css | ||
[lic-img]: https://img.shields.io/npm/l/sanitize.css.svg | ||
[lic-url]: LICENSE.md | ||
[npm-img]: https://img.shields.io/npm/v/sanitize.css.svg | ||
[npm-url]: https://www.npmjs.com/package/sanitize.css | ||
## Acknowledgements | ||
[normalize.css]: https://github.com/necolas/normalize.css | ||
sanitize.css is a project by [Jonathan Neal](https://github.com/jonathantneal), | ||
built upon normalize.css, a project by | ||
[Jonathan Neal](https://github.com/jonathantneal), | ||
co-created with [Nicolas Gallagher](https://github.com/necolas). | ||
[normalize.css]: https://github.com/csstools/normalize.css | ||
[opinionate.css]: https://github.com/adamgruber/opinionate.css | ||
[reset.css]: http://meyerweb.com/eric/tools/css/reset/ | ||
[sanitize.css]: https://github.com/jonathantneal/sanitize.css | ||
[sanitize.css]: https://github.com/csstools/sanitize.css |
Sorry, the diff of this file is not supported yet
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 1 instance in 1 package
26495
1
100
0
210
438