-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Override a whole theme
Assuming part of view tree requires look that different it from rest of the app:
PartnerView()
.themeOverride(Theme.partner)Implementation is simple and straightforward:
extension View {
public func themeOverride(_ theme: Theme, animation: Animation? = nil) -> some View {
environment(\.theme, theme)
}
}Override a part of theme
When a view need several different styles, could be more valid use case:
PromoView()
.themeOverride(\.colors.primaryColor, .init(light: .orange, dark: .yellow))or
PromoView()
.themeOverride(primaryColor: .init(light: .orange, dark: .yellow))Implementation is complex, it would require either to convert let to var or generating an enormous number of methods – one for every style.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request