package layout type ( Alignment templ.Attributes ScreenWidth templ.Attributes ) var ( AlignCenter = Alignment{ "class": "flex items-center justify-center", } AlignEnd = Alignment{ "class": "flex items-end justify-center", } MaxWidthSmall = ScreenWidth{ "class": "max-w-screen-sm", } MaxWidthMedium = ScreenWidth{ "class": "max-w-screen-md", } MaxWidthFull = ScreenWidth{ "class": "w-full", } ) // Layout is a component that renders the general layout of the application templ Root(title string) { @Head(title, "0.0.7")
{ children... }
} templ Head(title string, nebulaVersion string) { @Turnstile() @Tailwind() @Alpine() @Htmx() @Dexie() @Nebula(nebulaVersion) { title } { children... } } templ Body(align Alignment, screenWidth ScreenWidth) {
{ children... }
} func Clsx(attrs ...templ.Attributes) templ.Attributes { merged := templ.Attributes{} for _, attr := range attrs { for k, v := range attr { merged[k] = v } } return merged }