I am currently working on a React JS component that includes multiple buttons, each of which triggers a different popover or tooltip message. I am trying to assign unique background colors to each popover title. I have added the styling for these colors in my CSS file and in my JSX code, implemented a function that retrieves the appropriate background color styling for each popover. However, the coloring is not displaying as expected. I've noticed others using .popover-titles in the CSS, but this would cause all popovers to have the same color. What I need is to apply individual colors to each button's popover.
Any assistance on this matter would be greatly appreciated. Thank you.
import styles from 'cssFile'
CSS
:local .greenColor
background-color: F990099
color: #000000
JSX code
<Popover id="1" title="test title" className={this.getBackgroundColor()}>test</Popover>
// There are multiple Popover elements like this one. I want to use the getBackgroundColor function to retrieve specific styling for each.
getBackgroundColor = () => {
return 'styles.greenColor';
}