This package serves as an integration layer that combines:
- swift-html-types - Type definitions for HTML elements and attributes
- swift-css-types - Type definitions for CSS properties and values
- pointfree-html - HTML rendering engine
It provides the foundational PointFree HTML integration that powers the higher-level swift-html package.
👉 Use coenttb/swift-html for your projects.
The swift-html
package provides a complete, developer-friendly API for building type-safe HTML and CSS in Swift with a SwiftUI-like syntax:
import HTML
let document = HTMLDocument {
div {
h1 { "Type-safe HTML" }
.color(light: .blue, dark: .red)
.fontSize(.px(24))
p { "With type-safe CSS!" }
.marginTop(.px(10))
}
}
This integration package consists of several modules:
- HTMLElements+PointFreeHTML - PointFree HTML extensions for HTML elements
- HTMLAttributes+PointFreeHTML - PointFree HTML extensions for HTML attributes
- CSS+PointFreeHTML - PointFree HTML extensions for CSS properties
- HTML+CSS+PointFreeHTML - Combined HTML and CSS functionality
This package is typically used as a dependency by other packages in the ecosystem. If you need to use it directly:
dependencies: [
.package(url: "https://github.com/coenttb/swift-html-css-pointfree", from: "0.0.1")
]
- swift-html - 👈 Start here! Complete Swift DSL for HTML and CSS
- swift-html-types - HTML type definitions
- swift-css-types - CSS type definitions
- pointfree-html - HTML rendering engine
Contributions are welcome! Please feel free to submit a Pull Request.
If you have suggestions or find issues, please open a GitHub issue. Your feedback helps make this project better for everyone.
This project is licensed under the Apache 2.0 License. See LICENSE for details.