Home

tailwind-ctp-intellisense @511deb43368129c7a43f5d4bfa8e4b9ae260ee29 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-service / src / util / docsUrl.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import semver from 'semver'

export function docsUrl(version: string, paths: string | string[]): string {
  let major = 0
  let url = 'https://tailwindcss-v0.netlify.app/docs/'
  if (semver.gte(version, '0.99.0')) {
    major = 1
    url = 'https://v1.tailwindcss.com/docs/'
  }
  if (semver.gte(version, '1.99.0')) {
    major = 2
    url = 'https://tailwindcss.com/docs/'
  }
  const path = Array.isArray(paths)
    ? paths[major] || paths[paths.length - 1]
    : paths
  return `${url}${path}`
}