linaria icon indicating copy to clipboard operation
linaria copied to clipboard

CSS props like Styled Components v4

Open MiltonAkash opened this issue 5 years ago • 1 comments

Currently CSS can be used externally using the classname attribute. Is there any way to design css prop in the same way as styled component

asda

Motivation

Sometimes we can think of doing the REUSING with components and not with styling. So it may be useful keeping the styles within the component.

MiltonAkash avatar Dec 24 '20 15:12 MiltonAkash

You can still write css inline in the className prop, so personally I’m against this proposal. Emotion, styled-components, etc have the css prop for technical reasons because their APIs don’t return a plain class name. Linaria does, and that makes the API super straightforward to use anywhere. Unless there’s a technical benefit from introducing a css prop in react (dynamic props somehow?) I think it should stay as-is

madeleineostoja avatar Oct 09 '21 05:10 madeleineostoja