Skip to content

Commit da8850a

Browse files
committed
docs(README): add component usage notes
1 parent 366beb9 commit da8850a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,39 @@ To use it in your code:
9292
import { SQLTemplate } from '@emqx/shared-ui-i18n'
9393
```
9494

95+
## ⚠️ Component Usage Notes
96+
97+
When using components from `@emqx/shared-ui`, please note the following important considerations:
98+
99+
### Tailwind CSS Configuration
100+
101+
If you need to use aiLog related components, **Tailwind CSS is required as a peer dependency**. You must add the `shared-ui-components` directory to your Tailwind CSS configuration:
102+
103+
```js
104+
// tailwind.config.ts
105+
module.exports = {
106+
content: [
107+
// ... your existing content paths
108+
'./node_modules/@emqx/shared-ui-components/**/*.{vue,js,ts,jsx,tsx}',
109+
],
110+
// ... rest of your config
111+
}
112+
```
113+
114+
### Style Import Order
115+
116+
When importing style files, **please ensure that shared-ui style files are imported after Element Plus style files**. Otherwise, icon colors may be affected:
117+
118+
```js
119+
// ✅ Correct order
120+
import 'element-plus/dist/index.css'
121+
import '@emqx/shared-ui/packages/components/aiLog/aiLog.css'
122+
123+
// ❌ Incorrect order - may affect icon colors
124+
import '@emqx/shared-ui/packages/components/aiLog/aiLog.css'
125+
import 'element-plus/dist/index.css'
126+
```
127+
95128
## 📄 License
96129

97130
Apache License 2.0, see [LICENSE](https://github.com/emqx/shared-ui/blob/main/LICENSE).

0 commit comments

Comments
 (0)