Home

tailwind-ctp-intellisense @6304d223aeb9d8cda44e0489280feb29aee2a30e - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-intellisense / src / class-names / getVariants.js
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import semver from 'semver'
import { runPlugin } from './runPlugin'

export default function getVariants({
  config,
  version,
  postcss,
  browserslist,
}) {
  let variants = ['responsive', 'hover']
  semver.gte(version, '0.3.0') && variants.push('focus', 'group-hover')
  semver.gte(version, '0.5.0') && variants.push('active')
  semver.gte(version, '0.7.0') && variants.push('focus-within')
  semver.gte(version, '1.0.0-beta.1') && variants.push('default')
  semver.gte(version, '1.1.0') &&
    variants.push('first', 'last', 'odd', 'even', 'disabled', 'visited')
  semver.gte(version, '1.3.0') && variants.push('group-focus')
  semver.gte(version, '1.5.0') && variants.push('focus-visible', 'checked')
  semver.gte(version, '1.6.0') && variants.push('motion-safe', 'motion-reduce')
  semver.gte(version, '2.0.0-alpha.1') && variants.push('dark')

  let plugins = Array.isArray(config.plugins) ? config.plugins : []

  plugins.forEach((plugin) => {
    runPlugin(plugin, {
      postcss,
      browserslist,
      config,
      addVariant: (name) => {
        variants.push(name)
      },
    })
  })

  return variants
}