Not Variants
Class | Properties |
---|---|
not-first | &:not(:first-child) |
not-last | &:not(:last-child) |
not-first-of-type | &:not(:first-of-type) |
not-last-of-type | &:not(:last-of-type) |
not-[<value>] | &:not(<value>) |
In order to use this feature, your Tailwind version must support the matchVariant
feature. You're safe if using v3.2.1
or above (I'm not sure about the older versions).
Usage
Single import
// tailwind.config.js | tailwind.config.ts
import { not } from "tailwindcss-addons"
export default {
plugins: [not],
}
Multi import
// tailwind.config.js | tailwind.config.ts
import tailwindcssAddons from "tailwindcss-addons"
export default {
plugins: [
...tailwindcssAddons({
not: false, // Enabled by default
}),
],
}