tailwindlabs / tailwindui-issues

A place to report bugs discovered in Tailwind UI.
236 stars 4 forks source link

can't compile when setting prefix field in config #1471

Closed hp8wvvvgnj6asjm7 closed 1 year ago

hp8wvvvgnj6asjm7 commented 1 year ago

Screenshot 2023-07-06 at 18-27-32 Praivit Ltd

/** @type {import('tailwindcss').Config} */
module.exports = {

  prefix: 'pv-',

  content: [
    "./app/**/*.{tsx,mdx,ts}",
    "./components/**/*.{tsx,mdx,ts}",
    "./src/**/*.{tsx,mdx,ts}",
  ],
  theme: {
    extend: {

      fontFamily: { sans: ['var(--font-riviera-nights)'] },

      colors: {
        'gold': '#8e7d4b',
        'gold-dark': '#e3dbc4',
      },

    },
    container: { center: true },
  },
  plugins: [],
}
reinink commented 1 year ago

Hey! Happy to help out here.

When using a prefix, that prefix must also be included in the classes when using @apply:

.test {
  @apply pv-tracking-wider;
}

Here's a Tailwind Play that illustrates this:

https://play.tailwindcss.com/jbiw3WrNQi?file=css

Hope that helps! 🤙