Skip to content
HomePagesHomePages template kit

compileFormatVariantsToCss

One `@custom-variant` per declared format id, each scoped to the frame shell's `data-format` stamp (the frame root itself, or anything inside it).

One @custom-variant per declared format id, each scoped to the frame shell’s data-format stamp (the frame root itself, or anything inside it). Prepend the returned block to the template’s Tailwind entry.

Import from @homepages/template-kit.

function compileFormatVariantsToCss(formats: readonly FormatVariantSource[]): string
Name Type Required Description
formats readonly FormatVariantSource[] required

string

  • when a format id fails {@link formatVariantNameError} — the manifest parse enforces the same rule earlier, so a throw here means the caller compiled formats no defineTemplate produced.