Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Classes added with injectGlobal can't reference each other with @apply #493

Open
phaux opened this issue Oct 18, 2023 · 1 comment
Labels
🐞 Bug Bug or Bug fixes

Comments

@phaux
Copy link

phaux commented Oct 18, 2023

Reproduction

https://stackblitz.com/edit/tw-in-js-twind-4eadgq?file=index.html

injectGlobal`
  @layer utilities {
    .border-test {
      border: 1px solid red;
    }
  }

  @layer components {
    .my-card {
      @apply p-2 rounded-md bg-purple-300 border-test;
    }
  }   
`
<div class="my-card">Test</div>

Describe the bug

my-card doesn't automatically apply border-test. The latter class only works if added directly to the element too.

Severity

annoyance

System Info

{
  "@twind/core": "https://esm.sh/@twind/[email protected]?dev",
  "@twind/preset-tailwind": "https://esm.sh/@twind/[email protected]?dev"
}

Additional Information

No response

@phaux phaux added the 🐞 Bug Bug or Bug fixes label Oct 18, 2023
@stackblitz
Copy link

stackblitz bot commented Oct 18, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Bug or Bug fixes
Projects
None yet
Development

No branches or pull requests

1 participant