-
Notifications
You must be signed in to change notification settings - Fork 179
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
CSS Intellisense not working #593
Comments
I'm sorry, I looked into module code, and saw that it is problem on @tailwindlabs side with |
But as a temporary workaround we can do this (at https://github.com/nuxt-modules/tailwindcss/blob/main/src/module.ts#L142-L148): const resolveConfig: any = await import('tailwindcss/resolveConfig.js').then(r => r.default || r)
const resolvedConfig = resolveConfig(tailwindConfig)
resolvedConfig.plugins = []
addTemplate({
filename: 'tailwind.config.cjs',
getContents: () => `module.exports = ${JSON.stringify(resolvedConfig, null, 2)}`,
write: true
}) |
Can I open pr @atinux? |
Sure thing! |
For those who can't wait the fix, you can use |
* fix: css intellisense not working (#593) * chore: add comment Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
The current fix solves the base resolved configuration, but it does not handle plugins from Tailwind Presets. Reproduction: https://stackblitz.com/edit/nuxt-starter-afebar I believe we could expand upon the fix like this: const resolveConfig: any = await import("tailwindcss/resolveConfig.js").then((r) => r.default || r)
const resolvedConfig = resolveConfig(tailwindConfig)
resolvedConfig.plugins = []
for (const preset of resolvedConfig.presets) {
if(preset.plugins != null) {
preset.plugins = []
}
}
addTemplate({
filename: "tailwind.config.cjs",
getContents: () => `module.exports = ${JSON.stringify(resolvedConfig, null, 2)}`,
write: true,
}) Can I open a PR to add this? |
Yes |
This problem also occurs for me when using Example 1tailwind.config.js: export default {
purge: {
options: {
safelist: [
{ pattern: /(bg|text)-./ },
],
},
},
} tailwind.config.cjs: module.exports = {
'purge': {
'options': {
'safelist': [
{
'pattern': {},
},
],
},
},
'safelist': [
{
'pattern': {},
},
],
}; Example 2 (Tailwind ^3)tailwind.config.js: export default {
safelist: [
{ pattern: /(bg|text)-./ },
],
} tailwind.config.cjs: module.exports = {
"safelist": [
{
"pattern": {}
}
],
} |
Is this still being experienced? This has not been an issue for me recently - I'm not sure what fixed it, maybe the extension was updated in the background, but all intellisense is working flawlessly now. |
tailwindlabs/tailwindcss-intellisense#663 (comment)
It is bug on module side
The text was updated successfully, but these errors were encountered: