Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Astrocoders/restyled
Styled Components concept for Reason React, only works with bs-react-native for now
https://github.com/Astrocoders/restyled
bucklescript ocaml react-native reason reasonml styled-components
Last synced: 2 months ago
JSON representation
Styled Components concept for Reason React, only works with bs-react-native for now
- Host: GitHub
- URL: https://github.com/Astrocoders/restyled
- Owner: Astrocoders
- License: mit
- Archived: true
- Created: 2017-10-27T11:27:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T12:40:43.000Z (over 5 years ago)
- Last Synced: 2024-10-11T22:49:36.134Z (3 months ago)
- Topics: bucklescript, ocaml, react-native, reason, reasonml, styled-components
- Language: OCaml
- Homepage:
- Size: 59.6 KB
- Stars: 69
- Watchers: 6
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - restyled - react-native for now | Astrocoders | 68 | (OCaml)
README
# bs-restyled
[![Greenkeeper badge](https://badges.greenkeeper.io/Astrocoders/restyled.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/Astrocoders/restyled.svg?branch=master)](https://travis-ci.org/Astrocoders/restyled)Styled Components concept for Reason
## Install
* `yarn add bs-restyled`
* Then add it to your bs-dependencies```js
{
"name": "myapp",
"reason": {
"react-jsx": 2
},
"bs-dependencies": [
"bs-react-native",
"reason-react",
"bs-restyled"
],
"bsc-flags": ["-bs-super-errors"],
}
```## Usage
```ml
module Wrapper = Styled.View {
type styleParams = unit;
let style (_) => Style.(style([flex(1), flexDirection(`column), justifyContent(`center)]));
};let component = ReasonReact.statelessComponent("MyView");
let make = (_children) => {
...component,
render: (_self) =>
...anything else...
}
```Take a look in the [REStyled.re](https://github.com/Astrocoders/restyled/blob/master/re/REStyled.re) for more
### Acknowledgments
Thanks everyone in Reason Discord for pointing me
directions and specially to Jared who proposed this
usage to me here https://gist.github.com/jaredly/a5e0102c060b7a1b40525d41f87843a8