https://github.com/Rohea/re-polished
An idiomatic ReasonML port of Polished library - to be used in a ReScript project or alike
https://github.com/Rohea/re-polished
Last synced: 8 months ago
JSON representation
An idiomatic ReasonML port of Polished library - to be used in a ReScript project or alike
- Host: GitHub
- URL: https://github.com/Rohea/re-polished
- Owner: Rohea
- Created: 2020-01-17T11:49:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-28T15:25:17.000Z (over 1 year ago)
- Last Synced: 2025-04-18T01:37:05.430Z (9 months ago)
- Language: Reason
- Homepage:
- Size: 311 KB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - re-polished - to be used in a ReScript project or alike | Rohea | 13 | (Reason)
README
# Re-Polished
A reimplementation of the great [Polished](https://polished.js.org/) library in [ReasonML](https://reasonml.github.io/en/) with following goals:
- Provide data types for color manipulation
- Implement many of the color manipulation functions from Polished in platform agnostic ReasonML.
- Offer a binding layer for [bs-css](https://github.com/reasonml-labs/bs-css) and others (?) for easier use on web platform in [ReScript](https://rescript-lang.org/)
## Installation with bs-css
```
yarn add @rohea/re-polished-bs-css
```
Then add `@rohea/re-polished` and `@rohea/re-polished-bs-css` to `bs-dependencies` in your `bsconfig.json`.
## Usage with bs-css
```
let myClass = Css.style([
Css.backgroundColor(`hex("ff0000")->PolishedCss.darken(0.5))
]);
```
## Installation without bindings
```
yarn add @rohea/re-polished
```
Then add `@rohea/re-polished` to `bs-dependencies` in your `bsconfig.json`.
## Supported functions
- darken
- desaturate
- invert
- lighten
- mix
- opacify
- readable
- shade
- tint
- transparentize
- setAlpha
New functions are added as soon as we need them or someone makes a nice pull request :)
## TODO
- Add more functions
## A note about the future plans
It is likely that this library will develop prioritizing the web platform needs and maintain compatibility with ReScript as that is currently the primary usecase for the authors. However, if there are any users on native side and something breaks, don't hesitate to let us know :)