mirror of
https://github.com/antd-tiny-vue/antd-tiny-vue.git
synced 2024-11-10 17:49:18 +08:00
24 lines
721 B
TypeScript
24 lines
721 B
TypeScript
import { useStyleRegister } from '@antd-tiny-vue/cssinjs'
|
|
import type { Ref } from 'vue'
|
|
import { computed } from 'vue'
|
|
import { resetIcon } from '../../style'
|
|
import { useToken } from '../../theme/internal'
|
|
|
|
const useStyle = (iconPrefixCls: Ref<string>) => {
|
|
const [theme, token] = useToken()
|
|
// Generate style for icons
|
|
const info = computed(() => ({ theme: theme.value, token: token.value, hashId: '', path: ['ant-design-icons', iconPrefixCls.value] }))
|
|
return useStyleRegister(info, () => [
|
|
{
|
|
[`.${iconPrefixCls.value}`]: {
|
|
...resetIcon(),
|
|
[`.${iconPrefixCls.value} .${iconPrefixCls.value}-icon`]: {
|
|
display: 'block'
|
|
}
|
|
}
|
|
}
|
|
])
|
|
}
|
|
|
|
export default useStyle
|