File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
tailwindcss-language-server/src/util/v4
tailwindcss-language-service/src/util/v4 Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,20 @@ export async function loadDesignSystem(
230230 let cache = design . storage [ COMPILE_CACHE ] as Record < string , AstNode [ ] >
231231 let uncached = classes . filter ( ( name ) => cache [ name ] === undefined )
232232
233- let css = design . candidatesToCss ( uncached )
233+ let css = design . candidatesToAst
234+ ? design . candidatesToAst ( uncached )
235+ : design . candidatesToCss ( uncached )
234236
235237 let errors : any [ ] = [ ]
236238
237239 for ( let [ idx , cls ] of uncached . entries ( ) ) {
238240 let str = css [ idx ]
239241
242+ if ( Array . isArray ( str ) ) {
243+ cache [ cls ] = str
244+ continue
245+ }
246+
240247 if ( str === null ) {
241248 cache [ cls ] = [ ]
242249 continue
Original file line number Diff line number Diff line change 11import postcss from 'postcss'
22import type { NamedVariant } from './candidate'
3- import type { Rule } from '../../css'
3+ import type { AstNode , Rule } from '../../css'
44
55export interface Theme {
66 // Prefix didn't exist for earlier Tailwind versions
@@ -54,6 +54,9 @@ export interface DesignSystem {
5454 // Added in v4.1.16
5555 // We can patch it into any design system if it doesn't exist though
5656 storage ?: Record < symbol , any >
57+
58+ // Added in v4.1.18
59+ candidatesToAst ?( classes : string [ ] ) : AstNode [ ] [ ]
5760}
5861
5962export interface DesignSystem {
You can’t perform that action at this time.
0 commit comments