Skip to content

Commit

Permalink
Move options into table to make it more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Brandau committed Feb 25, 2018
1 parent 6a5a117 commit 6594130
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ p.b {
2. [CLI](#cli)
2. [Documentation](#documentation)
1. [Constructor](#constructor)
- [Options](#options)
2. [`#importMap(map, override)`](#importmapmap-override)
3. [`#getMap()`](#getmap)
4. [`#cssStream()`](#cssstream)
Expand Down Expand Up @@ -73,15 +74,23 @@ css-shortener shorten -i input.css -o output.css --map map.json

```js
const options = {
alphabet: 'abcdef', // Alphabet that is used for class name generation
ignorePrefix: 'ignore-me-', // If specified, classes starting with this prefix will be omited from replacing (Default: 'ignore-')
trimIgnorePrefix: false // If true, the prefix will be trimmed off of the classes (Default: true)
alphabet: 'abcdef',
ignorePrefix: 'ignore-me-',
trimIgnorePrefix: false
};
const cs = new CssShortener(options);
```
The default alphabet is `abcefghijklmnopqrstuvwxyz0123456789_-`. Note that there is no `d` to avoid generation of the combination `ad`.
The `options` parameter can be omitted.

#### Options

| Option | Type | Optional | Description | Default value |
| ------ | ---- | -------- | ----------- | ------------- |
| alphabet | *string* | optional | The alphabet is used to generate the new class names. | `'abcefghijklmnopqrstuvwxyz0123456789_-'` |
| ignorePrefix | *string* | optional | Classes starting with this prefix will be omited from replacing. Set to `undefined` to disable. | `'ignore-'` |
| trimIgnorePrefix | *boolean* | optional | If true, the prefix will be trimmed off of the matched classes. | `true` |
Note that there is no `d` in the default alphabet to avoid generation of the combination `ad`.

### `#importMap(map, override)`

Imports mappings into the shortener
Expand Down

0 comments on commit 6594130

Please sign in to comment.