What version of Tailwind CSS are you using?
latest insiders (21st April 2022)
This PR added the ability to use rgb/hsl custom properties: #7933
This unfortunately does not work with prefixes.
The following class does not generate anything: tw-bg-[rgb(var(--background))] and still requires a color: hint.