mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-11 09:51:40 +00:00
* feat: add rhea * fix: blocks * feat: build chat example * fix * fix: sidebar * fix * feat: update home * fix * fix * fix * feat: optimizine fonts * feat * fix * fix * fix * fix * fix * fix * fix: font in preview * fix
22 lines
450 B
TypeScript
22 lines
450 B
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
|
|
export function PreviewFontVariables({ className }: { className: string }) {
|
|
React.useLayoutEffect(() => {
|
|
const classNames = className.split(/\s+/).filter(Boolean)
|
|
|
|
if (!classNames.length) {
|
|
return
|
|
}
|
|
|
|
document.documentElement.classList.add(...classNames)
|
|
|
|
return () => {
|
|
document.documentElement.classList.remove(...classNames)
|
|
}
|
|
}, [className])
|
|
|
|
return null
|
|
}
|