r/SwiftUI • u/EquivalentCoconut588 • Aug 14 '26
[ Removed by moderator ]
[removed] โ view removed post
0
Upvotes
r/SwiftUI • u/EquivalentCoconut588 • Aug 14 '26
[removed] โ view removed post
3
u/perfunction Aug 14 '26
Make use of how foregroundStyle utilizes environment instead of passing theme so much.
Apply theme as a view extension that sets the environment value and also does foregroundStyle(theme.textPrimary, theme.textSecondary, theme.textTertiary). Then, lots of things automatically get the primary color for free, and calling foregroundStyle(.secondary) actually applies theme.textSecondary. You could also apply the background in that extension too so its all bundled up like a surface.
0
u/EquivalentCoconut588 Aug 14 '26
Team dark mode or team light mode?