Skip to content

Commit d479d89

Browse files
mario-d-sjonathantneal
authored andcommitted
Add installation / usage instructions to README.md
The README now contains more complete instructions for using it in a modern web development environment (i.e. WebPack). CDN usage has also been added (as mentioned on https://csstools.github.io/sanitize.css/). See also #127.
1 parent 4bf3a92 commit d479d89

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
[sanitize.css] is a CSS library that provides consistent, cross-browser
44
default styling of HTML elements alongside useful defaults.
55

6-
## Usage
6+
## How to get it
7+
8+
**NPM**
79

810
```sh
911
npm install --save sanitize.css
@@ -13,6 +15,41 @@ npm install --save sanitize.css
1315

1416
See https://csstools.github.io/sanitize.css/latest/sanitize.css
1517

18+
**CDN**
19+
20+
see https://cdnjs.com/libraries/10up-sanitize.css
21+
22+
## How to use it (NPM + WebPack)
23+
24+
**Import the package**
25+
26+
in CSS (or LESS/SCSS/Stylus)
27+
28+
```css
29+
@import 'sanitize.css';
30+
```
31+
32+
or in javascript:
33+
34+
```js
35+
import 'sanitize.css';
36+
```
37+
38+
minimally required `webpack.config.js`:
39+
40+
```js
41+
module.exports = {
42+
module: {
43+
rules: [
44+
{
45+
test: /\.css$/,
46+
use: [ 'style-loader', 'css-loader' ]
47+
}
48+
]
49+
}
50+
}
51+
```
52+
1653
## What does it do?
1754

1855
* Normalizes styles for a wide range of elements.

0 commit comments

Comments
 (0)