myitcv / x

Mono-repo for all myitcv.io/... Go code
MIT License
103 stars 20 forks source link

react: CSS struct escape hatch #61

Closed pjebs closed 5 years ago

pjebs commented 6 years ago

It would be nice if there was an escape hatch for the CSS struct which contains a map. The map would allow us to add custom CSS attributes because it is currently very limiting.

myitcv commented 6 years ago

Best thing to do here would be to either submit a PR with the additional attributes you require (modifying the "template") or list them here.

We could add an escape hatch, but to be honest doing the "right" thing of adding the attributes explicitly seems better. Particularly as I intend to make these more type-safe.

But open to thoughts/opinions on that stance.

pjebs commented 6 years ago

Obviously it would be better of all possibilities were covered in a type-safe manner. I just don't think that's practical though. I think providing an escape hatch is the perfect balance. You can always add more attributes if you want for type-safety. See: https://reactjs.org/docs/dom-elements.html#style You can see Facebook doesn't even attempt to cover all possibilities like they do for attributes where they provide a list.

myitcv commented 6 years ago

Fair point; I'd be happy reviewing a PR so we can see how it looks/feels in practice.

pjebs commented 6 years ago

I can add some items as I use them.

pjebs commented 6 years ago

Looks useful: https://meiert.com/en/indices/css-properties/

pjebs commented 6 years ago

Do I support CSS 3 only? Also is there a ways to set the "initial value" (prob might make the generated js too large)?

myitcv commented 6 years ago

Do I support CSS 3 only?

Yes please. And I'd work from the spec where possible; it's the definitive reference.

pjebs commented 5 years ago

Here is my pull request: https://github.com/myitcv/x/pull/71

pjebs commented 5 years ago

Closing because I created my own bindings: https://github.com/rocketlaunchr/react/

myitcv commented 5 years ago

@pjebs my apologies, I simply haven't had the time to get round to your various issues and PRs.

All the best with your bindings!

pjebs commented 5 years ago

Thank you @myitcv. Your package was an inspiration for my own bindings.