-
-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Description
hi! thanks all the maintainers for this crucial additional to the tailwind ecosystem, really can't imagine working without it!
problem
not sure if this is the correct repo to report this, but i've noticed that intellisense on vscode would skip classes that were added through local plugins if the following conditions were met:
- i import them via
@plugin
, - the path is a directory, &
- the file entrypoint is
index.ts
instead ofindex.js
on the flipside, tailwind itself would compile them fine & the classes missed by editor tools would show up on the frontend.
repro
include a plugin by its directory, containing only an index.ts
file:
/* globals.css */
@plugin '../grid-auto-fit';
// grid-auto-fit/index.ts
/* eslint-disable @typescript-eslint/unbound-method */
import plugin from 'tailwindcss/plugin';
const tailwindPluginGridAutoFit = plugin(
({ matchUtilities, theme }) => {
matchUtilities(
{
'grid-cols-auto-fit': (v) => ({
gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${String(v)}), 1fr))`,
}),
'grid-rows-auto-fit': (v) => ({
gridTemplateRows: `repeat(auto-fit, minmax(min(100%, ${String(v)}), 1fr))`,
}),
},
{
values: theme('gridAutoFit')!,
},
);
},
{
theme: {
gridAutoFit: ({ theme }) => theme('maxWidth'),
},
},
);
export default tailwindPluginGridAutoFit;
workaround
qualify the path with index.ts
,
/* plugin is: grid-auto-fit/index.ts */
@plugin '../grid-auto-fit/index.ts';
or use js to write the plugin
/* plugin is: grid-auto-fit/index.js */
@plugin '../grid-auto-fit';
environment
i'm working in a nextjs app on react 19:
"tailwindcss": "^4.0.6",
"@tailwindcss/postcss": "^4.0.6",
"next": "^15.1.7",
"react": "^19.0.0",
thanks in advanced for the help!
Metadata
Metadata
Assignees
Labels
No labels