Is there a way to configure a "global" theme that is automatically used everywhere? #240
-
I've created a basic theme, works fine: public extension Theme {
static let basicEnhanced = Theme()
To use it, I need to apply the theme every time I call the view: Markdown("some **text**).markdownTheme(.basicEnhanced)
Is it possible to set automatically set a theme or would I need to create a custom view/wrapper to achieve that? Thanks for an excellent package, Guille! |
Beta Was this translation helpful? Give feedback.
Answered by
gonzalezreal
May 25, 2023
Replies: 1 comment 1 reply
-
Hi @czottmann, The |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
czottmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @czottmann,
The
markdownTheme
modifier adds the theme to the environment of a view tree. So, if you use it in the app's root view, it will propagate to every childMarkdown
view, no matter how deep in the view hierarchy it is.