Skip to the content.

re-tailwind

ReasonML utility to generate Tailwind classes

Install

npm install --save re-tailwind

Add re-tailwind to bs-dependencies in bsconfig.json

Usage

  1. Ensure your app already import tailwind css
[%bs.raw {|require("tailwindcss/dist/tailwind.min.css")|}];
  1. 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>;
  };
};

More examples

Credits

Next works:

License

MIT