Thread
#compose
    Tash

    Tash

    1 year ago
    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.
    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
    Harsh Bhakta

    Harsh Bhakta

    1 year ago
    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