Browse Source
* fix: global icon style * chore: code clean * feat: icon style in CP * chore: code clean * chore: code clean * chore: support ss * feat: wrapSSR only if iconPrefixCls does not equal parent * chore: code clean * chore: fix lint * chore: fix lint * chore: test * chore: wrap children * chore: code clean * chore: fix lintpull/38664/head
MadCcc
2 years ago
committed by
GitHub
4 changed files with 52 additions and 10 deletions
@ -0,0 +1,18 @@ |
|||
import { useStyleRegister } from '@ant-design/cssinjs'; |
|||
import { resetIcon } from '../../style'; |
|||
import { useToken } from '../../theme'; |
|||
|
|||
const useStyle = (iconPrefixCls: string) => { |
|||
const [theme, token] = useToken(); |
|||
// Generate style for icons
|
|||
return useStyleRegister( |
|||
{ theme, token, hashId: '', path: ['ant-design-icons', iconPrefixCls] }, |
|||
() => [ |
|||
{ |
|||
[`.${iconPrefixCls}`]: resetIcon(), |
|||
}, |
|||
], |
|||
); |
|||
}; |
|||
|
|||
export default useStyle; |
Loading…
Reference in new issue