Add docblocks
This commit is contained in:
+43
-4
@@ -37,50 +37,87 @@ export const light = createTheme({
|
|||||||
xxl: 26,
|
xxl: 26,
|
||||||
},
|
},
|
||||||
lineHeight: {
|
lineHeight: {
|
||||||
|
xxs: 10,
|
||||||
xs: 12,
|
xs: 12,
|
||||||
s: 14,
|
s: 14,
|
||||||
m: 16,
|
m: 16,
|
||||||
l: 18,
|
l: 18,
|
||||||
xl: 22,
|
xl: 22,
|
||||||
|
xxl: 26,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
|
/** Alias for `width` */
|
||||||
w: ['width'],
|
w: ['width'],
|
||||||
|
/** Alias for `height` */
|
||||||
h: ['height'],
|
h: ['height'],
|
||||||
|
/** Alias for `color` */
|
||||||
c: ['color'],
|
c: ['color'],
|
||||||
|
/** Alias for `backgroundColor` */
|
||||||
bg: ['backgroundColor'],
|
bg: ['backgroundColor'],
|
||||||
|
/** Alias for all directional margin properties */
|
||||||
ma: ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'],
|
ma: ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'],
|
||||||
|
/** Alias for `marginTop` */
|
||||||
mt: ['marginTop'],
|
mt: ['marginTop'],
|
||||||
|
/** Alias for `marginBottom` */
|
||||||
mb: ['marginBottom'],
|
mb: ['marginBottom'],
|
||||||
|
/** Alias for `marginLeft` */
|
||||||
ml: ['marginLeft'],
|
ml: ['marginLeft'],
|
||||||
|
/** Alias for `marginRight` */
|
||||||
mr: ['marginRight'],
|
mr: ['marginRight'],
|
||||||
|
/** Alias for `marginVertical` */
|
||||||
my: ['marginTop', 'marginBottom'],
|
my: ['marginTop', 'marginBottom'],
|
||||||
|
/** Alias for `marginHorizontal` */
|
||||||
mx: ['marginLeft', 'marginRight'],
|
mx: ['marginLeft', 'marginRight'],
|
||||||
/**
|
/** Alias for all directional padding properties */
|
||||||
* Alias for `padding`, maps to all padding properties e.g. `paddingTop`,
|
|
||||||
* `paddingBottom`, etc.
|
|
||||||
*/
|
|
||||||
pa: ['paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight'],
|
pa: ['paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight'],
|
||||||
|
/** Alias for `paddingTop` */
|
||||||
pt: ['paddingTop'],
|
pt: ['paddingTop'],
|
||||||
|
/** Alias for `paddingBottom` */
|
||||||
pb: ['paddingBottom'],
|
pb: ['paddingBottom'],
|
||||||
|
/** Alias for `paddingLeft` */
|
||||||
pl: ['paddingLeft'],
|
pl: ['paddingLeft'],
|
||||||
|
/** Alias for `paddingRight` */
|
||||||
pr: ['paddingRight'],
|
pr: ['paddingRight'],
|
||||||
|
/** Alias for `paddingVertical` */
|
||||||
py: ['paddingTop', 'paddingBottom'],
|
py: ['paddingTop', 'paddingBottom'],
|
||||||
|
/** Alias for `paddingHorizontal` */
|
||||||
px: ['paddingLeft', 'paddingRight'],
|
px: ['paddingLeft', 'paddingRight'],
|
||||||
|
/** Alias for `zIndex` */
|
||||||
z: ['zIndex'],
|
z: ['zIndex'],
|
||||||
|
/** Alias for `borderRadius` */
|
||||||
radius: ['borderRadius'],
|
radius: ['borderRadius'],
|
||||||
},
|
},
|
||||||
macros: {
|
macros: {
|
||||||
|
/** Shorthand for `flexDirection: 'row'` */
|
||||||
row: (_: boolean) => ({flexDirection: 'row'}),
|
row: (_: boolean) => ({flexDirection: 'row'}),
|
||||||
|
/**
|
||||||
|
* Shorthand for `flex: 1`.
|
||||||
|
*
|
||||||
|
* Semantically this is helpful as a direct child of `<Box row>`
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* <Box row>
|
||||||
|
* <Box column>
|
||||||
|
* <Text>Hello</Text>
|
||||||
|
* </Box>
|
||||||
|
* </Box>
|
||||||
|
*/
|
||||||
column: (_: boolean) => ({flex: 1}),
|
column: (_: boolean) => ({flex: 1}),
|
||||||
|
/** Shorthand for `position: 'absolute'` */
|
||||||
abs: (_: boolean) => ({position: 'absolute'}),
|
abs: (_: boolean) => ({position: 'absolute'}),
|
||||||
|
/** Shorthand for `StyleSheet.absoluteFillObject` */
|
||||||
cover: (_: boolean) => ({
|
cover: (_: boolean) => ({
|
||||||
top: 0,
|
top: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
}),
|
}),
|
||||||
|
/** Shorthand for `textTransform: 'uppercase'` */
|
||||||
caps: (_: boolean) => ({textTransform: 'uppercase'}),
|
caps: (_: boolean) => ({textTransform: 'uppercase'}),
|
||||||
|
/**
|
||||||
|
* Shorthand for applying `fontSize` and `fontHeight`, according to our type scale.
|
||||||
|
*/
|
||||||
fontSize(value: 'xs' | 's' | 'm' | 'l' | 'xl', tokens) {
|
fontSize(value: 'xs' | 's' | 'm' | 'l' | 'xl', tokens) {
|
||||||
return {
|
return {
|
||||||
fontSize: tokens.fontSize[value],
|
fontSize: tokens.fontSize[value],
|
||||||
@@ -89,7 +126,9 @@ export const light = createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
|
/** Greater than 800 */
|
||||||
gtMobile: 800,
|
gtMobile: 800,
|
||||||
|
/** Greater than 1300 */
|
||||||
gtTablet: 1300,
|
gtTablet: 1300,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user