mirror of
				https://github.com/antd-tiny-vue/antd-tiny-vue.git
				synced 2025-11-01 01:01:44 +08:00 
			
		
		
		
	feat: add config
This commit is contained in:
		
							
								
								
									
										23
									
								
								components/config-provider/style/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								components/config-provider/style/index.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| 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 | ||||
		Reference in New Issue
	
	Block a user