MCPcopy
hub / github.com/tailwindlabs/tailwindcss / parseDeclaration

Function parseDeclaration

packages/tailwindcss/src/css-parser.ts:629–640  ·  view source on GitHub ↗
(
  buffer: string,
  colonIdx: number = buffer.indexOf(':'),
)

Source from the content-addressed store, hash-verified

627}
628
629function parseDeclaration(
630 buffer: string,
631 colonIdx: number = buffer.indexOf(':'),
632): Declaration | null {
633 if (colonIdx === -1) return null
634 let importantIdx = buffer.indexOf('!important', colonIdx + 1)
635 return decl(
636 buffer.slice(0, colonIdx).trim(),
637 buffer.slice(colonIdx + 1, importantIdx === -1 ? buffer.length : importantIdx).trim(),
638 importantIdx !== -1,
639 )
640}
641
642function parseString(
643 input: string,

Callers 1

parseFunction · 0.85

Calls 1

declFunction · 0.90

Tested by

no test coverage detected