Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The styled-components happy path (joshwcomeau.com)
34 points by joshwcomeau on Jan 26, 2021 | hide | past | favorite | 1 comment


This is awesome! I've been hearing a lot of buzz recently about CSS variables but I haven't seen such a clean integration. I love the idea of exposing them in the style prop!

The "single-source of style" idea also feels powerful. Essentially the component has a list of approved use cases (e.g. InlineLink knows that it will be used as a child of Aside) and centralizes those. This probably has implications for code splitting, so the styled composition API is a nice escape hatch for long tail use cases.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: