move text styles out of Code.tsx into textStyles

pull/26459/head^2
Corwin Smith 2 years ago
parent 282b4ae0ea
commit 6205ba69d8
  1. 16
      src/components/UI/docs/Code.tsx
  2. 14
      src/theme/foundations/textStyles.ts
  3. 3
      src/theme/index.ts

@ -13,11 +13,7 @@ export const Code: FC<Props> = ({ code }) => {
<Text <Text
as='span' as='span'
background='code-bg' background='code-bg'
fontFamily='"JetBrains Mono", monospace' textStyle='inline-code-snippet'
fontWeight={400}
fontSize='md'
lineHeight={4}
letterSpacing='1%'
pb={2} pb={2}
mb={-2} mb={-2}
> >
@ -28,15 +24,11 @@ export const Code: FC<Props> = ({ code }) => {
( (
<Stack> <Stack>
<ChakraCode <ChakraCode
overflow='hidden' overflow='auto'
p={6} p={6}
background='code-bg-contrast' background='code-bg-contrast'
color='green.50' textStyle='code-block'
fontFamily='"JetBrains Mono", monospace' color='code-text'
fontWeight={400}
fontSize='md'
lineHeight='21.12px'
letterSpacing='1%'
> >
{code.children[0]} {code.children[0]}
</ChakraCode> </ChakraCode>

@ -90,6 +90,20 @@ export const textStyles = {
textAlign: 'center', textAlign: 'center',
fontSize: 'sm' fontSize: 'sm'
}, },
'inline-code-snippet': {
fontFamily: '"JetBrains Mono", monospace',
fontWeight: 400,
fontSize: 'md',
lineHeight: 4,
letterSpacing: '1%'
},
'code-block': {
fontFamily: '"JetBrains Mono", monospace',
fontWeight: 400,
fontSize: 'md',
lineHeight: '21.12px',
letterSpacing: '1%'
},
// TODO: refactor w/ semantic tokens for light/dark mode // TODO: refactor w/ semantic tokens for light/dark mode
'link-light': {}, 'link-light': {},
// TODO: refactor w/ semantic tokens for light/dark mode // TODO: refactor w/ semantic tokens for light/dark mode

@ -29,7 +29,8 @@ const overrides = {
body: { _light: 'gray.800', _dark: 'yellow.50' }, body: { _light: 'gray.800', _dark: 'yellow.50' },
'code-bg': { _light: 'gray.200', _dark: 'gray.700' }, 'code-bg': { _light: 'gray.200', _dark: 'gray.700' },
'code-bg-contrast': { _light: 'gray.800', _dark: 'gray.900' }, 'code-bg-contrast': { _light: 'gray.800', _dark: 'gray.900' },
bg: { _light: 'yellow.50', _dark: 'gray.800' } 'code-text': { _light: 'green.50', _dark: 'green.50' },
bg: { _light: 'yellow.50', _dark: 'gray.800' },
} }
} }
}; };

Loading…
Cancel
Save