Skip to content

Commit

Permalink
add 'not-' variants for all pseudo-class variants (and include many t…
Browse files Browse the repository at this point in the history
…ests)
  • Loading branch information
Michael Warner authored and Michael Warner committed Mar 28, 2022
1 parent e361b3a commit a24f130
Show file tree
Hide file tree
Showing 3 changed files with 788 additions and 23 deletions.
24 changes: 24 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,30 @@ export let variantPlugins = {
return `:merge(.peer)${result} ~ &`
})
}

for (let [variantName, state] of pseudoVariants) {
addVariant(`not-${variantName}`, (ctx) => {
let result = typeof state === 'function' ? state(ctx) : state

return `&:not(${result})`
})
}

for (let [variantName, state] of pseudoVariants) {
addVariant(`group-not-${variantName}`, (ctx) => {
let result = typeof state === 'function' ? state(ctx) : state

return `:merge(.group):not(${result}) &`
})
}

for (let [variantName, state] of pseudoVariants) {
addVariant(`peer-not-${variantName}`, (ctx) => {
let result = typeof state === 'function' ? state(ctx) : state

return `:merge(.peer):not(${result}) ~ &`
})
}
},

directionVariants: ({ addVariant }) => {
Expand Down
Loading

0 comments on commit a24f130

Please sign in to comment.