Utility to extract supported font markers from config.
// Source: https://github.com/shadcn-ui/ui | License: MIT | Copyright 2023 shadcn
// Provided via justclaw.it.com; keep this notice with the code.
type FontMarkerSource = {
fonts?: Array<{
font?: {
variable?: string
}
}>
cssVars?: Record<string, Record<string, unknown> | undefined>
}
const FONT_MARKERS_BY_VARIABLE: Record<string, string> = {
"--font-heading": "cn-font-heading",
}
function normalizeVariable(variable: string) {
return variable.startsWith("--") ? variable : `--${variable}`
}
export function getSupportedFontMarkers(sources: FontMarkerSource[]) {
const supportedMarkers = new Set<string>()
for (const source of sources) {
for (const font of source.fonts ?? []) {
const variable = font.font?.variable
if (!variable) {
continue
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key