'Is it a good practice to pass via props functions to styled component file?

I have this code:

return (
    <Container>
        <Title color={status}>Some Title</Title>
        <Subtitle>
            <Icon color={status} width={`${(value / goal) * 100}%`} />
        </Subtitle>
    </Container>
)

Do you think it would be a better practice to put the styles logics in the styled component file?



Solution 1:[1]

I think if styles are much, this is better to put styles logics in another file(e.g styled component). But if styles are little can keep them in the same file in the upper of the definition of a component. because in this case, accessibility to them is easier.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arman Ebrahimi