Closed
Description
Description
Adding @layerstack/tailwind/plugin
, as instructed on https://svelte-ux.techniq.dev/, breaks tailwindcss language server.
Steps to reproduce
npx sv create demo
(add tailwindcss in the creator)npm install svelte-ux
- Create
tailwind.config.cjs
(it is not created automatically in tailwind v4):
const colors = require('tailwindcss/colors');
const layerstack = require('@layerstack/tailwind/plugin');
module.exports = {
content: [
'./src/**/*.{html,svelte}',
'./node_modules/svelte-ux/**/*.{svelte,js}'
],
// See customization docs: https://svelte-ux.techniq.dev/customization
ux: {
themes: {
light: {
primary: colors['orange']['500'],
'primary-content': 'white',
secondary: colors['blue']['500'],
'surface-100': 'white',
'surface-200': colors['gray']['100'],
'surface-300': colors['gray']['300'],
'surface-content': colors['gray']['900'],
'color-scheme': 'light'
},
dark: {
primary: colors['orange']['500'],
'primary-content': 'white',
secondary: colors['blue']['500'],
'surface-100': colors['zinc']['800'],
'surface-200': colors['zinc']['900'],
'surface-300': colors['zinc']['950'],
'surface-content': colors['zinc']['100'],
'color-scheme': 'dark'
},
},
},
plugins: [
layerstack, // uses hsl() color space by default. To use oklch(), use: layerstack({ colorSpace: 'oklch' }),
]
};
- Modify
./src/app.cs
(needed since tailwind v4):@import 'tailwindcss'; @config '../tailwind.config.cjs';
- Now tailwind language server (
@tailwindcss/language-server
) stops working (stops giving autocompletions or documantation, but doesn't crash).
Dependencies
"devDependencies": {
"@sveltejs/adapter-auto": "^4.0.0",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"@tailwindcss/vite": "^4.0.0",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^4.0.0",
"typescript": "^5.0.0",
"vite": "^6.0.0"
},
"dependencies": {
"svelte-ux": "^0.90.2"
}
@tailwindcss/language-server
version: 0.14.4
Other information
- Same is observed, when instead of
@config
directive, we simply use@plugin '@layerstack/tailwind/plugin';
directive. - Upon removing either
@config
or@plugin
directive, the LSP goes back to working normally. - Using other tailwind plugin doesn't have the same effect, e.g.
@plugin '@tailwindcss/typography';
.
Metadata
Metadata
Assignees
Labels
No labels