• Stars
    star
    119
  • Rank 297,930 (Top 6 %)
  • Language Reason
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Brings TailwindCSS https://tailwindcss.com to ReasonML

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

  • 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

License

MIT