Skip to content

Commit 748b61b

Browse files
committed
docs: update API list
1 parent 704009c commit 748b61b

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"semi": true,
44
"singleQuote": true,
55
"tabWidth": 2,
6-
"trailingComma": "all"
6+
"trailingComma": "all",
7+
"proseWrap": "never"
78
}

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# @ant-design/cssinjs
22

3-
[![NPM version][npm-image]][npm-url]
4-
[![npm download][download-image]][download-url]
5-
[![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi)
6-
[![build status][github-actions-image]][github-actions-url]
7-
[![Codecov][codecov-image]][codecov-url]
8-
[![Dependencies][david-image]][david-url]
9-
[![DevDependencies][david-dev-image]][david-dev-url]
10-
[![bundle size][bundlephobia-image]][bundlephobia-url]
3+
[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![Dependencies][david-image]][david-url] [![DevDependencies][david-dev-image]][david-dev-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
114

125
[npm-image]: http://img.shields.io/npm/v/@ant-design/cssinjs.svg?style=flat-square
136
[npm-url]: http://npmjs.org/package/@ant-design/cssinjs
@@ -24,8 +17,7 @@
2417
[bundlephobia-url]: https://bundlephobia.com/result?p=@ant-design/cssinjs
2518
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@ant-design/cssinjs
2619

27-
Component level cssinjs solution used in [ant.design](https://ant.design).
28-
It's a subset of [Emotion](https://emotion.sh/) with design token logic wrapper. Please feel free to use emotion directly if you want to find a web cssinjs solution. cssinjs related dep packages:
20+
Component level cssinjs solution used in [ant.design](https://ant.design). It's a subset of [Emotion](https://emotion.sh/) with design token logic wrapper. Please feel free to use emotion directly if you want to find a web cssinjs solution. cssinjs related dep packages:
2921

3022
- stylis
3123
- @emotion/hash
@@ -49,3 +41,27 @@ npm start
4941
## License
5042

5143
@ant-design/cssinjs is released under the MIT license.
44+
45+
## API
46+
47+
### StyleProvider
48+
49+
| Prop | Desc | Type | Default |
50+
| --- | --- | --- | --- |
51+
| autoClear | Clear inject style element when component remove. | boolean | false |
52+
| cache | Config cssinjs cache entity. Only set when you need ssr to extract style on you own. | CacheEntity | - |
53+
| hashPriority | Use `:where` selector to reduce hashId css selector priority | `'low' \| 'high'` | `'low'` |
54+
| container | Tell cssinjs where to inject style in. | Element \| ShadowRoot | `document.head` |
55+
| ssrInline | Component wil render inline `<style />` for fallback in SSR. Not recommend. | boolean | false |
56+
57+
### createCache
58+
59+
return CacheEntity for StyleProvider.
60+
61+
### createTheme
62+
63+
Create theme object. When same algorithm provided, it will return same object.
64+
65+
### Design Token related API
66+
67+
Since `@ant-design/cssinjs` use strong constraints for cache hit performance, we recommend to view demo `basic.tsx` for usage and `animation.tsx` for animation usage.

0 commit comments

Comments
 (0)