Closed lovetodream closed 2 weeks ago
This allows to create custom HTML components and forward attributes from those to the underlying tag.
Example:
struct Title<Title: HTML>: HTML { var attributes: [HTMLAttribute<HTMLTag.h2>] var title: () -> Title init(attributes: HTMLAttribute<HTMLTag.h2>..., @HTMLBuilder title: @escaping () -> Title) { self.attributes = attributes + [.class("mt-14 text-base/7 font-semibold text-zinc-950 sm:text-sm/6 dark:text-white")] self.title = title } var content: some HTML { h2(attributes) { title() } } }
Let me know if I should add tests for this.
Example CI is failing due to changes in the Hummingbird release candidate
This allows to create custom HTML components and forward attributes from those to the underlying tag.
Example:
Let me know if I should add tests for this.