@rozsazoltan's way of setting variant doesn't work for automatically inheritable properties, like text color. It will break the utility in dark mode unless your text color utility is applied to the direct parent of the text. The example introduced in Tailwind v4 official doc tries to define background color variants, which is fine.