H2 heading component.
<H2>This is an h2 heading</H2>
Here's the <H2 />
component in action.
import { forwardRef, type HTMLAttributes } from 'react'import { cn } from '#app/utils/tailwind-merge.ts'
/** * A h2 component. */const H2 = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => <h2 ref={ref} className={cn('h2', className)} {...props} />)H2.displayName = 'H2'
export { H2 }
.h2 { @apply text-muted-900 mt-fluid-14 mb-fluid-11 text-fluid-3xl max-w-prose font-sans font-bold capitalize; /* If h2 has h3 after it */ &:has(+ .h3) { @apply mb-fluid-9; } /* Typographical elements after h2 */ & + .h3, & + .p { @apply mt-0; }}