Home

tailwind-ctp-intellisense @2c05f5df3aff955a3c3bfe88be4dcae52b1d5bd9 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-service / src / util / getClassNameDecls.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import { State } from './state'
import { getClassNameParts } from './getClassNameAtPosition'
import removeMeta from './removeMeta'
const dlv = require('dlv')

export function getClassNameDecls(
  state: State,
  className: string
): Record<string, string> | Record<string, string>[] | null {
  const parts = getClassNameParts(state, className)
  if (!parts) return null

  const info = dlv(state.classNames.classNames, [...parts, '__info'])

  if (Array.isArray(info)) {
    return info.map(removeMeta)
  }

  return removeMeta(info)
}