🖼️ SVG support 🖼️
This release adds first-class support for SVG elements:
SVG.svg(.viewBox(0, 0, 24, 24), .width(24), .height(24)) {
SVG.title { "Checkmark" }
SVG.path(
.d("M20 6 9 17l-5-5"),
.fill(.none),
.stroke("#0000FF"),
.strokeWidth(2),
.strokeLinecap(.round),
.strokeLinejoin(.round)
)
}Composition of HTML and SVGContent types is unified by the new @ContentBuilder type (superseding @HTMLBuilder).
‼️ Rendering behavior change
The default rendering behavior of HTMLDocument now always renders <meta charset="UTF-8"> in the <head> tag (before <title>). Check your custom head elements to avoid a duplicate meta entry.
Potentially breaking changes
Several public types have been replaced with type aliases, which in some cases can break type resolution or extensions. (eg: HTMLAttribute)
The HTML protocol now refines the more general MarkupContent protocol.
_HTMLRenderToken was extended, which may break custom rendering implementations.
What's Changed
- move to generic
ContentBuilderby @sliemeobn in #102 - bump minimum Swift version to 6.1 by @sliemeobn in #104
- move SVG support into main target by @sliemeobn in #106
- add an SVG to the example by @sliemeobn in #107
- always add
<meta charset="UTF-8">in HTMLDocuments by @sliemeobn in #108 - expose SVG namespace as public constant by @sliemeobn in #110
Full Changelog: 0.7.1...0.8.0