(props: BaseStylesProps)
| 37 | export type BaseStylesProps = ComponentProps<typeof Base> |
| 38 | |
| 39 | function BaseStyles(props: BaseStylesProps) { |
| 40 | const {children, color = 'fg.default', fontFamily = 'normal', lineHeight = 'default', ...rest} = props |
| 41 | |
| 42 | const {colorScheme, dayScheme, nightScheme} = useTheme() |
| 43 | |
| 44 | /** |
| 45 | * We need to map valid primer/react color modes onto valid color modes for primer/primitives |
| 46 | * valid color modes for primer/primitives: auto | light | dark |
| 47 | * valid color modes for primer/primer: auto | day | night | light | dark |
| 48 | */ |
| 49 | |
| 50 | return ( |
| 51 | <Base |
| 52 | {...rest} |
| 53 | color={color} |
| 54 | fontFamily={fontFamily} |
| 55 | lineHeight={lineHeight} |
| 56 | data-portal-root |
| 57 | data-color-mode={colorScheme?.includes('dark') ? 'dark' : 'light'} |
| 58 | data-light-theme={dayScheme} |
| 59 | data-dark-theme={nightScheme} |
| 60 | > |
| 61 | <GlobalStyle colorScheme={colorScheme?.includes('dark') ? 'dark' : 'light'} /> |
| 62 | {children} |
| 63 | </Base> |
| 64 | ) |
| 65 | } |
| 66 | |
| 67 | export default BaseStyles |
nothing calls this directly
no test coverage detected