({
as,
className,
...props
}: Omit<React.ComponentPropsWithoutRef<T>, 'as' | 'className'> & {
as?: T
className?: string
})
| 1 | import clsx from 'clsx' |
| 2 | |
| 3 | export function Prose<T extends React.ElementType = 'div'>({ |
| 4 | as, |
| 5 | className, |
| 6 | ...props |
| 7 | }: Omit<React.ComponentPropsWithoutRef<T>, 'as' | 'className'> & { |
| 8 | as?: T |
| 9 | className?: string |
| 10 | }) { |
| 11 | let Component = as ?? 'div' |
| 12 | |
| 13 | return ( |
| 14 | <Component |
| 15 | className={clsx( |
| 16 | className, |
| 17 | 'prose dark:prose-invert', |
| 18 | // `html :where(& > *)` is used to select all direct children without an increase in specificity like you'd get from just `& > *` |
| 19 | '[html_:where(&>*)]:mx-auto [html_:where(&>*)]:max-w-2xl [html_:where(&>*)]:lg:mx-[calc(50%-min(50%,theme(maxWidth.lg)))] [html_:where(&>*)]:lg:max-w-5xl', |
| 20 | )} |
| 21 | {...props} |
| 22 | /> |
| 23 | ) |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected