You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
29
21
30
22
- stylis
31
23
-@emotion/hash
@@ -49,3 +41,27 @@ npm start
49
41
## License
50
42
51
43
@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