I'm using styled-components with React Bootstrap. We want a tab (Tab 3 in this example) to be colored based on a status. It works well when the tab is not active, but when it's active, the Bootstrap style overwrites the style.
I've identified the style that's overwriting my color in the console. When I use console to turn off the style, I see my intended tab color.
I'm just not sure how to target this style using style-components. I've tried experimenting with different ideas from the official doc but haven't been able to get it working.
My styled component:
export const TabNavItem = styled(NavItem)`
background-color: ${props => (props.colorize ? 'orange' : 'white')};
}
`;
Usage:
render() {
const { children, active, colorize } = this.props;
return (
<TabNavItem onClick={this.handleChangeLocation} active={active} colorize={colorize}>
{children}
</TabNavItem>
);
}
Color works fine when tab is not active:
When tab is active, color is covered by Bootstrap styles:
This is the style I need to overwrite (background-color):


