1
1
mirror of https://github.com/primer/css.git synced 2025-01-01 02:32:25 +03:00

fix color system <var> styles

This commit is contained in:
Shawn Allen 2019-01-17 16:04:14 -08:00
parent d51305cd85
commit 8ca4c0e7e6

View File

@ -140,15 +140,13 @@ FadeVariables.propTypes = {
function Swatch(props) { function Swatch(props) {
const {name, value, textColor = overlayColor(value), ...rest} = props const {name, value, textColor = overlayColor(value), ...rest} = props
return ( return (
<Box bg={value} {...rest}> <Box bg={value} color={textColor} {...rest}>
<Text as={Flex} fontSize={1} justifyContent="space-between"> <Text as={Flex} fontSize={1} justifyContent="space-between">
<Box p={3}> <Box p={3}>
<Var color={textColor}>${name}</Var> <Var>${name}</Var>
</Box> </Box>
<Box p={3}> <Box p={3}>
<Text color={textColor} fontFamily="mono"> <Text fontFamily="mono">{value}</Text>
{value}
</Text>
</Box> </Box>
</Text> </Text>
</Box> </Box>
@ -163,7 +161,7 @@ Swatch.propTypes = {
function Var(props) { function Var(props) {
// FIXME: fontStyle should be a prop, right? // FIXME: fontStyle should be a prop, right?
return <Text as="var" fontWeight="bold" fontFamily="mono" css={{fontStyle: 'normal'}} {...props} /> return <Text as="var" fontWeight="bold" fontFamily="mono" style={{fontStyle: 'normal'}} {...props} />
} }
function overlayColor(bg) { function overlayColor(bg) {