DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Krzysztof Ε»uraw
Krzysztof Ε»uraw

Posted on • Originally published at krzysztofzuraw.com on

Compiling Tailwind CSS components in monorepo

If you have monorepo with Tailwind CSS components in one package and application in the other you may find that Tailwind won't work for components. To fix that you need to add new entry to content inside tailwind.config.js:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
    "../../packages/ui/**/*.{js,ts,jsx,tsx}", // here is path to Tailwind CSS components package
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

πŸ” If you came here from Google, why not take a look at some of our top posts?