I have a react component with text, the colour default set to grey or black depending if it is considered to "active" state.
I am trying to add an on hover to change the colour if it is grey (not active) to dark grey on hover, but not to hover if it is black.
So far I have this component,
<a className="hover:text-green-500" style={{color: activePage === 'example' ? 'black' : "rgba(107, 114, 128)"}} > Example</a>
The "style=..." is preventing the hover:...
from working and I also have the second problem of only want the hover effect to work if the current colour is not black, I am trying to give a UI improvement for indication. I am using tailwind CSS here with React.
So in summary, if Black, hover does nothing. If grey (i.e. set to "rgba(107, 114, 128)") the hover should set it to "hover:text-green-500"