Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Support <meta>/<title> in Fiber renderers#503

Open
carson-katri wants to merge 5 commits intomainfrom
fiber/meta
Open

Support <meta>/<title> in Fiber renderers#503
carson-katri wants to merge 5 commits intomainfrom
fiber/meta

Conversation

@carson-katri
Copy link
Copy Markdown
Member

This adds compatibility with the .htmlMeta() and .htmlTitle() modifiers added in #483. 2 special cases were also added:

  1. WindowGroup has a title parameter, which can now be used to specify the <title> tag in Fiber renderers by extending the _WindowGroupTitle view.

  2. In SwiftUI, if a _BackgroundStyleModifier reaches the top of the scene, it will extend into the top safe area. This PR adds the "theme-color" meta tag when the background style reaches the top of the scene:

Simulator Screen Shot - iPhone 13 Pro - 2022-07-06 at 10 49 28 Screen Shot 2022-07-06 at 10 42 51 AM

While Safari will automatically detect the theme color without the additions from this PR, it will not pick up background color changes due to state. The changes from this PR allow that.

@carson-katri carson-katri added SwiftUI compatibility Tokamak API differences with SwiftUI Fiber Changes related to the FiberReconciler or a FiberRenderer labels Jul 6, 2022

@_spi(TokamakCore)
public struct _WindowGroupTitle: _PrimitiveView {
public let title: Text?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be an optional?

In WindowGroups where title is nil, it should be more efficient to not use a _WindowGroupTitle at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Fiber Changes related to the FiberReconciler or a FiberRenderer SwiftUI compatibility Tokamak API differences with SwiftUI

Development

Successfully merging this pull request may close these issues.

2 participants