Skip to content

Commit 054ff85

Browse files
committed
Document minify option
1 parent 39043f3 commit 054ff85

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ interface Options {
150150
identifiers: CustomStyledIdentifiers;
151151
ssr: boolean;
152152
displayName: boolean;
153+
minify: boolean;
153154
}
154155
```
155156

@@ -190,6 +191,16 @@ To disable `displayName` generation set this option to `false`
190191

191192
Default value is `true` which means that display name is being injected.
192193

194+
### `minify`
195+
196+
The option allows to turn on minification of inline styles used in styled components.
197+
It is similar to [`babel-plugin-styled-components`](https://github.com/styled-components/babel-plugin-styled-components)'s same option.
198+
The minification is not exactly the same and may produce slightly different results.
199+
200+
:warning: **Warning**: The minification is an experimental feature, please use with care.
201+
202+
Default value is `false` which means the minification is not being performed.
203+
193204
### `identifiers`
194205

195206
This option allows to customize identifiers used by `styled-components` API functions.
@@ -201,11 +212,17 @@ This option allows to customize identifiers used by `styled-components` API func
201212
interface CustomStyledIdentifiers {
202213
styled: string[];
203214
attrs: string[];
215+
keyframes: string[];
216+
css: string[];
217+
createGlobalStyle: string[];
204218
}
205219
```
206220

207221
- `styled` - list of identifiers of `styled` API (default `['styled'])
208222
- `attrs` - list of identifiers of `attrs` API (default `['attrs'])
223+
- `keyframes` - list of identifiers of `keyframes` API (default `['keyframes'])
224+
- `css` - list of identifiers of `css` API (default `['css'])
225+
- `createGlobalStyle` - list of identifiers of `createGlobalStyle` API (default `['createGlobalStyle'])
209226

210227
Example
211228

src/models/Options.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ export interface Options {
3131
*/
3232
displayName: boolean;
3333

34+
/**
35+
* Allow minifying of inline styles in styled functions.
36+
* The minification is an experimental feature, please use with care.
37+
*
38+
* @defaultValue `false`
39+
* @experimental The minification feature is experimental.
40+
*/
3441
minify: boolean;
3542
}
3643

0 commit comments

Comments
 (0)