MCPcopy
hub / github.com/tailwindlabs/prettier-plugin-tailwindcss / loadTailwindCSS

Function loadTailwindCSS

src/create-plugin.ts:215–242  ·  view source on GitHub ↗
({
  options,
  opts,
}: {
  options: ParserOptions<T>
  opts: TransformOptions<T>
})

Source from the content-addressed store, hash-verified

213}
214
215async function loadTailwindCSS<T = any>({
216 options,
217 opts,
218}: {
219 options: ParserOptions<T>
220 opts: TransformOptions<T>
221}): Promise<TransformerEnv> {
222 let parsers = opts.parsers
223 let parser = options.parser as string
224
225 let context = await getTailwindConfig(options)
226
227 let matcher = createMatcher(options, parser, {
228 staticAttrs: new Set(parsers[parser]?.staticAttrs ?? opts.staticAttrs ?? []),
229 dynamicAttrs: new Set(parsers[parser]?.dynamicAttrs ?? opts.dynamicAttrs ?? []),
230 functions: new Set(),
231 staticAttrsRegex: [],
232 dynamicAttrsRegex: [],
233 functionsRegex: [],
234 })
235
236 return {
237 context,
238 matcher,
239 options,
240 changes: [],
241 }
242}
243
244function transformAst<T = any>({
245 ast,

Callers 1

createParserFunction · 0.85

Calls 2

getTailwindConfigFunction · 0.90
createMatcherFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…