mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
40944a1c02
* chore: add parent selector * chore: update lint script * chore: code clean * perf: style * chore: remove demo test cssinjs * fix: input group
24 lines
605 B
TypeScript
24 lines
605 B
TypeScript
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
import { resetIcon } from '../../style';
|
|
import { useToken } from '../../theme/internal';
|
|
|
|
const useStyle = (iconPrefixCls: string) => {
|
|
const [theme, token] = useToken();
|
|
// Generate style for icons
|
|
return useStyleRegister(
|
|
{ theme, token, hashId: '', path: ['ant-design-icons', iconPrefixCls] },
|
|
() => [
|
|
{
|
|
[`.${iconPrefixCls}`]: {
|
|
...resetIcon(),
|
|
[`.${iconPrefixCls} .${iconPrefixCls}-icon`]: {
|
|
display: 'block',
|
|
},
|
|
},
|
|
},
|
|
],
|
|
);
|
|
};
|
|
|
|
export default useStyle;
|