Skip to content

Tailwindcss v4 compatibility #1460

Closed
Closed

Description

@nishu-murmu

Feature Request

I followed the tailwindcss docs for postcss installation.
They updated the docs, and it isn't working.

Is your feature request related to a bug?

N/A

What are the alternatives?

Manually installing the version given from the example docs package.json

Activity

  1. skube commented on Feb 26, 2025

    @skube
    Contributor

    I could be wrong, but I don't think WXT is compatible with Tailwind v4 yet.

    It does work if you follow the v3 instructions though.
    https://v3.tailwindcss.com/docs/installation/using-postcss

  2. aklinker1 commented on Feb 26, 2025

    @aklinker1
    Member

    Worked just fine for me using the vite plugin:

    aklinker1/github-better-line-counts#42

    There is a problem with shadow roots + borders in tailwind v4, so that is pretty prominent for web extensions and content script UIs. But it didn't effect that extension

  3. nishu-murmu commented on Feb 27, 2025

    @nishu-murmu
    CollaboratorAuthor

    I'm getting this error after upgrading.

    Am I missing something?

    Image

    This is working.
    Basically
    npm install tailwindcss @tailwindcss/postcss postcss command was still installing 3.4.17 version in the docs.

    This looks like tailwindcss issue.

  4. aklinker1 commented on Feb 27, 2025

    @aklinker1
    Member

    Hmm, never seen that error before. Not sure 🤷

    Also, I should mention #1461 here as well

  5. mengxi-ream commented on Apr 17, 2025

    @mengxi-ream
    Contributor

    Worked just fine for me using the vite plugin:

    aklinker1/github-better-line-counts#42

    There is a problem with shadow roots + borders in tailwind v4, so that is pretty prominent for web extensions and content script UIs. But it didn't effect that extension

    import tailwindcss from "@tailwindcss/vite";
    import { defineConfig } from "wxt";
    
    // See https://wxt.dev/api/config.html
    export default defineConfig({
      srcDir: "src",
      modules: ["@wxt-dev/module-react"],
      vite: () => ({
        plugins: [tailwindcss()],
      }),
    });

    This vite plugin works for me, but it has the type error:

    Type '() => { plugins: Plugin<any>[][]; }' is not assignable to type '(env: ConfigEnv) => WxtViteConfig | Promise<WxtViteConfig>'.
      Type '{ plugins: Plugin<any>[][]; }' is not assignable to type 'WxtViteConfig | Promise<WxtViteConfig>'.
        Type '{ plugins: Plugin<any>[][]; }' is not assignable to type 'WxtViteConfig'.
          Types of property 'plugins' are incompatible.
            Type 'Plugin<any>[][]' is not assignable to type 'PluginOption[]'.
              Type 'Plugin<any>[]' is not assignable to type 'PluginOption'.
                Type 'Plugin<any>[]' is not assignable to type 'PluginOption[]'.
                  Type 'Plugin<any>' is not assignable to type 'PluginOption'.

    Apart from using tailwindcss() as any, any other clues this?

  6. aklinker1 commented on Apr 24, 2025

    @aklinker1
    Member

    You have two versions of Vite installed and their types are conflicting.

  7. huangyangteng commented on Apr 30, 2025

    @huangyangteng

    first:
    pnpm add tailwindcss @tailwindcss/vite

    then:
    update wxt.config.ts

    import { defineConfig, type WxtViteConfig } from 'wxt';
    import tailwindcss from "@tailwindcss/vite";
    
    // See https://wxt.dev/api/config.html
    export default defineConfig({
      modules: ['@wxt-dev/module-react'],
      vite: () => ({
        plugins: [tailwindcss()],
      } as WxtViteConfig),
    });
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions