re-tailwind
ReasonML utility to generate Tailwind classes
Install
npm install --save re-tailwind
Add re-tailwind to bs-dependencies
in bsconfig.json
Usage
- Ensure your app already import tailwind css
[%bs.raw {|require("tailwindcss/dist/tailwind.min.css")|}];
- Use function TW.make to construct your tailwind classnames:
module Example = {
[@react.component]
let make = () => {
<div className=TW.([Display(Flex), Float(FloatRight)] |> make)>
{ReasonReact.string("Hello Example")}
</div>;
};
};
Credits
- Typed tailwind which has the same purpose to this project but in TypeScript
Next works:
- Tailwind PPX
- Auto generate ReasonML code for Tailwind CSS by user config