solidjs / solid-styled-components

A 1kb Styled Components library for Solid
MIT License
280 stars 26 forks source link

Support goober's shouldForwardProp #17

Closed Asha20 closed 2 years ago

Asha20 commented 2 years ago

Issue

I'm trying to use this package together with styled-system. It seems to be working well so far, but the props are forwarded to the resulting HTML element, resulting in invalid attributes. For example, code like this:

<Grid gridGap={[1, 2]} m={3}>
  ...
</Grid>

generates HTML like this:

<div gridgap="1,2" m="2">
  ...
</div>

goober has shouldForwardProp that handles this. I think it would be neat if solid-styled-components could support this as well.

Proposal

Augment the existing setup function to add an optional argument for the shouldForwardProp predicate.


I'd be happy to open a PR if this sounds like something you'd like to merge.

ryansolid commented 2 years ago

Yeah if have a good way of doing this I'm definitely open to the PR. Goober has been adding more features and I haven't been keeping on top of it I'm afraid. So help is much appreciated. Thank you.