2022-11-18 09:55:42 +08:00
|
|
|
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
|
|
import { resetIcon } from '../../style';
|
2022-11-23 20:22:38 +08:00
|
|
|
import { useToken } from '../../theme/internal';
|
2022-11-18 09:55:42 +08:00
|
|
|
|
|
|
|
const useStyle = (iconPrefixCls: string) => {
|
|
|
|
const [theme, token] = useToken();
|
|
|
|
// Generate style for icons
|
|
|
|
return useStyleRegister(
|
|
|
|
{ theme, token, hashId: '', path: ['ant-design-icons', iconPrefixCls] },
|
|
|
|
() => [
|
|
|
|
{
|
2023-01-20 10:31:27 +08:00
|
|
|
[`.${iconPrefixCls}`]: {
|
|
|
|
...resetIcon(),
|
|
|
|
[`.${iconPrefixCls} .${iconPrefixCls}-icon`]: {
|
|
|
|
display: 'block',
|
|
|
|
},
|
|
|
|
},
|
2022-11-18 09:55:42 +08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default useStyle;
|