Commit aa51c136 authored by tom's avatar tom

text and heading component styles

parent a21554b1
import type { ComponentStyleConfig } from '@chakra-ui/theme'; import type { ComponentStyleConfig } from '@chakra-ui/theme';
import type { SystemStyleInterpolation } from '@chakra-ui/theme-tools';
import { mode } from '@chakra-ui/theme-tools';
const baseStyle = { const baseStyle: SystemStyleInterpolation = (props) => {
return {
fontWeight: '500', fontWeight: '500',
letterSpacing: '-0.5px', color: mode('blackAlpha.800', 'whiteAlpha.800')(props),
};
}; };
// WIP
// designer promised to sync theme and page mock-ups
// so that's not the final point yet
const sizes = { const sizes = {
lg: { lg: {
fontSize: '32px', fontSize: '32px',
lineHeight: '40px', lineHeight: '40px',
letterSpacing: '-0.5px',
},
md: {
fontSize: '24px',
lineHeight: '32px',
},
sm: {
fontSize: '18px',
lineHeight: '24px',
}, },
}; };
......
...@@ -2,14 +2,36 @@ import type { ComponentStyleConfig } from '@chakra-ui/theme'; ...@@ -2,14 +2,36 @@ import type { ComponentStyleConfig } from '@chakra-ui/theme';
import type { SystemStyleFunction } from '@chakra-ui/theme-tools'; import type { SystemStyleFunction } from '@chakra-ui/theme-tools';
import { mode } from '@chakra-ui/theme-tools'; import { mode } from '@chakra-ui/theme-tools';
const variantPrimary: SystemStyleFunction = (props) => ({
color: mode('blackAlpha.800', 'whiteAlpha.800')(props),
});
const variantSecondary: SystemStyleFunction = (props) => ({ const variantSecondary: SystemStyleFunction = (props) => ({
color: mode('gray.500', 'gray.400')(props), color: mode('gray.500', 'gray.400')(props),
}); });
const Text: ComponentStyleConfig = { const variantAlternate: SystemStyleFunction = (props) => ({
variants: { color: mode('blue.600', 'blue.300')(props),
});
const variantInherit = {
color: 'inherit',
};
const variants = {
primary: variantPrimary,
secondary: variantSecondary, secondary: variantSecondary,
}, alternate: variantAlternate,
inherit: variantInherit,
};
const defaultProps = {
variant: 'primary',
};
const Text: ComponentStyleConfig = {
defaultProps,
variants,
}; };
export default Text; export default Text;
...@@ -32,7 +32,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => { ...@@ -32,7 +32,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => {
> >
<HStack spacing={ 3 }> <HStack spacing={ 3 }>
<Icon as={ icon } boxSize="30px"/> <Icon as={ icon } boxSize="30px"/>
<Text>{ text }</Text> <Text variant="inherit">{ text }</Text>
</HStack> </HStack>
</Link> </Link>
</NextLink> </NextLink>
......
...@@ -34,7 +34,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => { ...@@ -34,7 +34,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => {
<HStack justifyContent="space-between"> <HStack justifyContent="space-between">
<HStack spacing={ 3 }> <HStack spacing={ 3 }>
<Icon as={ icon } boxSize="30px"/> <Icon as={ icon } boxSize="30px"/>
<Text>{ text }</Text> <Text variant="inherit">{ text }</Text>
</HStack> </HStack>
<ChevronRightIcon boxSize={ 6 }/> <ChevronRightIcon boxSize={ 6 }/>
</HStack> </HStack>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment