How would I access the current theme settings in a...
# compose
s
How would I access the current theme settings in a compose application? i.e. Right now I use
MaterialTheme.typography.h1
statically when I want to set an h1, but how would I gain access to the theme that is actually set to get it’s typography, and potentially overridden styles?
j
Usually you setup your Theme like this:
Copy code
MaterialTheme(
    colors = …,
    typography = …,
    shapes = …
) {
    // app content
}
And set your own Typography (with your custom definition of h1). Then, MaterialTheme.typography.h1 will use your definition of h1.
s
oh, cool. I didn’t realize that’s how it worked. Thanks!