Skip to content

[v4] Source glob pattern ./**/*.{js,ts,jsx,tsx,mdx} does not match Next.js-style catchall route segments like [...slug]. #16287

Closed
@nicksergeant

Description

@nicksergeant

What version of Tailwind CSS are you using?

v4.0.3

What build tool (or framework if it abstracts the build tool) are you using?

  • Next.js 15.1.6
  • PostCSS 8

What version of Node.js are you using?

23.5.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

https://github.com/nicksergeant/tailwind-v4-dynamic-params/

Describe your issue

If you are disabling automatic detection with:

@import 'tailwindcss' source(none);

and then configuring a glob pattern like this:

@source './**/*.{js,ts,jsx,tsx,mdx}';

Source files in directories such as [...slug] will not be picked up: https://github.com/nicksergeant/tailwind-v4-dynamic-params/blob/main/app/%5B...slug%5D/page.tsx

I'm not sure if this is a bug per se, and I have found this workaround:

@source './**/*.{js,ts,jsx,tsx,mdx}';
@source './[[]**[]]/*.{js,ts,jsx,tsx,mdx}';

Example page showing missing style: https://github.com/nicksergeant/tailwind-v4-dynamic-params/blob/main/app/%5B...slug%5D/page.tsx#L4

But I was surprised that ./**/* was not working to pick those up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions