-
Notifications
You must be signed in to change notification settings - Fork 349
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
Cross-platform style #11
Comments
|
It's true that one could use styles which don't properly work on native, but there are already subtle differences (e.g. For example in bs-react-native we currently have a solution inspired by elm-css. Another thing to keep in mind is that there are libraries like Animated, which do some magic with styles. In bs-react-native there are already bindings, which could be extracted to work also for the web (cc @wokalski). And there are also things like react-primitives which try to abstract things cross-platform. |
I believe the best approach is to emulate React Native since it defines the lowest common denominator. It's relatively easy. I experimented with it and also https://github.com/Microsoft/reactxp/ is the great source. This is what multiplatform View needs https://github.com/este/este/blob/master/components/EditorElementBox.js#L135 And the Text https://github.com/este/este/blob/master/components/EditorElementText.js From API point of view, I believe we should have a platform styles, browserStyles, nativeStyles, etc. |
IMO the styles should be separate and live in corresponding libs. It’s the natural separation and mixing them introduces coupling for very little (no?) advantage. Libs like |
For the sake of cleaning up the repo (and given how old this issue is) I'm going to close this out. Please re-open if this is still relevant. Thanks! |
Carried over from reasonml-old/reason-react#79. cc @saschatimme
The text was updated successfully, but these errors were encountered: