Add a few more common macros

This commit is contained in:
Eric Bailey
2023-12-19 11:48:34 -06:00
parent 74b971249a
commit a950a44b5f
+11 -2
View File
@@ -123,7 +123,8 @@ export const light = createTheme({
/** Shorthand for `flexDirection: 'row'` */ /** Shorthand for `flexDirection: 'row'` */
row: (_: boolean) => ({flexDirection: 'row', flex: 1}), row: (_: boolean) => ({flexDirection: 'row', flex: 1}),
/** /**
* Shorthand for `flex: 1`. * Shorthand for `flex: 1`. Optionally pass an integer to specify the
* col-span.
* *
* Semantically this is helpful as a direct child of `<Box row>` * Semantically this is helpful as a direct child of `<Box row>`
* *
@@ -132,11 +133,20 @@ export const light = createTheme({
* <Box column> * <Box column>
* <Text>Hello</Text> * <Text>Hello</Text>
* </Box> * </Box>
* <Box column={2}>
* <Text>Hello</Text>
* </Box>
* </Box> * </Box>
*/ */
column: (span: boolean | number) => ({ column: (span: boolean | number) => ({
flex: typeof span === 'number' ? span : 1, flex: typeof span === 'number' ? span : 1,
}), }),
/** Shorthand for `alignItems: 'center'` */
aic: (_: boolean) => ({alignItems: 'center'}),
/** Shorthand for `justifyContent: 'center'` */
jcc: (_: boolean) => ({justifyContent: 'center'}),
/** Shorthand for `justifyContent: 'space-between'` */
jcb: (_: boolean) => ({justifyContent: 'space-between'}),
/** Shorthand for `position: 'absolute'` */ /** Shorthand for `position: 'absolute'` */
abs: (_: boolean) => ({position: 'absolute'}), abs: (_: boolean) => ({position: 'absolute'}),
/** Shorthand for `StyleSheet.absoluteFillObject` */ /** Shorthand for `StyleSheet.absoluteFillObject` */
@@ -157,7 +167,6 @@ export const light = createTheme({
lineHeight: tokens.lineHeight[value], lineHeight: tokens.lineHeight[value],
} }
}, },
fontFamily: (fontFamily: string) => ({fontFamily}),
}, },
breakpoints: { breakpoints: {
/** Greater than 800 */ /** Greater than 800 */