Skip to content

Possible bug with layers and JIT compiler #5506

Answered by adamwathan
robdekort asked this question in Help
Discussion options

You must be logged in to vote

Hey Rob! Right now the JIT engine doesn't pay any attention to the layers option — anything in a reserved @layer (base, components, or utilities) is automatically turned into "on demand" styles so it's not inserted unless it's used.

One workaround is to just put the CSS in your CSS file in the right spot but outside of a layer:

@tailwind base;

.some-base-thing {
  /* ... */
}

@tailwind components;

@tailwind utilities;

We should make sure we throw a warning for using the layers option or something though. It's not quite as simple as just making it work unfortunately, because anything in a layer also automatically gets all variants enabled, so in the example above if you put some-base-thing

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@robdekort
Comment options

@sebastiandedeyne
Comment options

Answer selected by robdekort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants