mirror of
				https://github.com/antd-tiny-vue/antd-tiny-vue.git
				synced 2025-10-31 16:51:45 +08:00 
			
		
		
		
	feat: add info
This commit is contained in:
		
							
								
								
									
										29
									
								
								components/space/style/compact.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								components/space/style/compact.tsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| import type { FullToken, GenerateStyle } from '../../theme/internal' | ||||
| /** Component only token. Which will handle additional calculation of alias token */ | ||||
| export interface ComponentToken { | ||||
|   // Component token here | ||||
| } | ||||
|  | ||||
| interface SpaceToken extends FullToken<'Space'> { | ||||
|   // Custom token here | ||||
| } | ||||
|  | ||||
| const genSpaceCompactStyle: GenerateStyle<SpaceToken> = (token) => { | ||||
|   const { componentCls } = token | ||||
|  | ||||
|   return { | ||||
|     [componentCls]: { | ||||
|       display: 'inline-flex', | ||||
|       '&-block': { | ||||
|         display: 'flex', | ||||
|         width: '100%' | ||||
|       }, | ||||
|       '&-vertical': { | ||||
|         flexDirection: 'column' | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| // ============================== Export ============================== | ||||
| export default genSpaceCompactStyle | ||||
							
								
								
									
										54
									
								
								components/space/style/index.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								components/space/style/index.tsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,54 @@ | ||||
| import type { FullToken, GenerateStyle } from '../../theme/internal' | ||||
| import { genComponentStyleHook } from '../../theme/internal' | ||||
| import genSpaceCompactStyle from './compact' | ||||
|  | ||||
| /** Component only token. Which will handle additional calculation of alias token */ | ||||
| export interface ComponentToken { | ||||
|   // Component token here | ||||
| } | ||||
|  | ||||
| interface SpaceToken extends FullToken<'Space'> { | ||||
|   // Custom token here | ||||
| } | ||||
|  | ||||
| const genSpaceStyle: GenerateStyle<SpaceToken> = (token) => { | ||||
|   const { componentCls } = token | ||||
|  | ||||
|   return { | ||||
|     [componentCls]: { | ||||
|       display: 'inline-flex', | ||||
|       '&-rtl': { | ||||
|         direction: 'rtl' | ||||
|       }, | ||||
|       '&-vertical': { | ||||
|         flexDirection: 'column' | ||||
|       }, | ||||
|       '&-align': { | ||||
|         flexDirection: 'column', | ||||
|         '&-center': { | ||||
|           alignItems: 'center' | ||||
|         }, | ||||
|         '&-start': { | ||||
|           alignItems: 'flex-start' | ||||
|         }, | ||||
|         '&-end': { | ||||
|           alignItems: 'flex-end' | ||||
|         }, | ||||
|         '&-baseline': { | ||||
|           alignItems: 'baseline' | ||||
|         } | ||||
|       }, | ||||
|       [`${componentCls}-item`]: { | ||||
|         '&:empty': { | ||||
|           display: 'none' | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| // ============================== Export ============================== | ||||
| export default genComponentStyleHook('Space', (token) => [ | ||||
|   genSpaceStyle(token), | ||||
|   genSpaceCompactStyle(token) | ||||
| ]) | ||||
		Reference in New Issue
	
	Block a user