eslint-plugin-tailwindcss
eslint-plugin-tailwindcss copied to clipboard
[BUG] `[&>button]:bg-opacity-90` should be valid for `migration-from-tailwind-2` rule
Describe the bug The code below is currently displaying a warning
Classname '[&>button]:bg-opacity-90' should be replaced by an opacity suffix (eg. '/90')
<div className="[&>button]:bg-opacity-90">
<button className="bg-green-400">Login</button>
<button className="bg-red-500">Register</button>
</div>
Expected behvior
Rule migration-from-tailwind-2
should be valid for child selector: [&>]
, [&_]
Screenshots
Rule
migration-from-tailwind-2
should be valid for child selector:[&>]
,[&_]
Why do you think so? I’d suggest that this code should be refactored to:
<div>
<button className="bg-green-400/90">Login</button>
<button className="bg-red-500/90">Register</button>
</div>