News for hackers. Stuff that matters.
Re:Have you used styled components and what do you think abo... by taf2 on Tuesday October 01, 2019 @07:21AM (#21124126)
You mean https://www.styled-components.com/ ? I am curious how the components can be themed? My understanding is web components use shadow dom isolating their dom tree from the outer document so wasn’t sure if it is possible to have an outer document css file provide theme colors to the components?
Re:Have you used styled components and what do you think abo... by botvader on Tuesday October 01, 2019 @08:08AM (#21124391)
Are you asking something along these lines: https://css-tricks.com/styling-a-web-component/, not clear on how both questions are related.
Re:Have you used styled components and what do you think abo... by tomvalorsa on Tuesday October 01, 2019 @03:34PM (#21129623)
styled-components is a module used specifically with react.js (i.e. not web components).

Theming is actually handled quite nicely[1]. Essentially, you create a JS object which represents your theme (colours, fonts, spacing etc.) and pass it to a provider component. This will then provide the theme object to any components beneath it in the component tree, so you can pull out values and use them to style your app.

[1] https://www.styled-components.com/docs/advanced#theming