
Ask HN: CSS Interfaces - perpetualcrayon
With components, how do you prefer to style your (and 3rd party) components?<p>It seems a logical path would be to start defining CSS Interfaces, so 3rd party widgets will seamlessly style themselves based on a website&#x27;s &quot;theme&quot;.<p>Are there any projects out there on this path?  That have gained traction?
======
maxharris
see [https://github.com/styled-components/styled-
components](https://github.com/styled-components/styled-components) \- it
provides a nice theme interface

~~~
perpetualcrayon
Thanks for the link. I have come across this in the past, and I think it's
great, except it appears that it still deals directly with CSS primitives.

I'm thinking more in terms of: I have a data structure for my "theme", which
styled components has, but this data structure requires no knowledge of the
inner structure of the component in order to style it properly.

What I'm thinking is, if there were some common interface, there wouldn't be
any need to know anything about the structure of the component.

It definitely seems like it would be a difficult problem to solve. I think one
of the first steps toward something like this would be to build up a
vocabulary that represents slightly more generic, composable concepts than
what the CSS primitives represent.

