Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Component Lacks Tailwind Styling When Injected Dynamically #1438

Closed
5 tasks done
ntdgo opened this issue Feb 15, 2025 · 0 comments
Closed
5 tasks done

Component Lacks Tailwind Styling When Injected Dynamically #1438

ntdgo opened this issue Feb 15, 2025 · 0 comments
Labels
question A question about usage, not a bug

Comments

@ntdgo
Copy link

ntdgo commented Feb 15, 2025

Describe the bug

I am dynamically injecting a container component using the injectTailwind function. What I expect is that the dynamically created component displays with the Tailwind CSS styles (such as h-[300px], bg-slate-50, dark:bg-slate-900, etc.). What is actually happening is that the container renders without any Tailwind styling.

Reproduction

https://github.com/ntdgo/wxt-react-shadcn-tailwindcss-chrome-extension/blob/f13d3b5140a787d01c77240133e47b3ac0ce3c40/entrypoints/content/App.tsx#L56

Steps to reproduce

  1. Run npm install followed by npm run dev to start the application in development mode.
  2. Ensure that the DOM includes an element with the class .name so that injectTailwind can properly target its parent.
  3. Observe that the dynamically injected container is added to the DOM.
  4. Notice that the expected Tailwind styles are not applied to the container.

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 Intel(R) Core(TM) i5-14400F
    Memory: 15.31 GB / 31.83 GB
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.4.0 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (133.0.3065.59)
  npmPackages:
    wxt: ^0.17.0 => 0.17.12

Used Package Manager

npm

Validations

@ntdgo ntdgo added the pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug label Feb 15, 2025
@aklinker1 aklinker1 added question A question about usage, not a bug and removed pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug labels Feb 16, 2025
@wxt-dev wxt-dev locked and limited conversation to collaborators Feb 16, 2025
@aklinker1 aklinker1 converted this issue into discussion #1444 Feb 16, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question A question about usage, not a bug
Projects
None yet
Development

No branches or pull requests

2 participants