tailwindlabs / tailwindcss-setup-examples

674 stars 173 forks source link

Update Next.js example to include a use in a component-level CSS module #64

Open bravokiloecho opened 4 years ago

bravokiloecho commented 4 years ago

Next.js allows for component-level CSS via CSS modules as documented here.

Can the next.js example be updated to include an example of this?

For example, I tried to use:

.header {
  @apply text-lg;
}

in a CSS module and got the following error:

Syntax error: `@apply` cannot be used with `.rows-span-3` because `.rows-span-3` either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that `.rows-span-3` exists, make sure that any `@import` statements are being properly processed *before* Tailwind CSS sees your CSS, as `@apply` can only be used for classes in the same CSS tree.

Many thanks!