File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
tailwindcss-language-server/src/util/v4
tailwindcss-language-service/src/util/v4 Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,10 @@ export async function loadDesignSystem(
226226 dependencies : ( ) => dependencies ,
227227
228228 compile ( classes : string [ ] ) : AstNode [ ] [ ] {
229+ if ( design . candidatesToAst ) {
230+ return design . candidatesToAst ( classes ) . map ( ( ast ) => ast . map ( cloneAstNode ) )
231+ }
232+
229233 // 1. Compile any uncached classes
230234 let cache = design . storage [ COMPILE_CACHE ] as Record < string , AstNode [ ] >
231235 let uncached = classes . filter ( ( name ) => cache [ name ] === undefined )
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