Hacker News new | ask | show | jobs
by rukuu001 2562 days ago
CSS that affects a components internal layout should be with the component.

CSS that affects the components appearance (colours, type etc should be with the document).

Of course, communication across teams will affect how successful this is. I’ve seen it go both ways.

PS - read ‘should’ as ‘makes my life easier’

1 comments

If using JSS, you can use a theme for common appearance settings, and use a context that carries that to all components. For example, material-ui uses this approach and I've found it works incredibly well in practice. I've added additional values as needed to my theme and this carries all the way down.

This includes additional/adjusted fonts, colors, etc.