Home

tailwind-ctp-intellisense @01f37e2c30f4acbd263245adcb7b55da01cca624 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-class-names / src / 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
import semver from 'semver'
import { runPlugin } from './runPlugin'

export default function getVariants({ config, version, postcss }) {
  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')

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

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

  return variants
}