Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Post CSS is importing custom utilities, but Tailwind can't find them #431

Closed
RapidOwl opened this issue Jan 29, 2020 · 2 comments
Closed

Comments

@RapidOwl
Copy link

Here's my broken branch.

First off, thanks for Tailwind! I'm really enjoying it.

My problem: I've setup my project using Parcel, PostCSS and Tailwind. But when I try to build, it claims it can't find my custom utilities.

The error:

@apply cannot be used with .mt-px-112 because .mt-px-112 either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that .mt-px-112 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.

This all worked fine when it was in a single css file and was just being processed by Tailwind on its own.

I've checked the output of PostCSS without running it through Tailwind and my custom utilities have definitely been imported.

I also tried (you can see the commented out code in base.css) including my custom utilities directly in base.css and only importing my custom components, but that gives me the same error.

I'm pretty sure I've followed the instructions in the docs, but I must have missed something...

@tlgreg
Copy link

tlgreg commented Jan 29, 2020

Seems like the same issue:
parcel-bundler/parcel#1165

If so, it should be fixed in Parcel 2 (currently in alpha).

@RapidOwl
Copy link
Author

@tlgreg Ah okay cool. I'll try one of the many other bundlers. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants