Don't use Tailwind for a design system (2021)
I&#x27;ve used Tailwind extensively at previous companies and inevitably each one creates an abstraction that&#x27;s akin to:<p><pre><code>    const headerClasses = [(list of Tailwind classes here)];

    &lt;header className={...headerClasses}&gt;...&lt;&#x2F;header&gt;
</code></pre>
because the complexity of reading and writing all of the classes is just too much. At that point, you&#x27;ve just reinvented CSS classes. Tailwind fans will tell you to not do this but if multiple companies are independently having the same problem and coming up with the same solution, the onus is not on the user anymore, it&#x27;s on the creator to fix it. @apply can work but again it&#x27;s really not recommended by Tailwind itself, for whatever reason.<p>These days I recommend learning CSS really well and then using Vanilla Extract (<a href="https:&#x2F;&#x2F;vanilla-extract.style" rel="nofollow">https:&#x2F;&#x2F;vanilla-extract.style</a>), a CSS in TypeScript library that compiles down to raw CSS, basically using TS as your preprocessor instead of SCSS. For dynamic styles, they have an optional small runtime.<p>They have a Stitches-like API called Recipes that&#x27;s phenomenal as well, especially for design systems, you can define your variants and what CSS needs to be applied for each one, so you can map your design components 1-to-1 with your code:<p>import { recipe } from &#x27;@vanilla-extract&#x2F;recipes&#x27;;<p>export const button = recipe({
  base: {
    borderRadius: 6
  },<p><pre><code>  variants: {
    color: {
      neutral: { background: &#x27;whitesmoke&#x27; },
      brand: { background: &#x27;blueviolet&#x27; },
      accent: { background: &#x27;slateblue&#x27; }
    },
    size: {
      small: { padding: 12 },
      medium: { padding: 16 },
      large: { padding: 24 }
    },
    rounded: {
      true: { borderRadius: 999 }
    }
  },

  &#x2F;&#x2F; Applied when multiple variants are set at once
  compoundVariants: [
    {
      variants: {
        color: &#x27;neutral&#x27;,
        size: &#x27;large&#x27;
      },
      style: {
        background: &#x27;ghostwhite&#x27;
      }
    }
  ],

  defaultVariants: {
    color: &#x27;accent&#x27;,
    size: &#x27;medium&#x27;
  }</code></pre>
});<p>Impressive that OP still is using ReasonReact, I thought it was all but dead after ReScript.