Skip to content

react: CSS struct escape hatch #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pjebs opened this issue Sep 4, 2018 · 11 comments
Closed

react: CSS struct escape hatch #61

pjebs opened this issue Sep 4, 2018 · 11 comments

Comments

@pjebs
Copy link

pjebs commented Sep 4, 2018

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 myitcv changed the title CSS struct escape hatch react: CSS struct escape hatch Sep 6, 2018
@myitcv
Copy link
Owner

myitcv commented Sep 6, 2018

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
Copy link
Author

pjebs commented Sep 6, 2018

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
Copy link
Owner

myitcv commented Sep 6, 2018

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

@pjebs
Copy link
Author

pjebs commented Sep 6, 2018

I can add some items as I use them.

@pjebs
Copy link
Author

pjebs commented Sep 7, 2018

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

@pjebs
Copy link
Author

pjebs commented Sep 7, 2018

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
Copy link
Owner

myitcv commented Sep 7, 2018

Do I support CSS 3 only?

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

@pjebs
Copy link
Author

pjebs commented Sep 15, 2018

Here is my pull request: #71

@pjebs
Copy link
Author

pjebs commented Oct 17, 2018

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

@pjebs pjebs closed this as completed Oct 17, 2018
@myitcv
Copy link
Owner

myitcv commented Oct 17, 2018

@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
Copy link
Author

pjebs commented Oct 17, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants