https://kotlinlang.org logo
t

Tash

08/20/2021, 5:15 PM
Is there a preference between providing
Text
its
color
via a
TextStyle
(esp when using a
TextStyle
is coming from a
Theme.typography
), vs via the
color
parameter? i.e.
Copy code
Text(style = MyTheme.typography.title.copy(color = #123456))

VS

Text(style = MyTheme.typography.title, color = #123456)
trying to choose the “best” approach in this case
h

Harsh Bhakta

08/20/2021, 7:02 PM
I had similar question when I was encoding design system. Talked to our designer and he explained to me that in our design system color is not necessarily tied to the typography. So I prefer pattern
2
to pass color as a saperate argument which signifies that they are independent properties. Also less code 😄 than pattern
1
👍🏼 1
2 Views